Shared key generation method and device, electronic equipment and readable storage medium

By establishing secure channels and authentication mechanisms in the blockchain network, synchronizing system parameters and node parameters, and generating exclusive transaction addresses, the problem of insufficient concealment in the blockchain shared key negotiation process is solved, and secure and efficient shared key negotiation is achieved.

CN115811395BActive Publication Date: 2026-04-17BEIJING TOPSEC NETWORK SECURITY TECH +2
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING TOPSEC NETWORK SECURITY TECH
Filing Date
2022-11-17
Publication Date
2026-04-17

AI Technical Summary

Technical Problem

In the process of blockchain-based shared key negotiation, storing information on the chain increases the possibility of key negotiation being discovered, which fails to meet the requirement of concealment.

Method used

By establishing a secure channel between the key generation center and network nodes, synchronizing system and node parameters, utilizing key calculation functions and authentication mechanisms, reducing information transmission volume and improving security, employing a certificateless public key system to generate partial private keys for authentication, and constructing a dedicated transaction address for covert communication.

Benefits of technology

While reducing information interaction, it improves the security and confidentiality of the shared key negotiation process, is suitable for two-party and multi-party communication, and enhances the security and efficiency of the key negotiation process in the blockchain network.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115811395B_ABST
    Figure CN115811395B_ABST
Patent Text Reader

Abstract

The application provides a shared key generation method and device, electronic equipment and a readable storage medium, wherein the method is applied to a first network node, and the method comprises the following steps: receiving system parameters and node parameters of each network node sent by a key generation center; the system parameters comprise a key calculation function used for calculating a shared key, and the node parameters comprise an identifier, which is formed when each network node is registered in the key generation center; for a second network node, obtaining a public key of the second network node in historical transaction data of the second network node; and calculating a two-party shared key for communication with the second network node according to the key calculation function, a secret value of the first network node, the identifier of the first network node and the public key, the identifier and the public key of the second network node.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer communication security technology, and more specifically, to a shared key generation method, apparatus, electronic device, and readable storage medium. Background Technology

[0002] Key negotiation refers to the process by which two or more computer nodes negotiate and establish a shared key in a public network environment. The determined shared key can be used for secure communication between two or more parties. The shared key requires the combined action of publicly available information from each user.

[0003] Currently, in blockchain-based shared key negotiation methods, a large amount of information is stored on the blockchain during the key negotiation process, and there is a lot of information exchange under the blockchain. This increases the possibility of the key negotiation process being discovered, which does not meet the requirement of the confidentiality of key negotiation. Summary of the Invention

[0004] The purpose of this application is to provide a shared key generation method, apparatus, electronic device, and readable storage medium to improve the concealment and security of the shared key negotiation process.

[0005] In a first aspect, embodiments of this application provide a shared key generation method applied to a first network node. The method includes: receiving system parameters sent by a key generation center and node parameters of each network node; the system parameters include a key calculation function for calculating the shared key, and the node parameters include an identifier, which are formed when each network node registers with the key generation center; for a second network node, obtaining the public key of the second network node from historical transaction data; and calculating a shared key between the two parties communicating with the second network node based on the key calculation function, the secret value of the first network node, the identifier and public key of the first network node, and the identifier and public key of the second network node.

[0006] By using the above method, the shared key negotiation process can be achieved while reducing the amount of information transmitted between network nodes, thereby improving the security of two-party shared key negotiation between network nodes, reducing the possibility of the shared key negotiation process being discovered, and thus enhancing the security of the entire key negotiation process.

[0007] In an optional implementation, the node parameters further include: a partial private key; before calculating the shared key for communication with the second network node based on the key calculation function, the secret value of the first network node, the identifier and public key of the first network node, and the identifier and public key of the second network node, the method further includes: authenticating the second network node based on the identifier, public key, partial private key, and system parameters of the second network node; after successful authentication, the step of calculating the shared key for communication with the second network node based on the key calculation function, the secret value of the first network node, the identifier and public key of the first network node, and the identifier and public key of the second network node is then executed.

[0008] In the above implementation, before determining the shared key, each network node can be authenticated to ensure that the shared key negotiation is conducted among trusted communication participants, thereby improving the security and reliability of the shared key calculation among network nodes.

[0009] In an optional implementation, the second network node is authenticated based on its identifier, public key, partial private key, and system parameters using the following formula: ; ;

[0010] in, This represents the public key of the second network node; This represents the public key of the system in which the second network node is located; The identifier representing the second network node; Represents the generator of the additive cyclic group; This represents a portion of the private key of the second network node; This represents the value determined based on the identifier and public key of the second network node; Represents a symmetric bilinear mapping; This represents the first hash function; if both of the above formulas are true, then the authentication of the second network node is successful.

[0011] In an optional implementation, the key calculation function further includes: a first hash function, a second hash function, and a symmetric bilinear mapping; the step of calculating the shared key for communication with the second network node based on the key calculation function, the secret value of the first network node, the identifier and public key of the first network node, and the identifier and public key of the second network node includes: using the first hash function and the symmetric bilinear mapping to calculate an initial shared key based on the secret value of the first network node, the identifier and public key of the first network node, and the identifier and public key of the second network node; and using the second hash function to process the initial shared key to obtain the shared key for communication with the second network node.

[0012] In an optional implementation, the initial shared key is calculated using the first hash function and the symmetric bilinear mapping, based on the secret value of the first network node, the identifier and public key of the first network node, and the identifier and public key of the second network node, using the following formula: ;

[0013] The initial shared key is processed using the second hash function and calculated using the following formula: ;

[0014] in, Indicates the initial shared key; Represents a symmetric bilinear mapping; This represents the secret value of the first network node; This represents the value determined based on the identifier and public key of the first network node; This represents the value determined based on the identifier and public key of the second network node; The identifier representing the second network node; This represents the third random number in the system parameters; This represents the second hash function; This indicates the shared key between the two parties communicating with the second network node.

[0015] In an optional implementation, receiving the system parameters sent by the key generation center and the node parameters of each network node includes: establishing a secure channel with the key generation center and receiving the system parameters sent by the key generation center and the node parameters of each network node.

[0016] In the above implementation, by transmitting the data generated by the key generation center through a secure channel and completing the synchronization process of system parameters and node parameters before key negotiation, the storage of system parameters and node parameters on the blockchain can be avoided, thereby reducing the risk of system parameters and node parameters being exposed and improving the security of the shared key negotiation process.

[0017] In an optional implementation, the method further includes: generating a transaction address based on the shared key between the two parties, the transaction address being used as a sending address or receiving address when communicating with the second network node.

[0018] In the above implementation, a dedicated transaction address can be determined based on the negotiated shared key between the two parties, thereby improving the efficiency of transaction data screening. At the same time, since the dedicated transaction address is not directly associated with the two communicating parties, the security of communication between the two network nodes can be improved.

[0019] In an optional implementation, the node parameters further include: a secret share; the system parameters further include: a first random number, a second random number, and a third random number; the step of calculating the group key based on the shared key includes: calculating the group key secret share of the first network node based on the first random number and the secret share of the first network node; obtaining the group key secret shares transmitted by other network nodes in the group after encryption based on the shared key; recovering the target polynomial based on the group key secret shares of each network node and the identifier of each network node; and calculating the group key of the group based on the target polynomial, the second random number, and the third random number.

[0020] In the above embodiments, when the entire group needs to communicate, a group key can be constructed using the above method. This ensures the security of group communication while reducing communication complexity and improving communication efficiency. Therefore, the scheme described in this application can simultaneously meet the secure communication requirements for both two-party and multi-party communication.

[0021] In an optional implementation, the system parameters further include: a target hash value; before calculating the group key of the group based on the target polynomial, the second random number, and the third random number, the method further includes: calculating the hash value of the target polynomial to obtain a polynomial hash value; verifying whether the polynomial hash value is equal to the target hash value, and if they are equal, the verification passes; after the verification passes, the step of calculating the group key of the group based on the target polynomial, the second random number, and the third random number is then executed.

[0022] In the above implementation, by verifying the hash value of the polynomial, potential malicious network nodes that may disrupt the key negotiation process can be detected in a timely manner, ensuring the trustworthiness and reliability of the calculated group key.

[0023] In an optional implementation, the calculation of the group key secret share of the first network node based on the first random number and the secret share of the first network node is obtained by the following formula: ;

[0024] in, This represents the group key secret share of the first network node; The identifier representing the first network node; This represents the first random number in the system parameters; Represent a prime number;

[0025] The target polynomial is recovered based on the group key secret share of each network node and the identifier of each network node, and is calculated using the following formula:

[0026] ;

[0027] in, Represent the objective polynomial; This indicates the number of network nodes contained in the group; An identifier representing a network node in a group;

[0028] The group key of the group is calculated based on the target polynomial, the second random number, and the third random number, using the following formula: ;

[0029] in, The group key representing the group; This represents the second random number in the system parameters; This refers to the third random number in the system parameters.

[0030] In an optional implementation, the method further includes: obtaining a group key secret share of a new network node; reconstructing a target polynomial based on the group, the group key secret share of the new network node, and the identifiers of each network node; and calculating a new group key based on the target polynomial and a second random number and a fourth random number in the system parameters.

[0031] In the above implementation, new network nodes can be added to the group as needed to adapt to the secure communication requirements in different scenarios and improve the applicability of the aforementioned shared key negotiation process.

[0032] Secondly, embodiments of this application provide a shared key generation device applied to a first network node. The device includes: a receiving module, configured to receive system parameters sent by a key generation center and node parameters of each network node; the system parameters include a key calculation function for calculating the shared key, and the node parameters include an identifier, which are formed when each network node registers with the key generation center; a first acquisition module, configured to acquire the public key of the second network node from its historical transaction data; and a first calculation module, configured to calculate a shared key between the two parties communicating with the second network node based on the key calculation function, the secret value of the first network node, the identifier and public key of the first network node, and the identifier and public key of the second network node, and to calculate a group key based on the shared key according to actual communication needs.

[0033] Thirdly, embodiments of this application provide an electronic device, including: a processor and a memory, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the machine-readable instructions are executed by the processor to perform the steps of the above-described method.

[0034] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, performs the steps of the method described above. Attached Figure Description

[0035] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0036] Figure 1 A schematic diagram of the operating environment for the shared key generation method provided in the embodiments of this application;

[0037] Figure 2 A block diagram illustrating an electronic device provided in an embodiment of this application;

[0038] Figure 3 A flowchart of the shared key generation method provided in the embodiments of this application;

[0039] Figure 4 Another flowchart of the shared key generation method provided in the embodiments of this application;

[0040] Figure 5 An optional flowchart of step 350 of the shared key generation method provided in the embodiments of this application;

[0041] Figure 6 Another flowchart of the shared key generation method provided in the embodiments of this application;

[0042] Figure 7 This is a partial flowchart of the shared key generation method provided in the embodiments of this application;

[0043] Figure 8 This is a partial flowchart of the shared key generation method provided in the embodiments of this application;

[0044] Figure 9 This is a schematic diagram of the functional modules of the shared key generation device provided in the embodiments of this application. Detailed Implementation

[0045] The technical solutions in the embodiments of this application will now be described with reference to the accompanying drawings.

[0046] It should be noted that similar reference numerals and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. Furthermore, in the description of this application, terms such as "first," "second," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.

[0047] Shared keys can be used for secure communication between two or more parties, and they are generated by the combined action of publicly available information from each party.

[0048] In applications with high security requirements, communication participants do not want the shared key negotiation process to be detected by potential adversaries. Therefore, various non-interactive key negotiation methods have been proposed. Compared with interactive key negotiation protocols, non-interactive key negotiation omits the interactive information transmission process between communication participants, reducing the amount of communication and improving protocol efficiency. In disturbed channels, reducing communication interactions between participants can also significantly reduce the possibility of leakage of their private information, thereby improving communication security.

[0049] The existing non-interactive key negotiation schemes include the following: (1) Diffie-Hellman (DH) key negotiation scheme, which is the initial form of non-interactive key negotiation scheme. However, due to the lack of identity authentication, this scheme cannot resist man-in-the-middle attacks and is limited to key negotiation between two parties in communication, thus limiting its practical application scenarios; (2) Non-interactive key negotiation protocols based on Public Key Infrastructure (PKI), where a Certificate Authority (CA) issues certificates to users, and the user's key is guaranteed by the public key certificate. Due to the trust guarantee provided by a trusted certification authority, the advantage of this scheme is that it can achieve a high level of trust. The disadvantage is that the computational cost is high, and there are problems with certificate management and certificate storage; (3) Identity-based hierarchical non-interactive key negotiation protocols, where the user's public key is their identity information, and the private key is generated by a Private Key Generator (PKG). Since the PKG has the private keys of all parties in communication, it can impersonate any party in communication without being detected, thus posing problems such as key custody security and key leakage.

[0050] To address the shortcomings of the aforementioned solutions, this application provides a shared key generation method, apparatus, electronic device, and computer-readable storage medium. The method provided in this application further enhances the confidentiality of the key negotiation process based on blockchain, enabling covert negotiation of shared keys and group keys between two parties.

[0051] To facilitate understanding of this embodiment, the operating environment for implementing the shared key generation method disclosed in this application embodiment will first be described in detail.

[0052] like Figure 1 The diagram shows the operating environment for the shared key generation method provided in this application. Figure 1 As shown, the Key Generator Center (KGC) 110 communicates with two or more network nodes 120 via a network for data communication or interaction. The Key Generator Center 110 can be a web server, database server, etc. It can also consist of a server group comprising multiple servers. The network nodes 120 can be web servers, database servers, or personal computers (PCs), tablets, smartphones, personal digital assistants (PDAs), etc.

[0053] The key generation center 110 can establish a secure channel with each network node 120, and the key generation center 110 and each network node 120 can communicate through the secure channel.

[0054] In this embodiment, each network node 120 can register in the key generation center 110, which can generate information such as identifiers, partial private keys, and secret shares for each network node 120.

[0055] like Figure 2 The diagram shown is a block diagram of electronic device 200. Figure 1 The devices in the key generation center 110 shown, or the network nodes 120, may include Figure 2 The components of the illustrated electronic device 200 are shown. Exemplarily, the electronic device 200 may include a memory 211 and a processor 213. Those skilled in the art will understand that... Figure 2 The structure shown is for illustrative purposes only and does not limit the structure of the electronic device 200. For example, the electronic device 200 may also include components that are more... Figure 2 The more or fewer components shown, or having the same Figure 2 The different configurations shown.

[0056] The memory 211 and processor 213 described above are electrically connected to each other directly or indirectly to enable data transmission or interaction. For example, these components can be electrically connected to each other through one or more communication buses or signal lines. The processor 213 described above is used to execute executable modules stored in the memory.

[0057] The memory 211 can be, but is not limited to, Random Access Memory (RAM), Read Only Memory (ROM), Programmable Read-Only Memory (PROM), Erasable Programmable Read-Only Memory (EPROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), etc. The memory 211 stores programs, and the processor 213 executes these programs upon receiving execution instructions. The methods executed by the electronic device 200, as defined in any embodiment of this application, can be applied to or implemented by the processor 213.

[0058] The aforementioned processor 213 may be an integrated circuit chip with signal processing capabilities. The processor 213 may be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it may also be a digital signal processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor may be a microprocessor or any conventional processor.

[0059] The electronic device 200 in this embodiment can be used to execute various steps in the various methods provided in the embodiments of this application. The implementation process of the shared key generation method is described in detail below through several embodiments.

[0060] Please see Figure 3 This is a flowchart of a shared key generation method provided in an embodiment of this application. The method in this embodiment can be applied to one of the network nodes in the aforementioned blockchain; the following description uses the first network node as an example. The following will discuss... Figure 3 The specific process shown will be explained in detail.

[0061] Step 310: Receive system parameters sent by the key generation center, as well as node parameters of each network node.

[0062] For example, the system parameters include a key calculation function for calculating the shared key, and the node parameters include an identifier and a portion of the private key, which are formed when each network node registers with the key generation center.

[0063] This system parameter serves as the data foundation for two or more network nodes to negotiate and share a key. This system parameter can be generated by a key generation center.

[0064] Optionally, a secure channel is established with the key generation center to receive system parameters sent by the key generation center, as well as node parameters of each network node.

[0065] The key generation center can perform system initialization work before each network node calculates the shared key, in order to generate the system parameters required for calculating the shared key.

[0066] The system parameter can include a prime number. A positive number As the master private key shared by all network nodes, among which... For a finite field A subset of non-zero elements. For example, the prime number... and positive numbers It is stored locally at the key generation center.

[0067] The key generation center can also determine a security parameter. This is used to control the security level of the entire system. For example, this security parameter... A fixed value can be chosen to limit the length of the subsequently generated shared key. For example, this security parameter... It can be a value such as 128 or 256.

[0068] The key generation center can also determine a preset polynomial. The preset polynomial can be a symmetric bivariate polynomial. Specifically, the preset polynomial satisfies... .

[0069] The system parameters may include information such as some random numbers and key calculation functions.

[0070] For example, system parameters may include: .

[0071] in, To define in a finite field The order above is a large prime number. Additive cyclic group, For the order of Multiplication cyclic group; For a symmetric bilinear mapping; using Represents the addition cyclic group The generator, for example, could be a base point on the elliptic curve used by the blockchain, then the public key of the entire shared system is... ; , These are two secure hash functions, where the This can be represented as the first hash function, which This can be represented as a second hash function. for A subset of non-zero elements; , , and They are not equal, symbol " "" indicates that the symbol is selected uniformly and randomly from the set to the right of the symbol, where, It can be represented as the first random number. However, it can be represented as a second random number. It can be represented as a third random number; It is used during group key negotiation to verify the validity of the group key.

[0072] In this embodiment, before each network node joins the blockchain network, the key generation center can transmit system parameters through a secure channel. Synchronize with each network node.

[0073] Before generating shared keys for each network node, each network node can first register with the key generation center to generate node parameters for each network node.

[0074] With the first network node For example, the first network node can randomly select a secret value before registering with the key generation center. Then, based on this secret value, a portion of the public key of the first network node can be calculated. Its unique identifier .

[0075] Then, the first network node It can use part of its public key and identifier The key is sent to the key generation center, which can then generate a partial private key for the first network node. ,in" The "" operator is used to join two strings. The first network node... The complete private key can be represented as .

[0076] For the key generation center, it can only know the first network node it generates. A portion of the private key is insufficient to determine the identity of the first network node. The complete private key. Therefore, the first network node The complete private key is still in a confidential state.

[0077] The first network node identifier and part of the private key As a public parameter, it is synchronized to all network nodes that need to perform key negotiation through the key generation center. Optionally, the key generation center can synchronize it to all network nodes that need to perform shared key negotiation through a secure channel.

[0078] This key generation center can determine the secret share for each network node that needs to negotiate a shared key. (The first network node...) For example, its secret share is The key generation center can also transmit the secret share to each network node via a secure channel.

[0079] Step 330: For the second network node, obtain the public key of the second network node from its historical transaction data.

[0080] In this embodiment, after parameter initialization is completed at the key generation center and network nodes register with the key generation center, each network node joins the blockchain network and can broadcast transaction data through the blockchain network. Taking the first network node as an example... Second network node For example, since the transaction data contains the public key information of each network node, when the first network node... Requires connection with a second network node During communication, the first network node The public key can be extracted from the transaction data. .

[0081] Step 350: Calculate the shared key between the two parties communicating with the second network node based on the key calculation function, the secret value of the first network node, the identifier and public key of the second network node, and the identifier and public key of the second network node.

[0082] In this embodiment, when group communication is required, a group key can also be calculated based on the shared key between the two parties. This group can be a network node group that includes the first network node.

[0083] The method provided in this application embodiment can realize the shared key negotiation process while reducing the amount of information transmission between network nodes, thereby improving the security of two-party shared key negotiation between network nodes, reducing the possibility of the shared key negotiation process being discovered, and thus improving the security of the entire key negotiation process.

[0084] To improve the security and reliability of shared key negotiation, the identity of the network nodes can be verified before the two-party shared key negotiation proceeds in step 350. Therefore, as... Figure 4 As shown, prior to step 350, the method may further include: step 340, authenticating the second network node based on the identifier, public key, partial private key, and system parameters of the second network node.

[0085] After the verification in step 340 is successful, proceed to step 350.

[0086] Alternatively, it can be verified using the following formula: ;

[0087] ;

[0088] in, This represents the public key of the second network node; This represents the public key of the system to which the second network node is located; The identifier representing the second network node; Represents the generator of the additive cyclic group; This represents a portion of the private key of the second network node; This represents the value determined based on the identifier and public key of the second network node; Represents a symmetric bilinear mapping; Indicates the first hash function;

[0089] If both of the above formulas hold true, it means that the obtained public key belongs to the second network node. of, This enables control over the second network node. The authentication result indicates that the authentication of the second network node was successful.

[0090] Understandably, the second network node can also use the above method to authenticate the first network node. Of course, if more than two network nodes are participating in the shared key negotiation, any one of the network nodes can use the above method to authenticate the other network nodes.

[0091] In this embodiment, the key calculation function further includes a second hash function. For example... Figure 5 As shown, step 350 above may include steps 351 and 352.

[0092] Step 351: Using the first hash function and the symmetric bilinear mapping, calculate the initial shared key based on the secret value of the first network node, the identifier and public key of the first network node, and the identifier and public key of the second network node.

[0093] Step 352: Using the second hash function, process the initial shared key to obtain the shared key between the two parties communicating with the second network node.

[0094] For example, the initial shared key can be calculated using the following formula:

[0095] ;

[0096] The initial shared key is then processed using a second hash function and calculated using the following formula: ;

[0097] in, Indicates the initial shared key; Represents a symmetric bilinear mapping; This represents the secret value of the first network node; This represents the value determined based on the identifier and public key of the first network node; This represents the value determined based on the identifier and public key of the second network node; The identifier representing the second network node; This represents the third random number in the system parameters; Indicates the second hash function; This indicates the shared key between the two parties communicating with the second network node.

[0098] In this embodiment, because ,and Therefore, it can be determined that It can be determined that the initial shared key calculated by the first network node and the initial shared key calculated by the second network node are the same value.

[0099] Therefore, it can be determined that the shared key calculated by the first network node is equal to the shared key calculated by the second network node. ,Should It can serve as the first network node. Second network node The two parties share a key, which can be used for subsequent operations, such as covert communication based on the blockchain.

[0100] To further improve communication efficiency between network nodes, dedicated transaction addresses can be established for covert communication using the shared key between network nodes. Therefore, such as... Figure 6 As shown, the shared key generation method may further include: 360, generating a transaction address based on the shared key.

[0101] This transaction address can be used as a sending or receiving address when communicating with the second network node.

[0102] The transaction address can be set as either the sending address or the receiving address when communicating with the second network node, depending on actual needs. For example, if the transaction address is set as the sending address when communicating with the second network node, the receiving address can be randomly generated; conversely, if the transaction address is set as the receiving address when communicating with the second network node, the sending address can be randomly generated.

[0103] For example, it can be based on the shared key and the addition cyclic group in the system parameters. generator The address coordinates of points on the elliptic curve used to generate the blockchain are represented as follows: .

[0104] Then, the first network node is generated based on this address coordinate. Second network node The private key of the address of the special transaction address between them.

[0105] For example, the coordinates of a point on the elliptic curve can be represented as ,and That is, the x-axis and ordinate Representations in the same number system are of equal length. (Take...) The result is used to generate the first network node. Second network node The private key for the address of a special transaction between the two addresses, where the symbol " " indicates the XOR operation.

[0106] Then, a corresponding special address is generated according to the blockchain address generation rules. This special address This can be used as a transaction address, which can serve as the first network node. Second network node The sending address when conducting transactions between them can also serve as the first network node. Second network node The receiving address used when conducting transactions between them is used to identify the first network node. Second network node Special transactions between them.

[0107] After determining the transaction address and the shared key between the two parties, the first network node Second network node The two parties can share a key. Encrypt and conceal information, and use the address Construct special transactions containing hidden information to achieve covert communication based on blockchain.

[0108] The above steps enable the negotiation of a shared key between two network nodes, allowing for the negotiation to be conducted without any information exchange.

[0109] In other scenarios where more than two network nodes need to build a shared key, a group key can also be built among multiple network nodes. The node parameters received in step 310 above may also include: a secret share; the system parameters also include: a first random number, a second random number, and a third random number.

[0110] The group key can be built on top of a shared key between the two parties; therefore, after step 350, as follows: Figure 7 As shown, the shared key generation method may further include steps 371 to 374.

[0111] Step 371: Calculate the group key secret share of the first network node based on the first random number and the secret share of the first network node.

[0112] For example, the secret share of the first network node can be an undetermined polynomial, and the group key secret share of the first network node can be obtained by substituting the first random number into the undetermined polynomial.

[0113] Step 372: Obtain the group key secret share transmitted by other network nodes in the group after encryption based on the shared key between the two parties.

[0114] This group is a group of network nodes that includes the first network node. Any two network nodes in this group negotiate their shared key and transaction address using steps 310 to 360 described above.

[0115] Optionally, each network node in the group calculates its group key secret share locally. Then, it synchronizes its group key secret share with other network nodes in the group.

[0116] In this embodiment, the synchronization of the group key secret share between any two network nodes in the group can be achieved by encrypting the group key secret share with a shared key, marking it with a transaction address as a special transaction tag, and then transmitting the group key secret share.

[0117] Step 373: Recover the target polynomial based on the group key secret share of each network node and the identifier of each network node.

[0118] Step 374: Calculate the group key of the group based on the target polynomial, the second random number, and the third random number.

[0119] To improve the trustworthiness and reliability of the calculated shared key, the determined target polynomial can also be verified. Therefore, the system parameters also include: a target hash value. Before step 374, the group key generation method may further include: calculating the hash value of the target polynomial to obtain a polynomial hash value; and verifying whether the polynomial hash value is equal to the target hash value.

[0120] For example, each network node needs to verify whether the polynomial hash value it calculates is equal to the target hash value received from the key generation center.

[0121] If they are equal, the verification passes; after the verification passes, proceed to step 374.

[0122] For example, step 371 above can be calculated using the following formula:

[0123] ;

[0124] in, This represents the group key secret share of the first network node; The identifier representing the first network node; This represents the first random number in the system parameters; Represent a prime number;

[0125] For example, step 373 above can be calculated using the following formula:

[0126] ;

[0127] in, Represent the objective polynomial; This indicates the number of network nodes contained in the group; The identifier representing a network node in the group.

[0128] After determining the objective polynomial, the second random number can be substituted into the objective polynomial to obtain... In one instance, the polynomial is a symmetric polynomial, which can be determined. .

[0129] Its hash value can be calculated using the second hash function described above, which is: .

[0130] Verification of network nodes in the group If the condition is met, the verification is successful.

[0131] For example, step 374 above can be calculated using the following formula:

[0132] ;

[0133] in, This represents the group key of the group; This represents the second random number in the system parameters; This represents the third random number in the system parameters.

[0134] Inevitably, after the group key has been established, new network nodes may be added to form new groups. Therefore, after the above steps, as... Figure 8 As shown, group key generation may also include steps 381 to 383.

[0135] Step 381: Obtain the group key secret share of the new network node.

[0136] For example, the new network node can be represented as The new network node The identifier can be represented as The new network node The group key secret share can be represented as .

[0137] Then, the fourth random number is determined based on the third random number.

[0138] Optionally, prior to step 381, steps 310 to 350 can be used to construct a shared key and transaction address between the new network node and each network node in the group.

[0139] When the new network node synchronizes its group key secret share with other network nodes in the group, it can use a determined shared key for encryption and a determined transaction address as a special transaction tag for marking. Then, the new network node transmits its group key secret share to each network node in the group. Transmitting the group key secret share in this way improves the security and confidentiality of data transmission.

[0140] Step 382: Recover the target polynomial based on the group key secret share of the group and the new network node and the identifier of each network node.

[0141] .

[0142] Step 382 can be similar to step 373 above, except that the number of network nodes involved in step 382 is one more than the number of network nodes involved in step 373.

[0143] Step 383: Calculate the new group key based on the objective polynomial and the second and fourth random numbers in the system parameters.

[0144] Optionally, a fourth random number can be determined based on the third random number; for example, the fourth random number can be expressed as... .

[0145] Then, based on the objective polynomial and the second and fourth random numbers in the system parameters, a new group key is calculated.

[0146] For example, it can be done through the following formula: .

[0147] Before step 383, the objective polynomial can also be verified. Substituting the result into the target polynomial obtained in step 382 above, we get... And calculate its hash value. Each network node verifies whether the calculated hash value satisfies the formula. If all conditions are met, then the verification is successful.

[0148] In the various methods provided in the embodiments of this application, before a network node joins the blockchain network, the system parameter synchronization and the registration process of the network node in the key generation center are completed through an off-chain secure channel. The system parameters and the node information obtained from the network node registration are not stored on the blockchain, thereby ensuring the confidentiality of the shared key negotiation based on the blockchain. This separates the system parameter synchronization, node registration and key negotiation processes, avoids on-chain information synchronization during key negotiation, and improves the security of key negotiation.

[0149] Furthermore, during the two-party shared key negotiation phase between the two network nodes, drawing on the key generation concept of certificateless public key systems, a portion of the private key generated by the key generation center for the network nodes is used as a public parameter. Public key information is obtained by scanning transaction data, and the identity verification process is completed, thereby ensuring that the key negotiation process takes place between trusted network nodes. In the group key negotiation phase, the constructed two-party shared key and transaction address enable the synchronization of the secret share of the group key among each network node through a special transaction, further ensuring the concealment of shared key negotiation based on the blockchain. Thus, the concealment of information exchange during the key negotiation process is achieved based on the blockchain.

[0150] Furthermore, the method provided in this application embodiment is not targeted at any specific blockchain, but can be applied to various blockchain networks, including public blockchains, thereby solving the problem of the applicability of the technical solution to blockchain.

[0151] Based on the same application concept, this application also provides a shared key generation device corresponding to the shared key generation method. Since the principle of the device in this application is similar to that of the aforementioned shared key generation method, the implementation of the device in this application can refer to the description in the above method embodiments, and the repeated parts will not be described again.

[0152] Please see Figure 9This is a functional block diagram of the shared key generation device provided in this application embodiment. Each module in the shared key generation device in this embodiment is used to execute the steps in the above method embodiments. The shared key generation device includes: a receiving module 410, a first acquisition module 420, and a first calculation module 430; the contents of each module are as follows:

[0153] The receiving module 410 is used to receive system parameters sent by the key generation center and node parameters of each network node; the system parameters include a key calculation function for calculating the shared key, and the node parameters include an identifier, which is formed when each network node registers with the key generation center;

[0154] The first acquisition module 420 is used to acquire the public key of the second network node from the historical transaction data of the second network node.

[0155] The first calculation module 430 is used to calculate a shared key between the two parties communicating with the second network node based on the key calculation function, the secret value of the first network node, the identifier and public key of the first network node, and the identifier and public key of the second network node.

[0156] In one possible implementation, the system parameters also include a portion of the private key;

[0157] The shared key generation device provided in this embodiment may further include: a first verification module, used to authenticate the second network node based on the identifier, public key, partial private key and system parameters of the second network node;

[0158] After the verification is successful, the first calculation module 430 described above will be executed.

[0159] In one possible implementation, the first verification module verifies using the following formula:

[0160] ; ;

[0161] in, This represents the public key of the second network node; This represents the public key of the system to which the second network node is located; The identifier representing the second network node; Represents the generator of the additive cyclic group; This represents a portion of the private key of the second network node; This represents the value determined based on the identifier and public key of the second network node; Represents a symmetric bilinear mapping; Indicates the first hash function;

[0162] If both of the above formulas are true, it means that the authentication of the second network node is successful.

[0163] In one possible implementation, the key calculation function further includes: a second hash function;

[0164] The aforementioned first computing module 430 includes a first computing unit and a second computing unit;

[0165] The first computing unit is used to calculate the initial shared key using the first hash function and the symmetric bilinear mapping, based on the secret value of the first network node, the identifier and public key of the first network node, and the identifier and public key of the second network node.

[0166] The second computing unit is used to process the initial shared key using the second hash function to obtain the shared key between the two parties communicating with the second network node.

[0167] In one possible implementation, the first calculation unit calculates using the following formula:

[0168] ;

[0169] The second calculation unit is obtained through the following formula: ;

[0170] in, Indicates the initial shared key; Represents a symmetric bilinear mapping; This represents the secret value of the first network node; This represents the value determined based on the identifier and public key of the first network node; This represents the value determined based on the identifier and public key of the second network node; The identifier representing the second network node; This represents the third random number in the system parameters; Indicates the second hash function; This indicates the shared key between the two parties communicating with the second network node.

[0171] In one possible implementation, the receiving module 410 is used to receive system parameters sent by the key generation center and node parameters of each network node by establishing a secure channel with the key generation center.

[0172] In one possible implementation, the shared key generation device provided in this embodiment may further include: a generation module, used to generate a transaction address based on the shared key between the two parties, the transaction address being used as a sending address or receiving address when communicating with the second network node.

[0173] In one possible implementation, the node parameters further include: a secret share; the system parameters also include: a first random number, a second random number, and a third random number;

[0174] The shared key generation device provided in this embodiment may further include:

[0175] The second calculation module is used to calculate the group key secret share of the first network node based on the first random number and the secret share of the first network node.

[0176] The first acquisition module 420 is used to acquire the group key secret share transmitted by other network nodes in the group after being encrypted according to the shared key of the two parties, and the group is a network node group including the first network node.

[0177] The first input module is used to recover the target polynomial based on the group key secret share of each network node and the identifier of each network node.

[0178] The third calculation module is used to calculate the group key of the group based on the target polynomial, the second random number, and the third random number.

[0179] In one possible implementation, the system parameters further include a target hash value; the shared key generation device provided in this embodiment may further include:

[0180] The fourth calculation module is used to calculate the hash value of the target polynomial to obtain the polynomial hash value;

[0181] The second verification module is used to verify whether the polynomial hash value is equal to the target hash value. If they are equal, the verification passes.

[0182] After the second verification module passes the verification, the third calculation module described above is executed.

[0183] In one possible implementation, the second calculation module calculates using the following formula:

[0184] ;

[0185] in, This represents the group key secret share of the first network node; The identifier representing the first network node; This represents the first random number in the system parameters; Represent a prime number;

[0186] The first input module is calculated using the following formula:

[0187] ;

[0188] in, Represent the objective polynomial; This indicates the number of network nodes contained in the group; An identifier representing a network node in a group;

[0189] The third calculation module calculates the result using the following formula: ;

[0190] in, This represents the group key of the group; This represents the second random number in the system parameters; This represents the third random number in the system parameters.

[0191] In one possible implementation, the shared key generation apparatus provided in this embodiment may further include:

[0192] The second acquisition module is used to acquire the group key secret share of the new network node;

[0193] The second input module is used to recover the target polynomial based on the group key secret share of the group and the new network node and the identifier of each network node;

[0194] The fourth calculation module is used to calculate the new group key based on the objective polynomial and the second and fourth random numbers in the system parameters.

[0195] Furthermore, embodiments of this application also provide a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the steps of the shared key generation method described in the above method embodiments.

[0196] The computer program product of the shared key generation method provided in this application includes a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the steps of the shared key generation method described in the above method embodiments. For details, please refer to the above method embodiments, which will not be repeated here.

[0197] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can also be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram and / or flowchart, and combinations of blocks in block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.

[0198] In addition, the functional modules in the various embodiments of this application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.

[0199] If the aforementioned functions are implemented as software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks. It should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0200] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application. It should be noted that similar reference numerals and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.

[0201] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A shared key generation method characterized by, Applied to a first network node, the method includes: The system parameters sent by the key generation center and the node parameters of each network node are received. The system parameters include a key calculation function for calculating the shared key. The node parameters include an identifier, which is formed when each network node registers with the key generation center. The node parameters also include a partial private key. For the second network node, obtain the public key of the second network node from its historical transaction data; The second network node is authenticated based on its identifier, public key, partial private key, and system parameters. After successful verification, a shared key for communication between the two parties communicating with the second network node is calculated based on the key calculation function, the secret value of the first network node, the identifier and public key of the first network node, and the identifier and public key of the second network node.

2. The method according to claim 1, characterized in that, The second network node is authenticated based on its identifier, public key, partial private key, and system parameters using the following formula: ; ; in, This represents the public key belonging to the second network node; This represents the public key of the system in which the second network node is located; The identifier representing the second network node; Represents the generator of the additive cyclic group; This represents a portion of the private key of the second network node; This represents the value determined based on the identifier and public key of the second network node; Represents a symmetric bilinear mapping; Indicates the first hash function; If both of the above formulas are true, it means that the authentication of the second network node is successful.

3. The method according to claim 1, characterized in that, The key calculation function further includes: a first hash function, a second hash function, and a symmetric bilinear mapping; The step of calculating the shared key for communication with the second network node based on the key calculation function, the secret value of the first network node, the identifier and public key of the first network node, and the identifier and public key of the second network node includes: Using the first hash function and the symmetric bilinear mapping, the initial shared key is calculated based on the secret value of the first network node, the identifier and public key of the first network node, and the identifier and public key of the second network node; The initial shared key is processed using the second hash function to obtain a shared key between the two parties communicating with the second network node.

4. The method according to claim 3, characterized in that, The initial shared key is calculated using the first hash function and the symmetric bilinear mapping, based on the secret value of the first network node, the identifier and public key of the first network node, and the identifier and public key of the second network node, using the following formula: ; in, ; The initial shared key is processed using the second hash function and calculated using the following formula: ; in, Indicates the initial shared key; Represents a symmetric bilinear mapping; This represents the secret value of the first network node; The identifier representing the first network node; This represents the secret value of the second network node; This represents the public key of the first network node; This represents the public key of the second network node; This represents the value determined based on the identifier and public key of the first network node; This represents the value determined based on the identifier and public key of the second network node; The identifier representing the second network node; This represents the third random number in the system parameters; This represents the second hash function; This indicates the shared key between the two parties communicating with the second network node.

5. The method according to claim 1, characterized in that, The system parameters sent by the receiving key generation center, and the node parameters of each network node, include: By establishing a secure channel with the key generation center, the system parameters sent by the key generation center, as well as the node parameters of each network node, are received.

6. The method according to claim 1, characterized in that, The method further includes: A transaction address is generated based on the shared key between the two parties. This transaction address is used as a sending address or receiving address when communicating with the second network node.

7. The method according to claim 1, characterized in that, The node parameters also include: a secret share; the system parameters also include: a first random number, a second random number, and a third random number; The method further includes: Calculate the group key secret share of the first network node based on the first random number and the secret share of the first network node; Obtain the group key secret share transmitted by other network nodes in the group after encryption based on the shared key between the two parties; The target polynomial is recovered based on the group key secret share of each network node and the identifier of each network node; The group key of the group is calculated based on the target polynomial, the second random number, and the third random number.

8. The method according to claim 7, characterized in that, The system parameters also include: the target hash value; Before calculating the group key of the group based on the target polynomial, the second random number, and the third random number, the method further includes: Calculate the hash value of the target polynomial to obtain the polynomial hash value; Verify whether the polynomial hash value is equal to the target hash value. If they are equal, the verification passes. After successful verification, the step of calculating the group key of the group based on the target polynomial, the second random number, and the third random number is then executed.

9. The method according to claim 7, characterized in that, The group key secret share of the first network node is calculated based on the first random number and the secret share of the first network node using the following formula: ; in, This represents the group key secret share of the first network node; The identifier representing the first network node; This represents the first random number in the system parameters; Represent a prime number; The target polynomial is recovered based on the group key secret share of each network node and the identifier of each network node, and is calculated using the following formula: ; in, Represent the objective polynomial; This indicates the number of network nodes contained in the group; An identifier representing a network node in a group; The group key of the group is calculated based on the target polynomial, the second random number, and the third random number, using the following formula: ; in, The group key representing the group; This represents the second random number in the system parameters; This refers to the third random number in the system parameters.

10. The method according to claim 7, characterized in that, The method further includes: Obtain the group key secret share of the new network node; The target polynomial is reconstructed based on the group key secret share of the group and the new network node and the identifier of each network node; A new group key is calculated based on the target polynomial and the second and fourth random numbers in the system parameters.

11. A shared key generation device, characterized in that, Applied to a first network node, the device includes: The receiving module is used to receive system parameters sent by the key generation center and node parameters of each network node; the system parameters include a key calculation function for calculating the shared key, the node parameters include an identifier, the node parameters are formed when each network node registers with the key generation center, and the node parameters also include a partial private key; The first acquisition module is used to acquire the public key of the second network node from the historical transaction data of the second network node. The first verification module is used to authenticate the second network node based on the identifier, public key, partial private key and system parameters of the second network node; The first calculation module is used to calculate a shared key between the two parties communicating with the second network node, based on the key calculation function, the secret value of the first network node, the identifier and public key of the first network node, and the identifier and public key of the second network node, after the authentication performed by the first verification module is successful.

12. An electronic device, characterized in that, include: The processor and memory, wherein the memory stores machine-readable instructions executable by the processor, wherein when the electronic device is running, the machine-readable instructions are executed by the processor to perform the steps of the method as described in any one of claims 1 to 10.

13. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, performs the steps of the method as described in any one of claims 1 to 10.

Citation Information

Patent Citations

  • Scalable security key architecture for network encryption

    US20180097785A1