Multi-party key agreement method and system based on guomi algorithms

By using the national secret algorithm, especially SM2, SM3 and SM4 in multi-party key negotiation, the communication rounds are reduced and efficiency is improved, and the high cost and low efficiency problems of traditional multi-party key negotiation in large-scale participants are solved. , suitable for gradient encryption calculations in horizontal federated scenarios.

WO2024239591A1PCT designated stage expired Publication Date: 2024-11-28CHINA TELECOM BESTPAY CO LTD

Patent Information

Application Number
PCT/CN2023/136356
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-05-25
Filing Date
2023-12-05
Publication Date
2024-11-28

AI Technical Summary

Technical Problem

Traditional multi-party key negotiation algorithms have high communication costs and low efficiency in large-scale participants, and the communication cycles reach exponential levels and cannot be effectively reduced.

Method used

The multi-party key negotiation method based on the national secret algorithm is adopted, and by specifying special parties to use SM2, SM3 and SM4 algorithms for key negotiation, the communication rounds are reduced to the linear level, and SM4 symmetric encryption is used to improve efficiency.

Benefits of technology

On the premise of ensuring security, the communication rounds and communication costs are significantly reduced, the algorithm efficiency is improved, and it is used for homomorphic encryption calculations in horizontal federated scenarios, improving data privacy protection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2023136356_28112024_PF_FP_ABST
    Figure CN2023136356_28112024_PF_FP_ABST
Patent Text Reader

Abstract

Provided in the present invention are a multi-party key agreement method and system based on Guomi algorithms, which relate to the technical field of network communication encryption. The method comprises: specifying a special party to perform with other parties pairwise key agreement based on Guomi SM2 and SM3, and using an agreed key as a symmetric encryption key of Guomi SM4; and, the special party performing XOR operation on a secure locally generated random number and the agreed key, and using an obtained result as an agreed seed key to be safely transmitted by means of symmetric encryption, so that all parties can safely acquire the agreed key. The rounds of communication of the present invention are 3(n-1) linear rounds, and when the n of parties is big, compared with conventional multi-party key agreement, the present invention reduces the communication rounds from an exponential level to a linear level, thereby greatly reducing communication costs, and improving the overall efficiency of algorithms.
Need to check novelty before this filing date? Find Prior Art

Description

A multi-party key negotiation method and system based on national secret algorithm Technical Field

[0001] The present invention relates to the field of network communication encryption technology, and in particular to a multi-party key negotiation method and system based on a national secret algorithm. Background Art

[0002] National secret algorithms are a series of domestically produced cryptographic algorithms approved by the State Cryptography Administration, also known as domestically produced commercial cryptographic algorithms. They primarily include SM2, SM3, SM4, and SM9. SM2 is a public-key encryption algorithm based on elliptic curves, SM3 is a message digest algorithm, SM4 is a public symmetric encryption algorithm, and SM9 is an identity-based encryption algorithm.

[0003] Secure multi-party computation (MPC) involves a group of mutually untrusted parties working together to securely obtain a computational result while protecting the privacy of all parties, without a trusted third party. In a distributed network, each party holds its own secret inputs and wishes to jointly compute a result based on a function, but each participant is unable to access any additional information other than the result. Each party completes a portion of the computation, and the final result is aggregated and shared publicly with a subset of participants. The underlying technology behind secure multi-party computation is cryptographic algorithms such as homomorphic encryption, obfuscated circuits, oblivious transfer protocols, and secret sharing.

[0004] In traditional multi-party key agreement algorithms, each participant must obtain the agreed-upon key through a cyclical computation, which requires a large number of communication rounds. Assuming there are n participants, the number of communication rounds reaches an exponential number of n(n-1). This approach incurs high communication costs when the number of participants is large, and since it relies entirely on public-key cryptography, it is inefficient.

[0005] Summary of the Invention

[0006] The purpose of the present invention is to provide a multi-party key negotiation method and system based on the national secret algorithm. Compared with traditional multi-party key negotiation, its communication rounds are reduced from exponential times to linear times. It can greatly reduce the number of communication rounds while securely obtaining the multi-party negotiation key, thereby improving the algorithm efficiency while ensuring security.

[0007] The embodiment of the present invention is achieved as follows:

[0008] In a first aspect, an embodiment of the present application provides a multi-party key agreement method based on a national secret algorithm, including several participants and designating a special participant from among them; the method includes:

[0009] Each participant generates their own SM2 public and private key pair locally based on the national secret SM2 algorithm;

[0010] The above-mentioned special participants exchange their respective SM2 public keys with the other participants, sign with the corresponding SM2 private key, and then use the national secret SM3 to perform hash operation to obtain the negotiated key;

[0011] The special participant generates a seed key based on the generated random number and the negotiated key with each participant;

[0012] The special participant encrypts the seed key based on the negotiated key using the SM4 algorithm to obtain the seed ciphertext and sends it to the other participants respectively;

[0013] After receiving the above seed ciphertext, the other participants decrypt it based on the above negotiated key to obtain the plaintext result.

[0014] Based on the first aspect, in some embodiments of the present invention, the step of each participant generating their own SM2 public-private key pair locally based on the national secret SM2 algorithm includes:

[0015] Each participant generates a random number of a specified length locally based on a secure pseudo-random number generator as the private key of the national secret SM2;

[0016] Obtain the public SM2 elliptic curve base point, and generate the SM2 public key based on the SM2 private key and the base point to obtain the respective SM2 public and private key pairs.

[0017] Based on the first aspect, in some embodiments of the present invention, the step of the special participant generating a seed key based on the generated random number and the negotiated key between the special participant and each participant includes:

[0018] The above-mentioned special participant generates a random number r1 of corresponding length based on a secure pseudo-random number generator;

[0019] Perform bitwise XOR operation on the random number r1 and the negotiated key between the parties to obtain the seed key seed; the calculation formula is: Among them, k 1,2 Represents the negotiated key between the above special participant and the second participant, k 1,3 Represents the negotiated key between the above special party and the third party.

[0020] Based on the first aspect, in some embodiments of the present invention, the steps of the special participant encrypting the seed key based on the negotiated key using the national secret SM4 algorithm to obtain the seed ciphertext and sending it to the remaining participants respectively include:

[0021] The negotiated key is processed using a key expansion algorithm to generate 32 sets of round keys.

[0022] The seed key is grouped bit by bit and encrypted 32 times using the round key.

[0023] The results of the iterative encryption are combined and transformed in reverse order to obtain the above seed ciphertext and sent to the other participants respectively.

[0024] In a second aspect, an embodiment of the present application provides a multi-party key agreement system based on a national secret algorithm, which includes:

[0025] National secret SM2 encryption module, each participant locally generates their own SM2 public and private key pair based on the national secret SM2 algorithm;

[0026] In the key negotiation module, the special participant exchanges their respective SM2 public keys with the other participants, signs with the corresponding SM2 private keys, and then uses the national secret SM3 for hash calculation to obtain the negotiated key;

[0027] A seed key generation module, in which the special participant generates a seed key based on a generated random number and a negotiated key with each participant;

[0028] The national secret SM4 encryption module: the above-mentioned special participant uses the national secret SM4 algorithm to encrypt the above-mentioned seed key based on the above-mentioned negotiated key, obtains the seed ciphertext and sends it to the other participants respectively;

[0029] The national secret SM4 decryption module, after the other participants receive the above seed ciphertext, decrypt it based on the above negotiated key to obtain the plaintext result.

[0030] In a third aspect, an embodiment of the present application provides an electronic device comprising a memory for storing one or more programs and a processor. When the one or more programs are executed by the processor, the method described in any one of the first aspects is implemented.

[0031] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method as described above in any one of the first aspects.

[0032] Compared with the prior art, the embodiments of the present invention have at least the following advantages or beneficial effects:

[0033] The embodiment of the present application provides a multi-party key negotiation method and system based on the national secret algorithm. By designating a special participant, a pairwise key negotiation based on the national secret SM2 and SM3 is carried out with other participants, and the negotiated key is used as the symmetric encryption key of the national secret SM4. The special participant performs an XOR operation on the locally generated random number and the negotiated key, and the result is used as the negotiated seed key and is securely transmitted through symmetric encryption, so that each participant can securely obtain the key agreed upon by the negotiation. The communication round of the present invention is a linear round of 3(n-1). When the number of participants n is large, compared with the traditional multi-party key negotiation, its communication round is reduced from exponential to linear, which can greatly reduce the communication cost. Symmetric encryption based on SM4 also speeds up the efficiency of encryption and decryption, and improves the overall efficiency of the algorithm while ensuring security. In addition, the negotiated key can be used as the seed input of homomorphic encryption. In the horizontal federation scenario, each participant with data can securely obtain and update the gradient value without exposing it to a third party, thereby improving the security of the algorithm. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. It should be understood that the following drawings only illustrate certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can be obtained based on these drawings without paying any creative work.

[0035] FIG1 is a block diagram of a multi-party key agreement method based on a national secret algorithm according to an embodiment of the present invention;

[0036] FIG2 is a flow chart of an embodiment of a multi-party key agreement method based on a national secret algorithm provided by the present invention;

[0037] FIG3 is an application diagram of an embodiment of a multi-party key agreement method based on a national secret algorithm provided by the present invention;

[0038] FIG4 is a structural block diagram of an embodiment of a multi-party key agreement system based on a national secret algorithm provided by the present invention;

[0039] FIG5 is a structural block diagram of an electronic device provided by an embodiment of the present invention.

[0040] Icons: 1. Memory; 2. Processor; 3. Communication interface; 11. National Secret SM2 encryption module; 12. Key negotiation module; 13. Seed key generation module; 14. National Secret SM4 encryption module; 15. National Secret SM4 decryption module. DETAILED DESCRIPTION

[0041] To make the objectives, technical solutions, and advantages of the embodiments of the present application more clear, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings of the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Generally, the components of the embodiments of the present application described and shown in the drawings herein can be arranged and designed in various different configurations.

[0042] Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the present application for protection, but merely represents selected embodiments of the present application. All other embodiments obtained by persons of ordinary skill in the art based on the embodiments in the present application without creative work are within the scope of protection of the present application.

[0043] Example

[0044] The following describes some embodiments of the present application in detail with reference to the accompanying drawings. In the absence of conflict, the following embodiments and features thereof may be combined with each other.

[0045] Please refer to FIG1 , which is a block diagram of a multi-party key agreement method based on a national secret algorithm provided in an embodiment of the present application. The method includes the following steps:

[0046] Step S1: Each participant generates its own SM2 public and private key pair locally based on the national secret SM2 algorithm.

[0047] In the above steps, one participant must be designated as a special participant in advance. This special participant is responsible for negotiating the key with other participants and calculating the generated key, such as Partner1 in Figure 2. After that, each participant generates a random number of a specified length based on a secure pseudo-random number generator locally as the private key s of the national secret SM2. i At the same time, each participant obtains the public SM2 elliptic curve base point G and uses the SM2 private key s i Generate SM2 public key p with base point G i . For example, the calculation method is: p i =s i ·G, where operator · represents the doubling operation on the elliptic curve. After this step, each participant i will obtain their own SM2 public and private key pair (p i , s i ).

[0048] Step S2: The special participant exchanges their respective SM2 public keys with the other participants, signs with the corresponding SM2 private key, and then uses the national secret SM3 to perform hash operation to obtain the negotiated key.

[0049] Please refer to Figure 2. In the above steps, the special participant Partner1 sends its SM2 public key p1 to other participants. After receiving the sent public key, the other participants sign with their local private key. At the same time, the signature result is hashed using the national secret SM3, and the hash result is used as the negotiated key k 1,i , that is, k 1,i =H(s i ·p1)=H(s i ·s1·G). At the same time, other participants also send the locally generated SM2 public key p i The special participant receives the public key sent by the other party and signs it with the local private key. At the same time, the signature result is hashed using the national secret SM3, and the hash result is used as the negotiated key k. 1,i After this step, the special participants and other parties negotiated a common key and obtained the negotiated key {k 1,i , i≥2}.

[0050] Step S3: The special participant generates a seed key based on the generated random number and the negotiated key with each participant.

[0051] After the above step S2, the special participant obtains the key {k 1,i , i≥2}, first generate a random number r1 of corresponding length based on the secure pseudo-random number generator, and perform bit-wise XOR operation on it and the negotiated key between the participants to obtain the seed key seed. The calculation formula is: Among them, k 1,2 Represents the negotiated key between the above special participant and the second participant, k 1,3 Represents the negotiated key between the above special party and the third party.

[0052] Step S4: The special participant encrypts the seed key based on the negotiated key using the national secret SM4 algorithm to obtain the seed ciphertext and sends it to the other participants respectively.

[0053] In the above steps, the special participant uses the key k generated in step S2 above 1,i , use the SM4 national secret symmetric encryption algorithm to encrypt the seed key seed generated by local calculation, and obtain the ciphertext result E 1,i ,Right now The encryption results are sent to other parties respectively. Specifically, when encrypting, the above-mentioned negotiated key {k 1,i, i≥2} are processed to generate 32 sets of round keys. Then the seed key seed is grouped by bit, with a group length of 128 bits (i.e. 16 bytes, 4 words), and 32 round key iterative encryptions are performed. Afterwards, the iterative encryption results are merged and reversed to obtain the seed ciphertext E 1,i And send it to the other participants respectively.

[0054] Step S5: After receiving the above seed ciphertext, the other participants decrypt it based on the above negotiated key to obtain the plaintext result.

[0055] In the above steps, the key k generated in step S2 is used 1,i and the national SM4 algorithm for the seed ciphertext E 1,i After decryption, the plaintext result can be obtained. Therefore, after this step, all participants will obtain the common key seed.

[0056] The above method uses a linear communication round count of 3(n-1), while traditional multi-party key agreement uses an exponential communication round count of n(n-1). This reduces the number of communication rounds from exponential to linear, achieving the goal of securely obtaining the negotiated key while reducing the number of communication rounds. Especially when the number of participants n is large, this significantly reduces communication costs and improves the overall efficiency of the algorithm compared to traditional multi-party key agreement. Furthermore, all encryption operations in the process are implemented based on national secret algorithms, ensuring security.

[0057] Furthermore, this method has a wide range of applications. For example, the negotiated key can be used as a symmetric encryption key between any two parties. It can also serve as the seed input for homomorphic encryption and hash functions, ensuring they output identical public and private keys or digest information. This can be applied to gradient encryption computations in horizontal federations. To better understand this method, the following describes its application in a gradient encryption computation scenario in horizontal federations.

[0058] Federated Learning (FL) is a distributed machine learning framework that protects data privacy and ensures security compliance. Based on data distribution, federated learning can be categorized into horizontal federated learning, vertical federated learning, and federated transfer learning. Horizontal federated learning refers to a scenario where all participants share the same user characteristics but different data samples, such as two banks in different regions. The federated learning process consists of data processing, model training, model validation, and model prediction. During the model training phase of horizontal federated learning, each participant is typically required to locally calculate intermediate parameters such as the model's gradient and send them to a third party. The third party aggregates the calculations and returns them to the participant to update the iterative model locally. This operation is repeated until the model stabilizes. Since the gradient information calculated locally by each participant cannot be exposed to a third party, the gradient needs to be encrypted. To enable the gradients of each participant to be calculated on ciphertext, a homomorphic encryption algorithm is typically used to encrypt and calculate the gradients.

[0059] Figure 3 shows the data exchange process in a horizontal federation scenario based on multi-party key agreement and homomorphic encryption. Assuming that the data owners {Partner1, Partner2, Partner3} participating in federated learning want to jointly train a model through horizontal federated learning, the specific process based on multi-party secure key agreement and homomorphic encryption is as follows:

[0060] 1. Each data owner {Partner1, Partner2, Partner3} trains a model based on its own data {data1, data2, data3} and obtains the gradient values ​​{w1, w2, w3} obtained by training based on the original data, as shown in (1) in Figure 3.

[0061] 2. Based on the above multi-party key agreement algorithm, each data owner designates Partner1 as a special participant and conducts multi-party key agreement based on the national secret algorithm with other participants to obtain the negotiated seed key seed. Each participant uses the seed as the input of the Paillier homomorphic encryption to obtain the same public key p k and private keys k , each participant uses the public key p k Encrypt our own gradient w i , get the encrypted gradient And Sent to the third-party Arbiter, as shown in (2)-(3) in Figure 3.

[0062] 3. The third-party Arbiter obtains the encrypted gradient sent by each participant Due to the characteristics of Paillier homomorphic encryption, Arbiter can perform calculations directly on the ciphertext without being able to obtain the original gradient wi The task information is calculated to obtain the updated gradient ciphertext Arbiter will ciphertext Distribute to each data owner {Partner1, Partner2, Partner3}, as shown in (4) in Figure 3.

[0063] 4. Each data owner {Partner1, Partner2, Partner3} receives the updated gradient value and uses the locally generated private key s k Decrypt the plaintext w′ to obtain the gradient and update the local training model gradient w i is w′ and continue training the model.

[0064] 5. The above process is repeated and iterative updates are continued until the model iteration reaches a certain threshold, at which point the model training ends. Each participant outputs a model based on horizontal federated learning, as shown in (5)-(7) in Figure 3.

[0065] Therefore, by using the consensus seed generated by the multi-party key agreement algorithm based on the national encryption implementation in scenarios such as horizontal federation, it can be used as the input for homomorphic encryption to generate the same public and private keys. This improves the efficiency of the algorithm while ensuring security.

[0066] Based on the same inventive concept, the present invention also proposes a multi-party key agreement system based on the national secret algorithm. Please refer to Figure 4, which is a structural block diagram of a multi-party key agreement system based on the national secret algorithm provided in an embodiment of the present application. The system includes:

[0067] National secret SM2 encryption module 11, each participant locally generates their own SM2 public and private key pair based on the national secret SM2 algorithm;

[0068] In the key negotiation module 12, the special participant exchanges their respective SM2 public keys with the other participants, signs with the corresponding SM2 private keys, and then performs a hash operation using the national secret SM3 to obtain the negotiated key;

[0069] A seed key generation module 13, wherein the special participant generates a seed key based on the generated random number and the negotiated key between the special participant and the other participants;

[0070] The national secret SM4 encryption module 14, the special participant encrypts the seed key based on the negotiated key using the national secret SM4 algorithm, obtains the seed ciphertext and sends it to the other participants respectively;

[0071] The national secret SM4 decryption module 15, after the other participants receive the seed ciphertext, decrypt it based on the negotiated key to obtain the plaintext result.

[0072] Please refer to Figure 5, which is a structural block diagram of an electronic device provided in an embodiment of the present application. The electronic device includes a memory 1, a processor 2 and a communication interface 3. The memory 1, processor 2 and communication interface 3 are electrically connected to each other directly or indirectly to realize 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 memory 1 can be used to store software programs and modules, such as the program instructions / modules corresponding to a multi-party key agreement system based on a national secret algorithm provided in an embodiment of the present application. The processor 2 executes various functional applications and data processing by executing the software programs and modules stored in the memory 1. The communication interface 3 can be used for signaling or data communication with other node devices.

[0073] The above description is merely a preferred embodiment of the present application and is not intended to limit the present application. Various modifications and variations are possible for those skilled in the art. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present application shall be included within the scope of protection of the present application.

[0074] It will be apparent to those skilled in the art that the present application is not limited to the details of the exemplary embodiments described above and that the present application can be implemented in other specific forms without departing from the spirit or essential characteristics of the present application. Therefore, the embodiments should be considered in all respects as illustrative and non-restrictive, and the scope of the present application is defined by the appended claims, not the foregoing description, and all variations within the meaning and range of equivalents of the claims are intended to be included therein. Any reference sign in a claim should not be construed as limiting the claim to which it relates.

Claims

1. A multi-party key negotiation method based on national secret algorithm, It is characterized in that Including a number of participants and designating a special participant from among them; the method comprises: Each participant generates its own SM2 public and private key pair locally based on the national secret SM2 algorithm; The special participants exchange their respective SM2 public keys with the other participants, sign with the corresponding SM2 private key, and then use the national secret SM3 to perform hash operation to obtain the negotiated key; The special participant generates a seed key based on the generated random number and the negotiated key between the special participant and the other participants; The special participant encrypts the seed key based on the negotiated key using the national secret SM4 algorithm to obtain the seed ciphertext and sends it to the other participants respectively; After receiving the seed ciphertext, the other participants decrypt it based on the negotiated key to obtain the plaintext result.

2. A multi-party key negotiation method based on a national secret algorithm as claimed in claim 1, It is characterized in that The steps of each participant generating their own SM2 public and private key pairs locally based on the national secret SM2 algorithm include: Each participant generates a random number of specified length locally based on a secure pseudo-random number generator as the private key of the national secret SM2; Obtain the public SM2 elliptic curve base point, and generate the SM2 public key based on the SM2 private key and the base point to obtain the respective SM2 public and private key pairs.

3. A multi-party key negotiation method based on a national secret algorithm as claimed in claim 1, It is characterized in that The step of generating a seed key based on the generated random number and the negotiated key between the special participant and each participant includes: The special participant generates a random number r of corresponding length based on a secure pseudo-random number generator 1 ; The random number r 1 The negotiated key between the parties is XORed bit by bit to obtain the seed key seed; the calculation formula is: Among them, k 1,2 represents the negotiated key between the special party and the second party, k 1,3 Represents the negotiated key between the special party and the third party.

4. A multi-party key negotiation method based on a national secret algorithm as claimed in claim 1, It is characterized in that The steps of the special participant encrypting the seed key based on the negotiated key using the national secret SM4 algorithm to obtain the seed ciphertext and sending it to the other participants respectively include: The negotiated key is processed using a key expansion algorithm to generate 32 groups of round keys; Grouping the seed key bit by bit, and performing 32 iterative encryption using the round key; The iterative encryption results are combined and reversely transformed to obtain the seed ciphertext and sent to the other participants respectively.

5. A multi-party key negotiation system based on national secret algorithm, It is characterized in that include: National secret SM2 encryption module, each participant generates its own SM2 public and private key pair locally based on the national secret SM2 algorithm; In the key negotiation module, the special participants exchange their respective SM2 public keys with the other participants, sign with the corresponding SM2 private key, and then use the national secret SM3 for hash operation to obtain the negotiated key; A seed key generation module, wherein the special participant generates a seed key based on a generated random number and a negotiated key with other participants; The national secret SM4 encryption module, the special participant encrypts the seed key based on the negotiated key using the national secret SM4 algorithm, obtains the seed ciphertext and sends it to the other participants respectively; The national secret SM4 decryption module, after the other participants receive the seed ciphertext, decrypt it based on the negotiated key to obtain the plaintext result.

6. An electronic device, It is characterized in that include: A memory for storing one or more programs; processor; When the one or more programs are executed by the processor, the method according to any one of claims 1 to 4 is implemented.

7. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 4 is implemented.

Citation Information

Patent Citations

  • National secret and index confusion-based hidden trace query method and device

    CN114547668A

  • Communication method between PMU and PDC in power monitoring system

    CN114915456A

  • Data transmission method and device, electronic equipment and computer readable medium

    CN115941278A

  • Multi-party key negotiation method and system based on national secret algorithm

    CN116707780A

  • Processor with an elliptic curve cryptographic algorithm and a data processing method thereof

    US20230085569A1

Cited By

  • Cross-chain identity privacy protection method based on casual transmission

    CN119449485A

  • APT organization infrastructure hunting method based on IOC recursive extension

    CN121173578A