CN108282334B - A multi-party key agreement device, method and system based on blockchain - Google Patents
A multi-party key agreement device, method and system based on blockchain Download PDFInfo
- Publication number
- CN108282334B CN108282334B CN201810329823.7A CN201810329823A CN108282334B CN 108282334 B CN108282334 B CN 108282334B CN 201810329823 A CN201810329823 A CN 201810329823A CN 108282334 B CN108282334 B CN 108282334B
- Authority
- CN
- China
- Prior art keywords
- intelligent contract
- block chain
- blockchain
- smart contract
- participating
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/08—Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
- H04L9/0816—Key establishment, i.e. cryptographic processes or cryptographic protocols whereby a shared secret becomes available to two or more parties, for subsequent use
- H04L9/0838—Key agreement, i.e. key establishment technique in which a shared key is derived by parties as a function of information contributed by, or associated with, each of these
Landscapes
- Engineering & Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
本发明提供了一种基于区块链的多方密钥协商装置、方法及系统,该装置包括:至少两个参与节点和验证节点;其中,每一个参与节点,用于向外部的BaaS平台发送区块链服务申请;获取BaaS平台根据区块链服务申请分配的区块链;根据域参数和生成元以及自身生成的随机数,生成第一智能合约,并将第一智能合约发送到区块链中;从区块链中获取其他参与节点发布的第二智能合约,根据第一智能合约和第二智能合约生成第三智能合约,并将第三智能合约发布到所述区块链中;验证节点,用于执行区块链中的当前智能合约,以使各个参与节点达成共识;其中,当前智能合约包括:第一智能合约、第二智能合约和第三智能合约中的任意一个。本方案能提高多方密钥协商的效率。
The present invention provides a blockchain-based multi-party key agreement device, method and system, the device includes: at least two participating nodes and a verification node; wherein each participating node is used to send a zone to an external BaaS platform Block chain service application; obtain the block chain allocated by the BaaS platform according to the block chain service application; generate the first smart contract according to the domain parameters and generators and the random number generated by itself, and send the first smart contract to the block chain middle; obtain the second smart contract issued by other participating nodes from the blockchain, generate a third smart contract according to the first smart contract and the second smart contract, and publish the third smart contract to the blockchain; verify The node is used to execute the current smart contract in the blockchain, so that each participating node reaches a consensus; wherein, the current smart contract includes: any one of the first smart contract, the second smart contract and the third smart contract. This scheme can improve the efficiency of multi-party key negotiation.
Description
技术领域technical field
本发明涉及计算机技术领域,特别涉及一种基于区块链的多方密钥协商装置、方法及系统。The present invention relates to the field of computer technology, in particular to a block chain-based multi-party key agreement device, method and system.
背景技术Background technique
密钥协商是一种密钥建立技术,通过系统中的两个或多个参与方共同提供信息,然后各个参与方可根据其他参与方提供的信息,推导出一个任何一个参与方不能预先确定结果的共享密钥,然后各个参与方根据共享密钥共享数据,以保证数据安全性。Key agreement is a key establishment technology. Two or more participants in the system jointly provide information, and then each participant can deduce a result that cannot be predetermined by any participant based on the information provided by other participants. Then each participant shares data according to the shared key to ensure data security.
目前,在进行多方协商时,每一个参与方均需在获取到所有其他参与方提供的信息之后,才能计算出对应的共享密钥。例如,当系统中的参与方为 A、B和C时,A需获取到B和C两方提供的信息,才能确定出其对应的共享密钥,同时A需将其对应的信息分别提供给B和C,以使B和C能计算出共享密钥。At present, during multi-party negotiation, each participant needs to obtain the information provided by all other participants before calculating the corresponding shared key. For example, when the participants in the system are A, B, and C, A needs to obtain the information provided by B and C to determine its corresponding shared key, and A needs to provide its corresponding information to B and C so that B and C can calculate the shared key.
当参与密钥协商的参与方数量较大时,采用上述方式进行密钥协商时,每个参与方需进行大量的信息交换和计算过程,从而使得多方密钥协商的效率较低。When the number of participants participating in the key negotiation is large, when the key negotiation is performed in the above manner, each participant needs to perform a large amount of information exchange and calculation process, so that the efficiency of the multi-party key negotiation is low.
发明内容SUMMARY OF THE INVENTION
本发明实施例提供了一种基于区块链的多方密钥协商装置、方法及系统,能提高多方密钥协商的效率。Embodiments of the present invention provide a blockchain-based multi-party key negotiation device, method and system, which can improve the efficiency of multi-party key negotiation.
第一方面,本发明实施例提供了一种基于区块链的多方密钥协商装置,包括:至少两个参与节点和验证节点;其中,In a first aspect, an embodiment of the present invention provides a blockchain-based multi-party key agreement device, including: at least two participating nodes and a verification node; wherein,
每一个所述参与节点,用于向外部的区块链即服务BaaS平台发送区块链服务申请;获取所述BaaS平台根据所述区块链服务申请分配的区块链;根据预设的域参数和生成元以及自身生成的随机数,生成第一智能合约,并将所述第一智能合约发送到所述区块链中;从所述区块链中获取所述至少两个参与节点中的其他参与节点发布的第二智能合约,根据所述第一智能合约和所述第二智能合约生成第三智能合约,并将所述第三智能合约发布到所述区块链中;Each of the participating nodes is used to send a blockchain service application to an external blockchain-as-a-service BaaS platform; obtain the blockchain allocated by the BaaS platform according to the blockchain service application; parameters, generators and random numbers generated by itself, generate a first smart contract, and send the first smart contract to the blockchain; obtain the at least two participating nodes from the blockchain The second smart contract published by other participating nodes, generate a third smart contract according to the first smart contract and the second smart contract, and publish the third smart contract to the blockchain;
所述验证节点,用于执行所述区块链中的当前智能合约,以使各个所述参与节点达成共识;其中,所述当前智能合约包括:所述第一智能合约、第二智能合约和所述第三智能合约中的任意一个。The verification node is used to execute the current smart contract in the blockchain, so that each of the participating nodes reaches a consensus; wherein, the current smart contract includes: the first smart contract, the second smart contract and the any one of the third smart contracts.
优选地,Preferably,
每一个所述参与节点,用于利用下述计算公式计算所述第一智能合约;Each of the participating nodes is used to calculate the first smart contract using the following calculation formula;
其中,Ni表征第i个所述参与节点对应的第一智能合约;g表征所述生成元,ri表征第i个所述参与节点产生的随机数,a表征所述域参数;Wherein, Ni represents the first smart contract corresponding to the ith participating node; g represents the generator, ri represents the random number generated by the ith participating node, and a represents the domain parameter;
优选地,Preferably,
每一个所述参与节点,用于利用下述计算公式计算所述第三智能合约;Each of the participating nodes is used to calculate the third smart contract using the following calculation formula;
其中,Mij表征第i个所述参与节点对应的第三智能合约,g表征所述生成元,ri表征第i个所述参与节点产生的随机数,tj表征第j个所述其他参与节点发送的第二智能合约,i≠j,a表征所述域参数。Among them, M ij represents the third smart contract corresponding to the i-th participating node, g represents the generator, ri represents the random number generated by the i -th participating node, and t j represents the j-th other The second smart contract sent by the participating nodes, i≠j, a characterizes the domain parameters.
优选地,Preferably,
每一个所述参与节点,用于确定所述区块链中是否存在未获取过的所述第二智能合约,如果是,从所述区块链中获取未获取过的所述第二智能合约,并根据获取的所述第二智能合约以及所述第一智能合约生成第三智能合约,否则,将所述第三智能合约作为协商密钥发布到所述区块链中。Each of the participating nodes is used to determine whether the unacquired second smart contract exists in the blockchain, and if so, obtain the unacquired second smart contract from the blockchain , and generate a third smart contract according to the acquired second smart contract and the first smart contract, otherwise, publish the third smart contract to the blockchain as a negotiated key.
优选地,Preferably,
每一个所述参与节点,进一步用于从所述区块链中获取所述协商密钥,并利用所述协商密钥进行数据传输。Each of the participating nodes is further configured to obtain the negotiated key from the blockchain, and use the negotiated key for data transmission.
第二方面,本发明实施例提供了一种利用上述任一实施例提供的基于区块链的多方密钥协商装置进行密钥协商的方法,包括:In a second aspect, an embodiment of the present invention provides a method for performing key negotiation using the blockchain-based multi-party key agreement device provided by any of the foregoing embodiments, including:
向外部的区块链即服务BaaS平台发送区块链服务申请;Send a blockchain service application to an external blockchain-as-a-service BaaS platform;
获取所述BaaS平台根据所述区块链服务申请分配的区块链;Obtain the blockchain allocated by the BaaS platform according to the blockchain service application;
利用每一个参与节点根据预设的域参数和生成元以及自身生成的随机数,生成第一智能合约,并将所述第一智能合约发送到所述区块链中;Use each participating node to generate a first smart contract according to preset domain parameters and generators and random numbers generated by itself, and send the first smart contract to the blockchain;
利用每一个所述参与节点从所述区块链中获取其他参与节点发布的第二智能合约;Using each of the participating nodes to obtain the second smart contracts issued by other participating nodes from the blockchain;
利用每一个所述参与节点根据所述第一智能合约和所述第二智能合约生成第三智能合约,并将所述第三智能合约发布到所述区块链中;Utilize each of the participating nodes to generate a third smart contract according to the first smart contract and the second smart contract, and publish the third smart contract to the blockchain;
利用验证节点执行所述区块链中的当前智能合约,以使各个所述参与节点达成共识;其中,所述当前智能合约包括:所述第一智能合约、第二智能合约和所述第三智能合约中的任意一个。The current smart contract in the blockchain is executed by the verification node, so that each of the participating nodes reaches a consensus; wherein, the current smart contract includes: the first smart contract, the second smart contract and the third smart contract Any of the smart contracts.
优选地,Preferably,
所述利用每一个参与节点根据预设的域参数和生成元以及自身生成的随机数,生成第一智能合约,包括:Described using each participating node to generate the first smart contract according to the preset domain parameters and generator and the random number generated by itself, including:
利用下述计算公式计算所述第一智能合约;Calculate the first smart contract using the following calculation formula;
其中,Ni表征第i个所述参与节点对应的第一智能合约;g表征所述生成元,ri表征第i个所述参与节点产生的随机数,a表征所述域参数;Wherein, Ni represents the first smart contract corresponding to the ith participating node; g represents the generator, ri represents the random number generated by the ith participating node, and a represents the domain parameter;
优选地,Preferably,
所述根据所述第一智能合约和所述第二智能合约生成第三智能合约,包括:The generating a third smart contract according to the first smart contract and the second smart contract includes:
利用下述计算公式计算所述第三智能合约;Use the following calculation formula to calculate the third smart contract;
其中,Mij表征第i个所述参与节点对应的第三智能合约,g表征所述生成元,ri表征第i个所述参与节点产生的随机数,tj表征第j个所述其他参与节点发送的第二智能合约,i≠j,a表征所述域参数。Among them, M ij represents the third smart contract corresponding to the i-th participating node, g represents the generator, ri represents the random number generated by the i -th participating node, and t j represents the j-th other The second smart contract sent by the participating nodes, i≠j, a characterizes the domain parameters.
优选地,Preferably,
在所述利用每一个所述参与节点从所述区块链中获取其他参与节点发布的第二智能合约之后,进一步包括:After the using each of the participating nodes to obtain the second smart contract issued by the other participating nodes from the blockchain, the method further includes:
确定所述区块链中是否存在未获取过的所述第二智能合约,如果是,从所述区块链中获取未获取过的所述第二智能合约,并根据获取的所述第二智能合约以及所述第一智能合约生成第三智能合约,否则,将所述第三智能合约作为协商密钥发布到所述区块链中。Determine whether there is the second smart contract that has not been acquired in the blockchain, and if so, acquire the second smart contract that has not been acquired from the blockchain, and based on the acquired second smart contract The smart contract and the first smart contract generate a third smart contract, otherwise, the third smart contract is published in the blockchain as a negotiated key.
优选地,Preferably,
在所述将所述第三智能合约作为协商密钥发布到所述区块链中之后,进一步包括:After the third smart contract is published in the blockchain as the negotiated key, the method further includes:
利用各个所述参与节点从所述区块链中获取所述协商密钥;Use each of the participating nodes to obtain the negotiated key from the blockchain;
利用所述协商密钥进行数据传输。Data transmission is performed using the negotiated key.
第三方面,本发明实施例提供了一种基于区块链的多方密钥协商系统,包括:本发明上述任一实施例提供的多方密钥协商装置,以及区块链即服务 BaaS平台;其中,In a third aspect, an embodiment of the present invention provides a blockchain-based multi-party key agreement system, including: the multi-party key agreement device provided by any of the foregoing embodiments of the present invention, and a blockchain-as-a-service BaaS platform; wherein ,
所述BaaS平台,用于根据所述多方密钥协商装置发送的区块链服务申请,为所述多方密钥协商装置分配区块链。The BaaS platform is configured to allocate a blockchain to the multi-party key agreement device according to the blockchain service application sent by the multi-party key agreement device.
优选地,Preferably,
所述多方密钥协商装置,用于从所述区块链中获取协商密钥;the multi-party key agreement device, configured to obtain the negotiated key from the blockchain;
所述BaaS平台,进一步用于在所述多方密钥协商装置获取到所述协商密钥之后,释放所述区块链。The BaaS platform is further configured to release the blockchain after the multi-party key agreement apparatus obtains the negotiated key.
本发明实施例提供了一种基于区块链的多方密钥协商装置、方法及系统,各个参与节点先获得区块链即服务(Blockchain as a Service,BaaS)平台分配的区块链,然后各个参与节点将自身对应的中间结果(第一智能合约或第三智能合约)发布到区块链中,并能从区块链中获取其他参与节点发布的中间结果(第二智能合约)。例如,当参与节点为A、B和C时,A、B和C 分别计算出其对应的第一智能合约(分别为a1、b1和c1)后,将第一智能合约发布至区块链中,B可从区块链中获取C发布的c1,根据c1以及b1计算出第三智能合约b1c1,并将计算出的b1c1发布至区块链中,则A可从区块链中获取b1c1,再结合a1计算出其对应的第三智能合约a1b1c1,并将发布至区块链中。由此可以看出,参与节点无需分别从每个其他参与节点分别获取信息,而可直接从区块链中获取中间结果,在此例中,参与节点A无需分别从B和C获取b1和c1,而是直接从区块链中获取中间结果b1c1,减少了密钥协商过程中的信息交换和计算过程,从而提高了多方密钥协商的效率。Embodiments of the present invention provide a blockchain-based multi-party key agreement device, method, and system. Each participating node first obtains the blockchain allocated by a blockchain as a service (Blockchain as a Service, BaaS) platform, and then each Participating nodes publish their corresponding intermediate results (first smart contract or third smart contract) to the blockchain, and can obtain intermediate results (second smart contracts) published by other participating nodes from the blockchain. For example, when the participating nodes are A, B, and C, A, B, and C calculate their corresponding first smart contracts (a1, b1, and c1, respectively), and then publish the first smart contracts to the blockchain. , B can obtain c1 issued by C from the blockchain, calculate the third smart contract b1c1 according to c1 and b1, and publish the calculated b1c1 to the blockchain, then A can obtain b1c1 from the blockchain, Combined with a1, the corresponding third smart contract a1b1c1 is calculated and released to the blockchain. It can be seen from this that the participating nodes do not need to obtain information from each other participating nodes separately, but can directly obtain the intermediate results from the blockchain. In this example, participating node A does not need to obtain b1 and c1 from B and C, respectively. , but directly obtains the intermediate result b1c1 from the blockchain, which reduces the information exchange and calculation process in the key negotiation process, thereby improving the efficiency of multi-party key negotiation.
附图说明Description of drawings
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to illustrate the embodiments of the present invention or the technical solutions in the prior art more clearly, the following briefly introduces the accompanying drawings that need to be used in the description of the embodiments or the prior art. Obviously, the drawings in the following description are For some embodiments of the present invention, for those of ordinary skill in the art, other drawings can also be obtained according to these drawings without creative efforts.
图1是本发明一个实施例提供的一种基于区块链的多方密钥协商装置的结构示意图;1 is a schematic structural diagram of a blockchain-based multi-party key agreement device provided by an embodiment of the present invention;
图2是本发明一个实施例提供的一种基于区块链的多方密钥协商方法的流程图;2 is a flowchart of a blockchain-based multi-party key agreement method provided by an embodiment of the present invention;
图3是本发明一个实施例提供的一种基于区块链的多方密钥协商系统的结构示意图。FIG. 3 is a schematic structural diagram of a blockchain-based multi-party key agreement system provided by an embodiment of the present invention.
具体实施方式Detailed ways
为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例,基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动的前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to make the purposes, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments It is a part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative work are protected by the present invention. scope.
如图1所示,本发明实施例提供了一种基于区块链的多方密钥协商装置,该装置可以包括:至少两个参与节点101和验证节点102;其中,As shown in FIG. 1 , an embodiment of the present invention provides a blockchain-based multi-party key agreement device, the device may include: at least two participating
每一个所述参与节点101,用于向外部的区块链即服务BaaS平台发送区块链服务申请;获取所述BaaS平台根据所述区块链服务申请分配的区块链;根据预设的域参数和生成元以及自身生成的随机数,生成第一智能合约,并将所述第一智能合约发送到所述区块链中;从所述区块链中获取所述至少两个参与节点中的其他参与节点发布的第二智能合约,根据所述第一智能合约和所述第二智能合约生成第三智能合约,并将所述第三智能合约发布到所述区块链中;Each of the participating
所述验证节点102,用于执行所述区块链中的当前智能合约,以使各个所述参与节点达成共识;其中,所述当前智能合约包括:所述第一智能合约、第二智能合约和所述第三智能合约中的任意一个。The
各个参与节点先获得BaaS平台分配的区块链,然后各个参与节点将自身对应的中间结果(第一智能合约或第三智能合约)发布到区块链中,并能从区块链中获取其他参与节点发布的中间结果(第二智能合约)。然后验证节点自动执行当前智能合约,以使对应的参与节点达成共识。例如,当参与节点为A、B和C时,A、B和C分别计算出其对应的第一智能合约(分别为a1、b1和c1)后,将第一智能合约发布至区块链中,B可从区块链中获取C发布的c1,根据c1以及b1计算出第三智能合约b1c1,并将计算出的 b1c1发布至区块链中,则A可从区块链中获取b1c1,再结合a1计算出其对应的第三智能合约a1b1c1,并将发布至区块链中。由此可以看出,参与节点无需分别从每个其他参与节点分别获取信息,而可直接从区块链中获取中间结果,在此例中,参与节点A无需分别从B和C获取b1和c1,而是直接从区块链中获取中间结果b1c1,减少了密钥协商过程中的信息交换和计算过程,从而提高了多方密钥协商的效率。Each participating node first obtains the blockchain allocated by the BaaS platform, and then each participating node publishes its corresponding intermediate result (first smart contract or third smart contract) to the blockchain, and can obtain other Intermediate results (second smart contracts) published by participating nodes. The validating node then automatically executes the current smart contract so that the corresponding participating nodes can reach a consensus. For example, when the participating nodes are A, B, and C, A, B, and C calculate their corresponding first smart contracts (a1, b1, and c1, respectively), and then publish the first smart contracts to the blockchain. , B can obtain c1 issued by C from the blockchain, calculate the third smart contract b1c1 according to c1 and b1, and publish the calculated b1c1 to the blockchain, then A can obtain b1c1 from the blockchain, Combined with a1, the corresponding third smart contract a1b1c1 is calculated and released to the blockchain. It can be seen from this that the participating nodes do not need to obtain information from each other participating nodes separately, but can directly obtain the intermediate results from the blockchain. In this example, participating node A does not need to obtain b1 and c1 from B and C, respectively. , but directly obtains the intermediate result b1c1 from the blockchain, which reduces the information exchange and calculation process in the key negotiation process, thereby improving the efficiency of multi-party key negotiation.
本发明一个实施例中,每一个所述参与节点101,用于确定所述区块链中是否存在未获取过的所述第二智能合约,如果是,从所述区块链中获取未获取过的所述第二智能合约,并根据获取的所述第二智能合约以及所述第一智能合约生成第三智能合约,否则,将所述第三智能合约作为协商密钥发布到所述区块链中。In an embodiment of the present invention, each of the participating
在这里,在BaaS平台分配并提供区块链服务之后,参与密钥协商的参与节点公开域参数和生成元,产生智能合约并发布到区块链中。然后每个参与节点Pi(假设有n个参与节点,i<n)产生随机数ri,然后根据公式计算出其对应的第一智能合约,其中,Ni表征Pi对应的第一智能合约;g表征所述生成元,ri表征Pi产生的随机数,a表征域参数,并将第一智能合约发布到区块链中。参与节点Pi可根据区块链中其他参与节点Pj发布的中间结果rj(i≠j),利用公式 计算第三智能合约,其中,Mij表征第i个所述参与节点对应的第三智能合约,g表征所述生成元,ri表征第i个所述参与节点产生的随机数,tj表征第j个所述其他参与节点发送的第二智能合约,i≠j,a表征所述域参数。Here, after the BaaS platform allocates and provides blockchain services, the participating nodes participating in the key negotiation disclose domain parameters and generators, generate smart contracts and publish them in the blockchain. Then each participating node P i (assuming there are n participating nodes, i <n) generates a random number ri , and then according to the formula Calculate the corresponding first smart contract, wherein, Ni represents the first smart contract corresponding to Pi ; g represents the generator, ri represents the random number generated by Pi , a represents the domain parameter, and the first Smart contracts are published into the blockchain. Participating node P i can use the formula according to the intermediate results r j (i≠j) published by other participating nodes P j in the blockchain. Calculate the third smart contract, wherein M ij represents the third smart contract corresponding to the i-th participating node, g represents the generator, ri represents the random number generated by the i -th participating node, and t j represents the The second smart contract sent by the jth other participating node, i≠j, a represents the domain parameter.
将确定的第三智能合约发布至区块链中,验证节点自动执行该智能合约,则Pi和Pj达成共识。在Pi计算的同时,其他参与节点也在根据区块链中发布的中间结果进行相同的计算,并将计算结果发布到区块链中,则Pi可利用区块链中发布的中间结果继续计算。在此过程中,Pi先确定区块链中是否存在其他参与节点发布的中间结果(第二智能合约)Mxy(1≤x<y≤n),如果有,则根据Mxy重新计算第三智能合约并将其发布到区块链中。循环执行该计算过程,直至区块链中不存在Pi未获取过的中间结果,即Pi得到Mx…y,其中,x…y包括1至n中除i以外的n-1个值,再结合ri计算出得到最终的协商密钥,并将该协商密钥发布到区块链中。Publish the determined third smart contract to the blockchain, and the verification node automatically executes the smart contract, then P i and P j reach a consensus. At the same time as P i is calculated, other participating nodes are also performing the same calculation according to the intermediate results published in the blockchain, and publish the calculation results to the blockchain, then P i can use the intermediate results published in the blockchain. Continue to calculate. In this process, Pi first determines whether there is an intermediate result (second smart contract) M xy (1≤x< y≤n ) published by other participating nodes in the blockchain, and if so, recalculates the first result according to M xy Three smart contracts and publish it to the blockchain. The calculation process is executed cyclically until there is no intermediate result that Pi has not obtained in the blockchain, that is, Pi obtains M x...y , where x...y includes n-1 values from 1 to n except for i , and then combined with ri to calculate Get the final negotiated key and publish the negotiated key to the blockchain.
例如,当参与节点为A、B、C和D时,D也将自身计算出的第一智能合约d1发布到区块链中,A在获取到B发布的中间结果b1c1后,计算出a1b1c1,然后确定出区块链中还存在其未获取过的d1,此时A继续获取d1,然后根据获取到的d1重新计算出第三智能合约a1b1c1d1,此时区块链中不存在A未获取过的中间结果,则a1b1c1d1即为最终的协商密钥。由此,各个参与节点通过从区块链中获取其他参与节点计算出的中间结果,并利用中间结果继续计算,从而减少了密钥协商过程中的信息交换和计算过程,从而提高了多方密钥协商的效率。同时利用区块链技术,有效保证了数据的安全性。For example, when the participating nodes are A, B, C and D, D also publishes the first smart contract d1 calculated by itself to the blockchain. After A obtains the intermediate result b1c1 published by B, it calculates a1b1c1, Then it is determined that there is still d1 that it has not acquired in the blockchain. At this time, A continues to acquire d1, and then recalculates the third smart contract a1b1c1d1 according to the acquired d1. At this time, there is no unacquired d1 in the blockchain. The intermediate result, a1b1c1d1 is the final negotiation key. As a result, each participating node obtains the intermediate results calculated by other participating nodes from the blockchain, and uses the intermediate results to continue the calculation, thereby reducing the information exchange and calculation process in the key negotiation process, thereby improving the multi-party key. Efficiency of negotiation. At the same time, the blockchain technology is used to effectively ensure the security of data.
综上所述,各个参与密钥协商的参与节点通过P2P共识网络共同维护一份账本(区块链),账本中记录了密钥协商公开参数、密钥协商中间结果,通过执行智能合约实现各个参与节点间的相互协作,完成密钥协商任务。其中,各个参与节点通过提供基础区块链基础服务的BaaS平台,通过共识网络将智能合约写入区块链中,并由共识网络中的验证节点来执行智能合约。各个参与节点使用Diffie-Hellman算法,产生中间数据,产生智能合约并发布到区块链中,验证节点负责执行智能合同,并将执行结果反馈给各个参与节点,BaaS平台提供区块链基础服务,不需要提供可信服务,只需要提供区块链基础设施。To sum up, each participating node participating in the key negotiation maintains a ledger (blockchain) through the P2P consensus network. The public parameters of the key negotiation and the intermediate results of the key negotiation are recorded in the ledger. Participate in the mutual cooperation between nodes to complete the key agreement task. Among them, each participating node writes the smart contract into the blockchain through the consensus network through the BaaS platform that provides basic blockchain services, and the verification node in the consensus network executes the smart contract. Each participating node uses the Diffie-Hellman algorithm to generate intermediate data, generate smart contracts and publish them to the blockchain. The verification node is responsible for executing the smart contract and feeding back the execution results to each participating node. The BaaS platform provides basic blockchain services. There is no need to provide trusted services, only blockchain infrastructure needs to be provided.
另外,在验证节点执行智能合约的过程中,若出现异常,则其终止智能合约,并发送交易失败通知,更新执行状态,否则,在智能合约执行完成后,更新执行状态。In addition, in the process of the verification node executing the smart contract, if there is an abnormality, it will terminate the smart contract, send a transaction failure notification, and update the execution status. Otherwise, after the smart contract execution is completed, the execution status will be updated.
本发明一个实施例中,每一个所述参与节点,进一步用于从所述区块链中获取所述协商密钥,并利用所述协商密钥进行数据传输。当各个参与节点确定出相同的协商密钥之后,则可根据该协商密钥进行后续的数据传输,以保证数据安全性。In an embodiment of the present invention, each of the participating nodes is further configured to obtain the negotiated key from the blockchain, and use the negotiated key for data transmission. After each participating node determines the same negotiated key, subsequent data transmission can be performed according to the negotiated key to ensure data security.
如图2所示,本发明实施例提供了一种利用上述任一实施例提供的基于区块链的多方密钥协商装置进行密钥协商的方法,该方法可以包括以下步骤:As shown in FIG. 2 , an embodiment of the present invention provides a method for performing key negotiation using the blockchain-based multi-party key agreement apparatus provided by any of the foregoing embodiments, and the method may include the following steps:
步骤201:向外部的区块链即服务BaaS平台发送区块链服务申请;Step 201: Send a blockchain service application to an external blockchain-as-a-service BaaS platform;
步骤202:获取所述BaaS平台根据所述区块链服务申请分配的区块链;Step 202: Obtain the blockchain allocated by the BaaS platform according to the blockchain service application;
步骤203:利用每一个参与节点根据预设的域参数和生成元以及自身生成的随机数,生成第一智能合约,并将所述第一智能合约发送到所述区块链中;Step 203: using each participating node to generate a first smart contract according to preset domain parameters and generators and random numbers generated by itself, and send the first smart contract to the blockchain;
步骤204:利用每一个所述参与节点从所述区块链中获取其他参与节点发布的第二智能合约;Step 204: using each of the participating nodes to obtain the second smart contract issued by other participating nodes from the blockchain;
步骤205:利用每一个所述参与节点根据所述第一智能合约和所述第二智能合约生成第三智能合约,并将所述第三智能合约发布到所述区块链中;Step 205: using each of the participating nodes to generate a third smart contract according to the first smart contract and the second smart contract, and publishing the third smart contract to the blockchain;
步骤206:利用验证节点执行所述区块链中的当前智能合约,以使各个所述参与节点达成共识;其中,所述当前智能合约包括:所述第一智能合约、第二智能合约和所述第三智能合约中的任意一个。Step 206: Use the verification node to execute the current smart contract in the blockchain, so that each of the participating nodes reaches a consensus; wherein, the current smart contract includes: the first smart contract, the second smart contract and all any one of the third smart contracts mentioned above.
本发明一个实施例中,步骤203的具体实施方式,可以包括:In an embodiment of the present invention, the specific implementation of
利用下述计算公式计算所述第一智能合约;Calculate the first smart contract using the following calculation formula;
其中,Ni表征第i个所述参与节点对应的第一智能合约;g表征所述生成元,ri表征第i个所述参与节点产生的随机数,a表征所述域参数;Wherein, Ni represents the first smart contract corresponding to the ith participating node; g represents the generator, ri represents the random number generated by the ith participating node, and a represents the domain parameter;
本发明一个实施例中,步骤205的具体实施方式,可以包括:In an embodiment of the present invention, the specific implementation of
利用下述计算公式计算所述第三智能合约;Use the following calculation formula to calculate the third smart contract;
其中,Mij表征第i个所述参与节点对应的第三智能合约,g表征所述生成元,ri表征第i个所述参与节点产生的随机数,tj表征第j个所述其他参与节点发送的第二智能合约,i≠j,a表征所述域参数。Among them, M ij represents the third smart contract corresponding to the i-th participating node, g represents the generator, ri represents the random number generated by the i -th participating node, and t j represents the j-th other The second smart contract sent by the participating nodes, i≠j, a characterizes the domain parameters.
本发明一个实施例中,在步骤204之后,可以进一步包括:In an embodiment of the present invention, after
确定所述区块链中是否存在未获取过的所述第二智能合约,如果是,从所述区块链中获取未获取过的所述第二智能合约,并根据获取的所述第二智能合约以及所述第一智能合约生成第三智能合约,否则,将所述第三智能合约作为协商密钥发布到所述区块链中。Determine whether there is the second smart contract that has not been acquired in the blockchain, and if so, acquire the second smart contract that has not been acquired from the blockchain, and based on the acquired second smart contract The smart contract and the first smart contract generate a third smart contract, otherwise, the third smart contract is published in the blockchain as a negotiated key.
本发明一个实施例中,在步骤205之后,可以进一步包括:In an embodiment of the present invention, after
利用各个所述参与节点从所述区块链中获取所述协商密钥;Use each of the participating nodes to obtain the negotiated key from the blockchain;
利用所述协商密钥进行数据传输。Data transmission is performed using the negotiated key.
上述方法中的各步骤之间的信息交互、执行过程等内容,由于与本发明装置实施例基于同一构思,具体内容可参见本发明装置实施例中的叙述,此处不再赘述。Since the information exchange and execution process among the steps in the above method are based on the same concept as the device embodiments of the present invention, the specific content can be found in the descriptions in the device embodiments of the present invention, which will not be repeated here.
如图3所示,本发明实施例提供了一种基于区块链的多方密钥协商系统,包括:本发明上述任一实施例提供的多方密钥协商装置301,以及区块链即服务BaaS平台302;其中,As shown in FIG. 3 , an embodiment of the present invention provides a blockchain-based multi-party key agreement system, including: a multi-party
所述BaaS平台302,用于根据所述多方密钥协商装置301发送的区块链服务申请,为所述多方密钥协商装置分配区块链。The
本发明一个实施例中,所述多方密钥协商装置301,用于从所述区块链中获取协商密钥;In an embodiment of the present invention, the multi-party
所述BaaS平台302,进一步用于在所述多方密钥协商装置获取到所述协商密钥之后,释放所述区块链。The
在密钥协商过程结束后,BaaS平台释放申请的区块链服务基础设施资源,使得区块链在密钥协商过程后被回收,有利于有效利用资源。After the key negotiation process is over, the BaaS platform releases the applied blockchain service infrastructure resources, so that the blockchain can be recycled after the key negotiation process, which is conducive to the effective use of resources.
本发明实施例提供了一种可读介质,包括执行指令,当存储控制器的处理器执行所述执行指令时,所述存储控制器执行本发明上述任一实施例提供的方法。An embodiment of the present invention provides a readable medium, including an execution instruction. When a processor of a storage controller executes the execution instruction, the storage controller executes the method provided by any of the foregoing embodiments of the present invention.
本发明实施例还提供了一种存储控制器,包括:处理器、存储器和总线;所述存储器用于存储执行指令,所述处理器与所述存储器通过所述总线连接,当所述存储控制器运行时,所述处理器执行所述存储器存储的所述执行指令,以使所述存储控制器执行本发明上述任一实施例提供的视频处理方法。An embodiment of the present invention further provides a memory controller, including: a processor, a memory, and a bus; the memory is used for storing execution instructions, the processor and the memory are connected through the bus, and when the memory controls When the processor is running, the processor executes the execution instructions stored in the memory, so that the memory controller executes the video processing method provided by any of the foregoing embodiments of the present invention.
综上所述,本发明以上各个实施例至少具有如下有益效果:To sum up, the above embodiments of the present invention at least have the following beneficial effects:
1、在本发明实施例中,各个参与节点先获得BaaS平台分配的区块链,然后各个参与节点将自身对应的中间结果(第一智能合约或第三智能合约) 发布到区块链中,并能从区块链中获取其他参与节点发布的中间结果(第二智能合约),根据获取到的中间结果确定第三智能合约,由此减少了密钥协商过程中的信息交换和计算过程,从而提高了多方密钥协商的效率。1. In the embodiment of the present invention, each participating node first obtains the blockchain allocated by the BaaS platform, and then each participating node publishes its corresponding intermediate result (the first smart contract or the third smart contract) to the blockchain, And can obtain the intermediate results (second smart contracts) issued by other participating nodes from the blockchain, and determine the third smart contract according to the obtained intermediate results, thereby reducing the information exchange and calculation process in the key negotiation process, Thus, the efficiency of multi-party key negotiation is improved.
2、在本发明实施例中,各个参与密钥协商的参与节点通过P2P共识网络共同维护一份区块链,通过区块链记录密钥协商公开参数和密钥协商中间结果,通过执行智能合约实现各个参与节点间的相互协作,完成密钥协商任务。通过利用区块链技术,有效保证了数据的安全性。2. In the embodiment of the present invention, each participating node participating in the key negotiation jointly maintains a blockchain through the P2P consensus network, records the public parameters of the key negotiation and the intermediate result of the key negotiation through the blockchain, and executes the smart contract. Realize the mutual cooperation among the participating nodes and complete the key agreement task. By using blockchain technology, the security of data is effectively guaranteed.
3、在本发明实施例中,当各个参与节点确定出相同的协商密钥之后,则各个参与节点可根据该协商密钥进行后续的数据传输,以保证数据安全性。3. In this embodiment of the present invention, after each participating node determines the same negotiated key, each participating node can perform subsequent data transmission according to the negotiated key to ensure data security.
4、在本发明实施例中,在密钥协商过程结束后,BaaS平台释放申请的区块链服务基础设施资源,使得区块链在密钥协商过程后被回收,有利于有效利用资源。4. In the embodiment of the present invention, after the key negotiation process is over, the BaaS platform releases the applied blockchain service infrastructure resources, so that the blockchain is recycled after the key negotiation process, which is conducive to the effective use of resources.
需要说明的是,在本文中,诸如第一和第二之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个······”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同因素。It should be noted that, in this document, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply a relationship between these entities or operations. There is no such actual relationship or sequence. Moreover, the terms "comprising", "comprising" or any other variation thereof are intended to encompass a non-exclusive inclusion such that a process, method, article or device that includes a list of elements includes not only those elements, but also includes not explicitly listed or other elements inherent to such a process, method, article or apparatus. Without further limitation, the inclusion of an element by the phrase "comprising a..." does not preclude the presence of additional such elements in the process, method, article or apparatus that includes the element.
本领域普通技术人员可以理解:实现上述方法实施例的全部或部分步骤可以通过程序指令相关的硬件来完成,前述的程序可以存储在计算机可读取的存储介质中,该程序在执行时,执行包括上述方法实施例的步骤;而前述的存储介质包括:ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质中。Those of ordinary skill in the art can understand that all or part of the steps of implementing the above method embodiments can be completed by program instructions related to hardware, the aforementioned program can be stored in a computer-readable storage medium, and when the program is executed, execute It includes the steps of the above method embodiments; and the aforementioned storage medium includes: ROM, RAM, magnetic disk or optical disk and other mediums that can store program codes.
最后需要说明的是:以上所述仅为本发明的较佳实施例,仅用于说明本发明的技术方案,并非用于限定本发明的保护范围。凡在本发明的精神和原则之内所做的任何修改、等同替换、改进等,均包含在本发明的保护范围内。Finally, it should be noted that the above descriptions are only preferred embodiments of the present invention, and are only used to illustrate the technical solutions of the present invention, but not to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.
Claims (8)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201810329823.7A CN108282334B (en) | 2018-04-13 | 2018-04-13 | A multi-party key agreement device, method and system based on blockchain |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201810329823.7A CN108282334B (en) | 2018-04-13 | 2018-04-13 | A multi-party key agreement device, method and system based on blockchain |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN108282334A CN108282334A (en) | 2018-07-13 |
| CN108282334B true CN108282334B (en) | 2021-04-27 |
Family
ID=62811438
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201810329823.7A Active CN108282334B (en) | 2018-04-13 | 2018-04-13 | A multi-party key agreement device, method and system based on blockchain |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN108282334B (en) |
Families Citing this family (11)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN109218291B (en) * | 2018-08-14 | 2021-02-09 | 深圳高灯计算机科技有限公司 | Data transfer method, system and related equipment based on block chain |
| CN109347640B (en) * | 2018-09-27 | 2021-06-15 | 福建福链科技有限公司 | Data processing method and terminal based on block chain dynamic intelligent contract |
| CN112232817B (en) * | 2018-10-25 | 2024-12-27 | 蚂蚁链技术有限公司 | Transaction processing method and device based on blockchain, and electronic device |
| CN109933987A (en) * | 2018-11-30 | 2019-06-25 | 上海点融信息科技有限责任公司 | For the key generation method of block chain network, endorsement method, storage medium, calculate equipment |
| CN109361504B (en) * | 2018-12-04 | 2021-10-08 | 桂林电子科技大学 | A method for multi-user communication key agreement based on blockchain |
| EP3683756A1 (en) * | 2019-01-15 | 2020-07-22 | ABB Schweiz AG | Verifiable analytics platform with smart contracts |
| CN110232507B (en) * | 2019-05-28 | 2021-07-27 | 中国人民解放军国防科技大学 | The whole process supervision method and system of crowdsourcing activities based on smart contract |
| CN110417553B (en) * | 2019-08-07 | 2022-12-27 | 北京阿尔山区块链联盟科技有限公司 | Multi-party secret communication method and device and user terminal |
| CN112187862B (en) * | 2020-08-31 | 2023-08-08 | 华控清交信息科技(北京)有限公司 | Task processing method and device for task processing |
| CN112184218B (en) * | 2020-09-18 | 2022-02-01 | 华控清交信息科技(北京)有限公司 | Data processing method and device and data processing device |
| CN114092247A (en) * | 2021-11-24 | 2022-02-25 | 厦门荷月信息科技有限公司 | Multi-party transaction consensus method and system |
Family Cites Families (8)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US6987855B1 (en) * | 1999-09-10 | 2006-01-17 | Cisco Technology, Inc. | Operational optimization of a shared secret Diffie-Hellman key exchange among broadcast or multicast groups |
| US6909786B2 (en) * | 2001-01-09 | 2005-06-21 | D'crypt Private Limited | Cryptographic trap door with timed lock and controlled escrow |
| CN1848724B (en) * | 2005-04-05 | 2010-04-28 | 华为技术有限公司 | A Method for Realizing Key Agreement in Mobile Ad Hoc Networks |
| CN101908961B (en) * | 2010-07-29 | 2012-07-11 | 北京交通大学 | A Multi-Party Secret Handshake Method in Short Key Environment |
| CN104980269A (en) * | 2014-04-03 | 2015-10-14 | 华为技术有限公司 | Secret key sharing method, device and system |
| EP4235552A3 (en) * | 2016-02-23 | 2023-09-13 | nChain Licensing AG | Methods and systems for efficient transfer of entities on a peer-to-peer distributed ledger using the blockchain |
| CN106027241B (en) * | 2016-07-08 | 2019-03-08 | 郑州轻工业学院 | A Method for Resilient Asymmetric Group Key Negotiation |
| CN107425967B (en) * | 2017-06-15 | 2019-08-27 | 武汉理工大学 | A Theoretical Secure Flexible Multi-Secret Sharing Method |
-
2018
- 2018-04-13 CN CN201810329823.7A patent/CN108282334B/en active Active
Also Published As
| Publication number | Publication date |
|---|---|
| CN108282334A (en) | 2018-07-13 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN108282334B (en) | A multi-party key agreement device, method and system based on blockchain | |
| JP7572467B2 (en) | Controlled release of cryptographic private keys | |
| CN110537355B (en) | Consensus based on secure blockchains | |
| US11522706B2 (en) | Method and system for publicly verifiable proofs of retrievability in blockchains | |
| CN109936457B (en) | Block chain multi-party witness method, device, equipment and computer readable storage medium | |
| US11429967B2 (en) | Mechanism for efficient validation of finality proof in lightweight distributed ledger clients | |
| KR101727525B1 (en) | Block chain based distributed storage method and device thereof | |
| JP6511017B2 (en) | Contract agreement method, agreement verification method, contract agreement device and agreement verification device | |
| CN112418862B (en) | Method and device for implementing confidential blockchain transactions using ring signatures | |
| CN104580253B (en) | A kind of method and device of processes user data | |
| JP2025090678A (en) | METHOD AND SYSTEM FOR BLOCKCHAIN-ENHANCED EVENT-LOCKED ENCRYPTION | |
| CN110494875A (en) | The safety of private key for dynamic node group reuses | |
| WO2020259156A1 (en) | Blockchain-based private transaction method and apparatus | |
| WO2021203853A1 (en) | Key generation method, device, apparatus, and medium | |
| CN109726887A (en) | Blockchain-based mobile crowdsourcing data collection and processing system and method | |
| WO2021082340A1 (en) | Data processing method, apparatus, system, and storage medium | |
| Zhao et al. | Fuzzy identity-based dynamic auditing of big data on cloud storage | |
| JP2025100540A (en) | SYSTEM AND METHOD FOR NON-PARALLELIZED MINING IN PROOF OF WORK BLOCKCHAIN NETWORKS | |
| JP2018535500A (en) | Temporary consensus network in resource transfer system | |
| CN115632774B (en) | A distributed oracle implementation method and system based on threshold signature | |
| WO2019153660A1 (en) | Transaction processing method and apparatus, and computer device and storage medium | |
| KR102610530B1 (en) | A neural consensus node apparatus for using a non-random consensus proof-based blockchain network as a random consensus proof-based blockchain network, and its operation method | |
| KR102610531B1 (en) | A neural consensus proof based block chain network platform system constructed by using a non-random consensus proof-based blockchain network | |
| CN111784338A (en) | Information processing method, device, system and storage medium | |
| CN114329566A (en) | Generation method and system of random number on block chain based on threshold encryption |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| TA01 | Transfer of patent application right | ||
| TA01 | Transfer of patent application right |
Effective date of registration: 20210406 Address after: No. 1036, Shandong high tech Zone wave road, Ji'nan, Shandong Applicant after: INSPUR GROUP Co.,Ltd. Address before: 250100 First Floor of R&D Building 2877 Kehang Road, Sun Village Town, Jinan High-tech Zone, Shandong Province Applicant before: JINAN INSPUR HI-TECH INVESTMENT AND DEVELOPMENT Co.,Ltd. |
|
| GR01 | Patent grant | ||
| GR01 | Patent grant |