Sm2 algorithm co-signature system, method and device fusing quantum key distribution

By using quantum key distribution network encryption and integrity verification, the security issues of the SM2 algorithm collaborative signature system in the cloud computing environment are solved, achieving higher security collaborative signature processing and reducing the risk of forgery and fraud.

CN116318654BActive Publication Date: 2026-03-31CHINA TELECOM QUANTUM TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-01-09
Publication Date
2026-03-31

AI Technical Summary

Technical Problem

In cloud computing environments, existing collaborative signature systems based on the SM2 algorithm suffer from security issues such as lack of integrity protection for data transmission and the possibility of message digests being replaced to forge signatures, resulting in low security for collaborative signatures.

Method used

The collaborative signature system employs the SM2 algorithm with integrated quantum key distribution. Encryption and integrity verification are performed through a quantum key distribution network between the client and server to ensure the security of data transmission. Both the client and server directly process the message to be signed.

Benefits of technology

It improves the security of collaborative signatures, reduces the possibility of one party forging or committing fraud, and enhances the credibility and security of digital signatures.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116318654B_ABST
    Figure CN116318654B_ABST
Patent Text Reader

Abstract

The application discloses an SM2 algorithm cooperative signature system and method fusing quantum key distribution, and relates to the technical field of cryptographic application. A client generates a first encryption parameter by using an SM2 algorithm, generates a first digest of a message to be signed according to an encryption public key and a first quantum key, encrypts the first encryption parameter, the message to be signed and the first digest by using a second quantum key, and generates a corresponding first integrity check value to obtain first encryption data; a server performs integrity check and decryption on the first encryption data by using the second quantum key, generates a second encryption parameter according to the first encryption parameter by using the SM2 algorithm; and the client generates a digital signature according to the second encryption parameter. The communication interaction process of the two parties of the cooperative signature adopts a quantum key distribution system, thereby improving the security of the cooperative signature, and the client and the server directly process the message to be signed, thereby reducing the possibility of fraud by one party.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of cryptographic application technology, specifically to a collaborative signature system, method, and device that integrates quantum key distribution with the SM2 algorithm. Background Technology

[0002] Elliptic Curve Cryptography (ECC) is a public-key cryptography system based on the mathematical problem of elliptic curves defined over finite fields. The SM2 algorithm, as specified in the GB / T 32918-2016 standard "Information Security Technology SM2 Elliptic Curve Public-Key Cryptography Algorithm," is a specific algorithm within the ECC cryptosystem. In cloud computing environments and SaaS applications, numerous software-implemented cryptographic modules are deployed. The use of these modules raises concerns about the security of the private key in the SM2 algorithm and the resulting trustworthiness of digital signatures in open environments. To address the security issues of private key signatures in open environments, collaborative signature techniques are generally employed. This involves both the software cryptographic module in the open environment and a closed hardware cryptographic module (HSM, commonly a cryptographic machine) storing portions of the private key. Only through collaboration can a message be digitally signed. Neither party can obtain any information about the other's private key. Therefore, even if an attacker successfully compromises the software cryptographic module in the open environment, they cannot forge the signature.

[0003] Patent document CN104243456A discloses a signature and decryption method and system based on the SM2 algorithm applicable to cloud computing. In this scheme, the SM2 algorithm generates a digital signature (r, s), where r is generated solely by the second communicating party based on the message digest e. The first communicating party processes the r returned by the second communicating party, rather than directly processing the message digest e. The following possibility exists: the second communicating party generates r' based on e' and sends it back to the first communicating party for signature processing, and replaces the original message of e with the original message of e' in the final message published by the first communicating party. This achieves the purpose of deceiving the first communicating party into performing a collaborative signature using e' that is unknown to them.

[0004] In existing technologies, implementing collaborative signatures requires the transmission of important data between two signer parties. The transmission of this data often lacks integrity protection and is susceptible to tampering. Moreover, collaborative signatures rely on one party to process the message and message digest, while the other party processes the message based on the already processed message digest. This can lead to the message digest being replaced and the signature being forged, resulting in low security for collaborative signatures. Summary of the Invention

[0005] The purpose of this invention is to solve the problems mentioned above in the background technology, and to propose a collaborative signature system, method and device that integrates quantum key distribution with the SM2 algorithm.

[0006] The objective of this invention can be achieved through the following technical solutions:

[0007] In a first aspect, this invention provides a collaborative signature system based on the SM2 algorithm and incorporating quantum key distribution, comprising a client, a server, and a quantum key distribution (QKD) network; wherein:

[0008] The client is configured to obtain a first quantum key and a second quantum key from a preset storage medium, generate a first encryption parameter using the SM2 algorithm, generate a first digest of the message to be signed based on the encryption public key obtained through key negotiation between the client and the server and the first quantum key, encrypt the first encryption parameter, the message to be signed, and the first digest using the second quantum key and generate a corresponding first integrity check value, and send the first encrypted data to the server; the preset storage medium stores multiple quantum keys injected by the QKD network;

[0009] The server is configured to obtain the first quantum key and the second quantum key from the QKD network, use the second quantum key to perform integrity verification and decryption on the first encrypted data to obtain the first encryption parameters, the message to be signed, and the first digest, use the first quantum key to generate a second digest of the message to be signed, and after comparing the first digest and the second digest and finding that they are correct, use the SM2 algorithm to generate a second encryption parameter based on the first encryption parameter, use the second quantum key to encrypt the second encryption parameter and generate a corresponding second integrity verification value, and then send the second encrypted data to the client.

[0010] The client is also used to perform integrity verification and decryption of the second encrypted data using the second quantum key to obtain the second encryption parameters, and to generate a digital signature based on the second encryption parameters.

[0011] In a second aspect, the present invention also provides a collaborative signature method for the SM2 algorithm incorporating quantum key distribution, the method being applied to a client and comprising:

[0012] The first encryption parameters are generated using the SM2 algorithm, and the first quantum key is obtained from the preset storage medium. The encryption public key and the first quantum key are obtained through negotiation based on the client and server keys to generate the first digest of the message to be signed. The preset storage medium stores multiple quantum keys injected by the QKD network.

[0013] Obtain a second quantum key from a preset storage medium, use the second quantum key to encrypt the first encryption parameter, the message to be signed and the first digest and generate a corresponding first integrity check value to obtain the first encrypted data;

[0014] The first encrypted data is sent to the server; the server then obtains the first quantum key and the second quantum key from the QKD network, uses the second quantum key to perform integrity verification and decryption on the first encrypted data to obtain the first encryption parameters, the message to be signed, and the first digest, uses the first quantum key to generate a second digest of the message to be signed, and after comparing the first digest and the second digest and finding no errors, uses the SM2 algorithm to generate a second encryption parameter based on the first encryption parameter, uses the second quantum key to encrypt the second encryption parameter and generate a corresponding second integrity verification value, and obtains the second encrypted data which is then sent to the client.

[0015] The second quantum key is used to perform integrity verification and decryption of the second encrypted data to obtain the second encryption parameters, and a digital signature is generated based on the second encryption parameters.

[0016] Optionally, before generating the first encryption parameters using the SM2 algorithm, obtaining the first quantum key from a preset storage medium, and generating the first digest of the message to be signed based on the encryption public key obtained through client-server key negotiation and the first quantum key, the method further includes:

[0017] Obtain the pre-set elliptic curve parameters E(Fq), G, and n of the SM2 algorithm. Elliptic curve E is defined on the finite field Fq, and G represents the nth-order base point on elliptic curve E.

[0018] Generate a random number between [1, n-1], and use the generated random number as D. C Calculate the first private key data P1 = D C [*]G, [*] represents the generation of elliptic curve dot product operation. The third quantum key is obtained in the preset storage medium. The first private key data is encrypted using the third quantum key and a corresponding third integrity check value is generated to obtain the negotiated data.

[0019] The negotiated data is sent to the server; the server then obtains the third quantum key through the QKD network, uses the third quantum key to perform integrity verification and decryption on the negotiated data to obtain the first private key data, generates a random number between [1, n-1], and uses the generated random number as D. S Calculate the public key P G =D S [*]P1-G=(D C D S -1)[*]G, and publish the public key.

[0020] Optionally, the first encryption parameter is generated using the SM2 algorithm as follows:

[0021] Generate a random number K1 between [1, n-1], and use D c -1 D c Given the inverse element in Fq, calculate Q1 = K1 * D. c -1 [*]G,S1=D c -1 *(K1*D c -1 )mod n, taking Q1 and S1 as the first encryption parameters;

[0022] Based on the encryption public key obtained through the client-server key negotiation and the first quantum key, a first digest of the message to be signed is generated, including:

[0023] Calculate the first intermediate parameter Z based on GB / T 32918:

[0024] Z = HASH(ENTL) C ||ID C ||ENTL S ||ID S ||x G ||y G ||x||y)

[0025] Among them, ID C and ID S These are the user identifiers for the client and the server, respectively. C and ENTL S The length of the user identifier is x, respectively. G and y G Let G be the coordinates of the point on the elliptic curve, and x and y be the public key P. G The coordinates;

[0026] Calculate the second intermediate parameter M' based on Z and the message M to be signed:

[0027] M'=Z||ID key ||M

[0028] Among them, ID key The key ID for the first quantum key;

[0029] The first digest e of the message to be signed is obtained by performing a keyed hash operation on M' with the first quantum key: e = HMAC(M', Key1).

[0030] Optionally, the calculation process of the second encryption parameter is as follows: the server generates two random numbers K2 and K3 located between [1, n-1], and calculates Q2 = K2 * D. s -1 [*]G, Q3=K3*D s [*]G, calculate K2*D s -1 [*]Q1+Q3 yields the result (x1,y1), which is (K1*K2*D c -1 *D s -1 +K3*D s )[*]G), and calculate r=x1+e mod n, where, if r is not equal to 0, then further calculate S2=D s -1 *(K2*D s -1 )mod n, S3=D s -1 *(r+K3*D s )mod n, taking Q2, Q3, S2 and S3 as the second encryption parameters; if r equals 0, the server can regenerate K2 and recalculate (x1,y1) and r until r is not equal to 0;

[0031] Generating a digital signature based on the second encryption parameter includes:

[0032] Calculate K1*D c -1 [*]Q2+Q3 yields the calculation result (x1,y1) (i.e., (K1*K2*D) c -1 *D s -1 +K3*D s )[*]G), and calculate r=x1+e mod n, further calculate s=(D c -1 *S3+S2*S1-r)mod n, where if s is not equal to 0 and not equal to nr, then the data type of (r,s) is converted into a byte string according to the method of GB / T 32918 and published as a signature for message M; if s is equal to 0 or equal to nr, then the collaborative signature is performed again.

[0033] A third aspect of this invention also provides a collaborative signature method for the SM2 algorithm incorporating quantum key distribution, the method being applied to a server and comprising:

[0034] The system receives first encrypted data sent by a client. The process of generating the first encrypted data is as follows: the client generates first encryption parameters using the SM2 algorithm, obtains a first quantum key from a preset storage medium, obtains an encryption public key and the first quantum key through key negotiation between the client and the server, generates a first digest of the message to be signed, obtains a second quantum key from the preset storage medium, and uses the second quantum key to encrypt the first encryption parameters, the message to be signed, and the first digest to generate a corresponding first integrity check value, thereby obtaining the first encrypted data. The preset storage medium stores multiple quantum keys injected by the QKD network.

[0035] The second quantum key is obtained from the QKD network, and the second quantum key is used to perform integrity verification and decryption on the first encrypted data to obtain the first encryption parameters, the message to be signed, and the first digest.

[0036] The first quantum key is obtained from the QKD network, a second digest of the message to be signed is generated using the first quantum key, and the first digest and the second digest are compared.

[0037] If the first digest and the second digest are identical, the SM2 algorithm is used to generate a second encryption parameter based on the first encryption parameter. The second quantum key is used to encrypt the second encryption parameter and generate a corresponding second integrity check value. The second encrypted data is then sent to the client. The client then uses the second quantum key to perform integrity check and decryption on the second encrypted data to obtain the second encryption parameter and generates a digital signature based on the second encryption parameter.

[0038] Optionally, before receiving the first encrypted data sent by the client, the method further includes:

[0039] The client receives negotiation data sent by the client. The process of generating the negotiation data is as follows: the client obtains the pre-set elliptic curve parameters E(Fq), G, and n of the SM2 algorithm, where the elliptic curve E is defined on the finite field Fq, and G represents the nth-order base point on the elliptic curve E; a random number between [1, n-1] is generated, and the generated random number is used as D. C Calculate the first private key data P1 = D C [*]G, [*] represents the generation of elliptic curve dot product operation. The third quantum key is obtained in the preset storage medium. The first private key data is encrypted using the third quantum key and a corresponding third integrity check value is generated to obtain the negotiated data.

[0040] The third quantum key is obtained through the QKD network, and the third quantum key is used to perform integrity verification and decryption on the negotiated data to obtain the first private key data.

[0041] Generate a random number between [1, n-1], and use the generated random number as D. S Calculate the public key P G =D S [*]P1-G=(D C D S -1)[*]G, and publish the public key.

[0042] Optionally, the process of generating the first encryption parameter is as follows: the client generates a random number K1 located between [1, n-1], and then... c -1 D c Given the inverse element in Fq, calculate Q1 = K1 * D. c -1 [*]G,S1=D c -1 *(K1*D c -1 )mod n, taking Q1 and S1 as the first encryption parameters;

[0043] The second encryption parameter is generated using the SM2 algorithm based on the first encryption parameter, including:

[0044] Generate two random numbers K2 and K3 located between [1, n-1], and calculate Q2 = K2 * D. s -1 [*]G, Q3=K3*D s [*]G, calculate K2*D s -1 [*]Q1+Q3 yields the result (x1,y1), which is (K1*K2*D c -1 *D s -1 +K3*D s )[*]G), and calculate r=x1+emod n, where, if r is not equal to 0, then further calculate S2=D s -1 *(K2*D s -1 )mod n, S3=D s -1 *(r+K3*D s )mod n, taking Q2, Q3, S2 and S3 as the second encryption parameters; if r equals 0, the server can regenerate K2 and recalculate (x1,y1) and r until r is not equal to 0.

[0045] A fourth aspect of the present invention also provides an SM2 algorithm collaborative signature device integrating quantum key distribution, the device being applied to a client and comprising:

[0046] The data processing module is used to generate first encryption parameters using the SM2 algorithm, obtain a first quantum key from a preset storage medium, and generate a first digest of the message to be signed based on the encryption public key obtained through negotiation between the client and server keys and the first quantum key; the preset storage medium stores multiple quantum keys injected by the QKD network;

[0047] The encryption module obtains a second quantum key from a preset storage medium, uses the second quantum key to encrypt the first encryption parameter, the message to be signed, and the first digest, and generates a corresponding first integrity check value to obtain first encrypted data.

[0048] A data sending module is configured to send the first encrypted data to the server; so that the server obtains the first quantum key and the second quantum key from the QKD network, uses the second quantum key to perform integrity verification and decryption on the first encrypted data to obtain the first encryption parameters, the message to be signed and the first digest, uses the first quantum key to generate a second digest of the message to be signed, and after comparing the first digest and the second digest and finding no errors, uses the SM2 algorithm to generate a second encryption parameter based on the first encryption parameter, uses the second quantum key to encrypt the second encryption parameter and generate a corresponding second integrity verification value, and obtains the second encrypted data to send to the client;

[0049] The first collaborative signature module is used to perform integrity verification and decryption of the second encrypted data using the second quantum key to obtain the second encryption parameters, and generate a digital signature based on the second encryption parameters.

[0050] In a fifth aspect, the present invention also provides an SM2 algorithm collaborative signature device integrating quantum key distribution, the device being applied to a server and comprising:

[0051] A data receiving module is used to receive first encrypted data sent by a client. The process of generating the first encrypted data is as follows: the client uses the SM2 algorithm to generate first encryption parameters, obtains a first quantum key from a preset storage medium, obtains an encryption public key and the first quantum key through key negotiation between the client and the server, generates a first digest of the message to be signed, obtains a second quantum key from the preset storage medium, and uses the second quantum key to encrypt the first encryption parameters, the message to be signed, and the first digest to generate a corresponding first integrity check value, thereby obtaining the first encrypted data. The preset storage medium stores multiple quantum keys injected by the QKD network.

[0052] The decryption module is used to obtain the second quantum key from the QKD network, and use the second quantum key to perform integrity verification and decryption on the first encrypted data to obtain the first encryption parameters, the message to be signed, and the first digest.

[0053] The verification module is used to obtain the first quantum key from the QKD network, use the first quantum key to generate a second digest of the message to be signed, and compare the first digest and the second digest.

[0054] The second collaborative signature module is used to, if the first digest and the second digest are found to be correct, generate a second encryption parameter using the SM2 algorithm based on the first encryption parameter, encrypt the second encryption parameter using the second quantum key and generate a corresponding second integrity check value, and send the second encrypted data to the client; so that the client uses the second quantum key to perform integrity check and decryption on the second encrypted data to obtain the second encryption parameter, and generates a digital signature based on the second encryption parameter.

[0055] The beneficial effects of this invention are:

[0056] This invention provides a collaborative signature system based on the SM2 algorithm and incorporating quantum key distribution (QKD), comprising a client, a server, and a QKD network. The client is configured to: acquire a first quantum key and a second quantum key from a preset storage medium; generate first encryption parameters using the SM2 algorithm; generate a first digest of the message to be signed based on the encryption public key obtained through key negotiation between the client and server and the first quantum key; encrypt the first encryption parameters, the message to be signed, and the first digest using the second quantum key and generate a corresponding first integrity check value; and send the first encrypted data to the server. The preset storage medium stores multiple quantum keys injected by the QKD network. The server is configured to: The system obtains a first quantum key and a second quantum key from a QKD network. Using the second quantum key, it performs integrity verification and decryption on the first encrypted data to obtain the first encryption parameters, the message to be signed, and a first digest. It then uses the first quantum key to generate a second digest of the message to be signed. After verifying that the first and second digests are correct, it uses the SM2 algorithm to generate second encryption parameters based on the first encryption parameters. The second quantum key is then used to encrypt the second encryption parameters and generate a corresponding second integrity verification value, resulting in second encrypted data which is sent to the client. The client also uses the second quantum key to perform integrity verification and decryption on the second encrypted data to obtain the second encryption parameters, and then generates a digital signature based on these parameters. The use of a quantum key distribution system in the communication process between the two parties in the collaborative signature enhances the security of the collaborative signature. Both the client and server directly process the message to be signed, reducing the possibility of forgery or fraud by one party. Attached Figure Description

[0057] The invention will now be further described with reference to the accompanying drawings.

[0058] Figure 1 A system block diagram of an SM2 algorithm collaborative signature system integrating quantum key distribution is provided for an embodiment of the present invention;

[0059] Figure 2 A flowchart of an SM2 algorithm collaborative signature method for fused quantum key distribution applied to a client, provided as an embodiment of the present invention;

[0060] Figure 3 A flowchart of an SM2 algorithm collaborative signature method for server-side fusion quantum key distribution provided by an embodiment of the present invention;

[0061] Figure 4 This is a structural diagram of an SM2 algorithm collaborative signature device for fusion quantum key distribution applied to a client, provided in an embodiment of the present invention.

[0062] Figure 5This is a structural diagram of an SM2 algorithm collaborative signature device for fusion quantum key distribution applied to a server, as provided in an embodiment of the present invention. Detailed Implementation

[0063] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0064] This invention provides a collaborative signature system based on the SM2 algorithm and incorporating quantum key distribution. See also... Figure 1 , Figure 1 This is a system block diagram of an SM2 algorithm collaborative signature system integrating quantum key distribution, provided as an embodiment of the present invention. The system includes a client, a server, and a quantum key distribution (QKD) network; wherein:

[0065] The client is used to obtain a first quantum key and a second quantum key from a preset storage medium, generate a first encryption parameter using the SM2 algorithm, generate a first digest of the message to be signed by obtaining an encryption public key and the first quantum key through key negotiation between the client and the server, encrypt the first encryption parameter, the message to be signed, and the first digest using the second quantum key and generate a corresponding first integrity check value, and send the first encrypted data to the server; the preset storage medium stores multiple quantum keys injected by the QKD network;

[0066] The server obtains a first quantum key and a second quantum key from the QKD network. It uses the second quantum key to perform integrity verification and decryption on the first encrypted data to obtain the first encryption parameters, the message to be signed, and the first digest. It uses the first quantum key to generate a second digest of the message to be signed. After comparing the first digest and the second digest and finding that they are correct, it uses the SM2 algorithm to generate a second encryption parameter based on the first encryption parameter. It uses the second quantum key to encrypt the second encryption parameter and generate a corresponding second integrity verification value. Finally, it sends the second encrypted data to the client.

[0067] The client is also used to perform integrity verification and decryption of the second encrypted data using the second quantum key to obtain the second encryption parameters, and to generate a digital signature based on the second encryption parameters.

[0068] Based on the embodiments of the present invention, an SM2 algorithm collaborative signature system integrating quantum key distribution is provided. The communication interaction process between the two parties in the collaborative signature adopts a quantum key distribution system, which improves the security of the collaborative signature. Both the client and the server directly process the message to be signed, reducing the possibility of one party forging or committing fraud.

[0069] In one implementation, the present invention achieves its content through the following method and system structure, including:

[0070] Client: The initiator and issuer of collaborative signatures, typically a cryptographic module in the form of software running in the cloud or on a mobile device;

[0071] Server-side: The parties involved in the collaborative signing and the publisher of the shared public key, typically a hardware-bounded cryptographic machine (HSM).

[0072] Key proxy: Provides a proxy function for key injection when it is not possible to directly inject keys at the nodes of the quantum key distribution network;

[0073] Quantum key distribution network: includes quantum network nodes and quantum network link control center, and realizes services such as quantum key generation, quantum key relay, and quantum key provision;

[0074] Quantum network nodes: store the generated quantum keys, receive key requests from key brokers, and provide keys to key brokers or directly provide key filling services;

[0075] Quantum Network Link Control Center: Can establish quantum key distribution and relay links between nodes according to the quantum network node ID.

[0076] In one implementation, a large number of quantum keys are pre-loaded into the software or hardware cryptographic modules of the client and server using a quantum key distribution (QKD) network and a high-capacity secure storage medium such as a secure TF card or a secure USB key. Each quantum key is in the format of a 4-byte key ID + L-byte key (L is related to the encryption algorithm).

[0077] Based on the same inventive concept, embodiments of the present invention provide a collaborative signature method for the SM2 algorithm that integrates quantum key distribution. See also Figure 2 , Figure 2 A flowchart illustrating an SM2 algorithm collaborative signature method for fused quantum key distribution applied to a client, as provided in this embodiment of the invention. It includes:

[0078] S201, use the SM2 algorithm to generate the first encryption parameters, obtain the first quantum key from the preset storage medium, and generate the first digest of the message to be signed by obtaining the encryption public key and the first quantum key according to the key negotiation between the client and the server.

[0079] S202, obtain the second quantum key from the preset storage medium, use the second quantum key to encrypt the first encryption parameter, the message to be signed and the first digest and generate the corresponding first integrity verification value to obtain the first encrypted data.

[0080] S203, the first encrypted data is sent to the server so that the server can obtain the first quantum key and the second quantum key from the QKD network, use the second quantum key to perform integrity verification and decryption on the first encrypted data to obtain the first encryption parameters, the message to be signed and the first digest, use the first quantum key to generate the second digest of the message to be signed, compare the first digest and the second digest and find that they are correct, use the SM2 algorithm to generate the second encryption parameters according to the first encryption parameters, use the second quantum key to encrypt the second encryption parameters and generate the corresponding second integrity verification value, and then send the second encrypted data to the client.

[0081] S204, use the second quantum key to perform integrity verification and decryption on the second encrypted data to obtain the second encryption parameters, and generate a digital signature based on the second encryption parameters.

[0082] The preset storage medium contains multiple quantum keys injected by the QKD network.

[0083] Based on the SM2 algorithm collaborative signature method with quantum key distribution provided by the embodiments of the present invention, the communication interaction process between the two parties in the collaborative signature adopts a quantum key distribution system to improve the security of the collaborative signature. Both the client and the server directly process the message to be signed, reducing the possibility of one party forging or committing fraud.

[0084] In one implementation, the first encrypted data may further include the client's user ID, the first key ID of the first quantum key, and the second key ID of the second quantum key. The server can obtain the corresponding first quantum key and second quantum key from the QKD network based on the user ID and the first key ID, and the user ID and the second key ID, respectively.

[0085] In one embodiment, prior to step S201, the method further includes:

[0086] Step 1: Obtain the pre-set elliptic curve parameters E(Fq), G, and n for the SM2 algorithm. Elliptic curve E is defined on the finite field Fq, and G represents the nth-order base point on elliptic curve E.

[0087] Step 2: Generate a random number between [1, n-1], and use the generated random number as D. C Calculate the first private key data P1 = D C [*]G, where [*] represents the generation of elliptic curve dot product operation. The third quantum key is obtained from the preset storage medium. The first private key data is encrypted using the third quantum key and a corresponding third integrity check value is generated to obtain the negotiated data.

[0088] Step 3: Send the negotiated data to the server; the server then obtains the third quantum key through the QKD network, uses the third quantum key to perform integrity verification and decryption of the negotiated data to obtain the first private key data, and generates a random number between [1, n-1]. This generated random number is used as the D key. S Calculate the public key P G =D S [*]P1-G=(D C D S -1)[*]G, and publish the public key.

[0089] In one embodiment, generating the first encryption parameter using the SM2 algorithm specifically involves:

[0090] Generate a random number K1 between [1, n-1], and use D c -1 D c Given the inverse element in Fq, calculate Q1 = K1 * D. c -1 [*]G,S1=D c -1 *(K1*D c -1 )mod n, taking Q1 and S1 as the first encryption parameters;

[0091] Based on the encryption public key and the first quantum key obtained through key negotiation between the client and server, a first digest of the message to be signed is generated, including:

[0092] Calculate the first intermediate parameter Z based on GB / T 32918:

[0093] Z = HASH(ENTL) C ||ID C ||ENTL S ||ID S ||x G ||y G ||x||y)

[0094] Among them, ID C and ID S These are the user identifiers for the client and the server, respectively, ENTL C and ENTL S The length of the user identifier is x, respectively. G and y G Let G be the coordinates of the point on the elliptic curve, and x and y be the public key P. G The coordinates;

[0095] Calculate the second intermediate parameter M' based on Z and the message M to be signed:

[0096] M'=Z||ID key ||M

[0097] Among them, ID key The key ID for the first quantum key;

[0098] The first digest e of the message to be signed is obtained by performing a keyed hash operation on M' with the first quantum key: e = HMAC(M', Key1).

[0099] In one implementation, Key1 is the first quantum key, and the hash calculation for the signature uses hash operation with quantum key. Only those who possess or acquire a quantum key that matches their identity can perform correct signing and verification. The correctness and validity of the quantum key are guaranteed by the quantum key distribution system. This further enhances the security and trustworthiness of digital signatures in open environments on the basis of collaborative signature.

[0100] In one embodiment, the calculation process of the second encryption parameter is as follows: the server generates two random numbers K2 and K3 located between [1, n-1], and calculates Q2 = K2 * D. s -1 [*]G, Q3=K3*D s [*]G, calculate K2*D s -1 [*]Q1+Q3 yields the result (x1,y1), which is (K1*K2*D c -1 *D s -1 +K3*D s )[*]G), and calculate r=x1+e mod n, where, if r is not equal to 0, then further calculate S2=D s -1 *(K2*D s -1 )mod n, S3=D s -1 *(r+K3*D s )mod n, taking Q2, Q3, S2 and S3 as the second encryption parameters; if r equals 0, the server can regenerate K2 and recalculate (x1,y1) and r until r is not equal to 0;

[0101] Generating a digital signature based on the second encryption parameter includes:

[0102] Calculate K1*D c -1 [*]Q2+Q3 yields the calculation result (x1,y1) (i.e., (K1*K2*D) c -1 *D s-1 +K3*D s )[*]G), and calculate r=x1+e mod n, further calculate s=(D c -1 *S3+S2*S1-r)mod n, where if s is not equal to 0 and not equal to nr, then the data type of (r,s) is converted into a byte string according to the method of GB / T 32918 and published as a signature for message M; if s is equal to 0 or equal to nr, then the collaborative signature is performed again.

[0103] In one implementation, if s equals 0 or equals nr, then the collaborative signature is executed again starting from S201.

[0104] Based on the same inventive concept, embodiments of the present invention provide a collaborative signature method for the SM2 algorithm that integrates quantum key distribution. See also Figure 3 , Figure 3 This is a flowchart illustrating an SM2 algorithm collaborative signature method for server-side fusion quantum key distribution, provided as an embodiment of the present invention. It includes:

[0105] S301 receives the first encrypted data sent by the client.

[0106] S302, obtain the second quantum key from the QKD network, and use the second quantum key to perform integrity verification and decryption on the first encrypted data to obtain the first encryption parameters, the message to be signed, and the first digest.

[0107] S303: Obtain the first quantum key from the QKD network, use the first quantum key to generate a second digest of the message to be signed, and compare the first digest and the second digest.

[0108] S304, if the first digest and the second digest are consistent, the SM2 algorithm is used to generate the second encryption parameter based on the first encryption parameter, the second quantum key is used to encrypt the second encryption parameter and generate the corresponding second integrity check value, and the second encrypted data is sent to the client so that the client can use the second quantum key to perform integrity check and decryption on the second encrypted data to obtain the second encryption parameter, and generate a digital signature based on the second encryption parameter.

[0109] The process of generating the first encrypted data is as follows: the client uses the SM2 algorithm to generate the first encryption parameters, obtains the first quantum key from the preset storage medium, obtains the encryption public key and the first quantum key through key negotiation between the client and the server, generates the first digest of the message to be signed, obtains the second quantum key from the preset storage medium, and uses the second quantum key to encrypt the first encryption parameters, the message to be signed, and the first digest and generate the corresponding first integrity check value to obtain the first encrypted data; the preset storage medium stores multiple quantum keys injected by the QKD network.

[0110] Based on the SM2 algorithm collaborative signature method with quantum key distribution provided by the embodiments of the present invention, the communication interaction process between the two parties in the collaborative signature adopts a quantum key distribution system to improve the security of the collaborative signature. Both the client and the server directly process the message to be signed, reducing the possibility of one party forging or committing fraud.

[0111] In one implementation, comparing the first digest and the second digest can verify whether the signature digest has been tampered with, reducing the possibility of one party forging or committing fraud.

[0112] In one implementation, the client's operation steps can be referred to the above steps S201-204.

[0113] In one embodiment, prior to step S301, the method further includes:

[0114] The client receives negotiation data sent by the client. The process of generating the negotiation data is as follows: the client obtains the pre-set elliptic curve parameters E(Fq), G, and n of the SM2 algorithm. Elliptic curve E is defined on the finite field Fq, and G represents the nth-order base point on elliptic curve E. A random number between [1, n-1] is generated, and the generated random number is used as D. C Calculate the first private key data P1 = D C [*]G, [*] represents the generation of elliptic curve dot product operation. The third quantum key is obtained from the preset storage medium. The first private key data is encrypted using the third quantum key and a corresponding third integrity check value is generated to obtain the negotiated data.

[0115] The third quantum key is obtained through the QKD network, and the first private key data is obtained by using the third quantum key to perform integrity verification and decryption on the negotiated data.

[0116] Generate a random number between [1, n-1], and use the generated random number as D. S Calculate the public key P G =D S [*]P1-G=(D C D S -1)[*]G, and publish the public key.

[0117] In one embodiment, the process of generating the first encryption parameter is as follows: the client generates a random number K1 located between [1, n-1], and then... c -1 Given the inverse of Dc on Fq, calculate Q1 = K1 * D. c -1 [*]G,S1=D c -1 *(K1*D c -1 )mod n, taking Q1 and S1 as the first encryption parameters;

[0118] The second encryption parameter is generated using the SM2 algorithm based on the first encryption parameter, including:

[0119] Generate two random numbers K2 and K3 located between [1, n-1], and calculate Q2 = K2 * D. s -1 [*]G, Q3=K3*D s [*]G, calculate K2*D s -1 [*]Q1+Q3 yields the result (x1,y1), which is (K1*K2*D c -1 *D s -1 +K3*D s )[*]G), and calculate r=x1+emod n, where, if r is not equal to 0, then further calculate S2=D s -1 *(K2*D s -1 )mod n, S3=D s -1 *(r+K3*D s )mod n, taking Q2, Q3, S2 and S3 as the second encryption parameters; if r equals 0, the server can regenerate K2 and recalculate (x1,y1) and r until r is not equal to 0.

[0120] Based on the same inventive concept, embodiments of the present invention provide a collaborative signature device for the SM2 algorithm that integrates quantum key distribution. See also Figure 4 , Figure 4 This is a structural diagram of an SM2 algorithm collaborative signature device for fused quantum key distribution applied to a client, provided as an embodiment of the present invention. It includes:

[0121] The data processing module is used to generate the first encryption parameters using the SM2 algorithm, obtain the first quantum key from the preset storage medium, and generate the first digest of the message to be signed by obtaining the encryption public key and the first quantum key based on the key negotiation between the client and the server; the preset storage medium stores multiple quantum keys injected by the QKD network;

[0122] The encryption module obtains a second quantum key from a preset storage medium, uses the second quantum key to encrypt the first encryption parameter, the message to be signed, and the first digest, and generates a corresponding first integrity verification value to obtain the first encrypted data.

[0123] The data sending module is used to send the first encrypted data to the server; so that the server can obtain the first quantum key and the second quantum key from the QKD network, use the second quantum key to perform integrity verification and decryption on the first encrypted data to obtain the first encryption parameters, the message to be signed and the first digest, use the first quantum key to generate the second digest of the message to be signed, compare the first digest and the second digest and find that they are correct, use the SM2 algorithm to generate the second encryption parameters according to the first encryption parameters, use the second quantum key to encrypt the second encryption parameters and generate the corresponding second integrity verification value, and obtain the second encrypted data to send to the client;

[0124] The first collaborative signature module is used to perform integrity verification and decryption of the second encrypted data using the second quantum key to obtain the second encryption parameters, and to generate a digital signature based on the second encryption parameters.

[0125] Based on the SM2 algorithm collaborative signature device integrating quantum key distribution provided by the embodiments of the present invention, the communication interaction process between the two parties in the collaborative signature adopts a quantum key distribution system to improve the security of the collaborative signature. Both the client and the server directly process the message to be signed, reducing the possibility of one party forging or committing fraud.

[0126] Based on the same inventive concept, embodiments of the present invention provide a collaborative signature device for the SM2 algorithm that integrates quantum key distribution. See also Figure 5 , Figure 5 This is a structural diagram of an SM2 algorithm collaborative signature device for fusion quantum key distribution applied to a server, provided as an embodiment of the present invention. It includes:

[0127] The data receiving module is used to receive the first encrypted data sent by the client. The process of generating the first encrypted data is as follows: the client uses the SM2 algorithm to generate the first encryption parameters, obtains the first quantum key from the preset storage medium, obtains the encryption public key and the first quantum key through key negotiation between the client and the server, generates the first digest of the message to be signed, obtains the second quantum key from the preset storage medium, and uses the second quantum key to encrypt the first encryption parameters, the message to be signed, and the first digest to generate the corresponding first integrity check value, thereby obtaining the first encrypted data. The preset storage medium stores multiple quantum keys injected by the QKD network.

[0128] The decryption module is used to obtain a second quantum key from the QKD network, and use the second quantum key to perform integrity verification and decryption on the first encrypted data to obtain the first encrypted parameters, the message to be signed, and the first digest.

[0129] The verification module is used to obtain the first quantum key from the QKD network, use the first quantum key to generate a second digest of the message to be signed, and compare the first digest and the second digest.

[0130] The second collaborative signature module is used to, if the first digest and the second digest are found to be correct, generate a second encryption parameter using the SM2 algorithm based on the first encryption parameter, encrypt the second encryption parameter using the second quantum key and generate a corresponding second integrity check value, and send the second encrypted data to the client; so that the client can use the second quantum key to perform integrity check and decryption on the second encrypted data to obtain the second encryption parameter, and generate a digital signature based on the second encryption parameter.

[0131] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present invention are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid state disk (SSD)).

[0132] 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, 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 limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0133] The various embodiments in this specification are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the system and device embodiments are basically similar to the method embodiments, so the descriptions are relatively simple; relevant parts can be referred to the descriptions of the method embodiments.

[0134] The foregoing has provided a detailed description of one embodiment of the present invention, but this description is merely a preferred embodiment and should not be construed as limiting the scope of the invention. All equivalent variations and modifications made within the scope of the claims of this invention should still fall within the patent coverage of this invention.

Claims

1. A system for fusing SM2 algorithm cooperative signature of quantum key distribution, characterized in that, The method comprises a client, a server and a quantum distribution QKD network, wherein: The client is configured to obtain a first quantum key and a second quantum key from a preset storage medium, generate a first encryption parameter by using an SM2 algorithm, generate a first digest of a message to be signed according to an encryption public key obtained by key negotiation between the client and the server and the first quantum key, encrypt the first encryption parameter, the message to be signed and the first digest by using the second quantum key, and generate a corresponding first integrity check value to obtain first encryption data and send the first encryption data to the server; the preset storage medium stores a plurality of quantum keys injected by the QKD network; The first encryption parameter generated by using the SM2 algorithm specifically comprises: A random number K1 between [1, n-1] is generated, and D c -1 For D c The inverse element on Fq is calculated, and Q1 = K1 D c -1 [ ]G, S1 = D c -1 (K1 D c -1 ) mod n, and Q1 and S1 are taken as the first encryption parameter; wherein Fq is a finite field, G is an n-order base point on an SM2 algorithm elliptic curve E(Fq), and n is the order of the base point G. The first digest of the message to be signed generated according to the encryption public key obtained by the key negotiation between the client and the server and the first quantum key comprises: A first intermediate parameter Z is calculated based on GB / T 32918: Z = HASH(ENTL C || ID C || ENTL S || ID S || x G || y G || x || y) Wherein, ID C and ID S are the user identification of the client and the server respectively, ENTL C and ENTL S are the identification length of the user identification, x G and y G are the coordinates of the elliptic curve G point, and x and y are the coordinates of the public key P G . A second intermediate parameter M' is calculated according to Z and the message to be signed M: M' = Z || ID key || M ID key is a key ID of the first quantum key; A first digest e of the message to be signed is obtained by performing a keyed hash operation on M' with the first quantum key: e = HMAC (M', Key1); Key1 is the first quantum key; The server is configured to obtain the first quantum key and the second quantum key from the QKD network, perform integrity check and decryption on the first encryption data by using the second quantum key to obtain the first encryption parameter, the message to be signed and the first digest, generate a second digest of the message to be signed by using the first quantum key, compare the first digest and the second digest, and if the comparison is correct, generate a second encryption parameter according to the first encryption parameter by using the SM2 algorithm, encrypt the second encryption parameter by using the second quantum key, and generate a corresponding second integrity check value to obtain second encryption data and send the second encryption data to the client; The client is further configured to perform integrity check and decryption on the second encryption data by using the second quantum key to obtain the second encryption parameter, and generate a digital signature according to the second encryption parameter.

2. A method for co-signing SM2 algorithm with quantum key distribution, characterized in that, The method is applied to a client and comprises: A first encryption parameter is generated by using an SM2 algorithm, a first quantum key is obtained from a preset storage medium, and a first digest of a message to be signed is generated according to an encryption public key obtained by key negotiation between the client and a server and the first quantum key; the preset storage medium stores a plurality of quantum keys injected by a QKD network; A second quantum key is obtained from the preset storage medium, the first encryption parameter, the message to be signed and the first digest are encrypted by using the second quantum key, and a corresponding first integrity check value is generated to obtain first encryption data; sending the first encrypted data to the server; so that the server obtains the first quantum key and the second quantum key from the QKD network, uses the second quantum key to perform integrity check and decryption on the first encrypted data to obtain the first encrypted parameter, the message to be signed, and the first digest, uses the first quantum key to generate a second digest of the message to be signed, compares the first digest and the second digest, and if they are consistent, uses an SM2 algorithm to generate a second encrypted parameter according to the first encrypted parameter, uses the second quantum key to encrypt the second encrypted parameter and generate a corresponding second integrity check value, and sends the second encrypted data to the client; using the second quantum key to perform integrity check and decryption on the second encrypted data to obtain the second encrypted parameter, and generating a digital signature according to the second encrypted parameter.

3. The method of claim 2, wherein the SM2 algorithm is a signature algorithm for quantum key distribution. Before using the SM2 algorithm to generate the first encrypted parameter, obtaining the first quantum key in a preset storage medium, and generating the first digest of the message to be signed according to the encrypted public key obtained through key negotiation between the client and the server and the first quantum key, the method further comprises: obtaining the elliptic curve parameters E(Fq), G, and n of the SM2 algorithm that are preset, the elliptic curve E is an elliptic curve defined on a finite field Fq, and G represents a base point of the order n on the elliptic curve E; generating a random number between [1, n-1], taking the generated random number as D C , calculating the first private key data P1=D C [ ]G,[ ] represents an elliptic curve point multiplication operation generation, obtaining a third quantum key in a preset storage medium, encrypting the first private key data using the third quantum key and generating a corresponding third integrity check value to obtain negotiation data; sending the negotiation data to the service end; so that the service end acquires the third quantum key through the QKD network, uses the third quantum key to perform integrity check and decryption on the negotiation data to obtain the first private key data, generates a random number between [1, n-1], and uses the generated random number as D S , calculates the public key P G =D S [ ]P1-G=(D C D S -1)[ ]G, and publishes the public key.

4. The method according to claim 3, wherein, The calculation process of the second encryption parameter is that the server generates two random numbers K2 and K3 between 1 and n-1, calculates Q2=K2 D s -1 [ ]G, Q3=K3 D s [ ]G, calculates K2 D s -1 [ ]Q1+Q3 obtains a calculation result (x1, y1), that is, (K1 K2 D c -1 D s -1 + K3 D s )[ ]G), and calculates r=x1+e mod n, wherein if r is not equal to 0, further calculation is performed on S2= D s -1 (K2 D s -1 ) mod n, S3=D s -1 (r+K3 D s ) mod n, and Q2, Q3, S2 and S3 are taken as the second encryption parameter; if r is equal to 0, the server can regenerate K2 and recalculate (x1, y1) and r until r is not equal to 0. generating a digital signature according to the second encrypted parameter comprises: K1 is calculated D c -1 [ ]Q2+Q3 to obtain a calculation result (x1, y1) (i.e. (K1 K2 D c -1 D s -1 + K3 D s [ ]G), and r = x1+e mod n is calculated, and s = (D c -1 S3 + S2 S1 -r) mod n, wherein, if s is not equal to 0 and not equal to n-r, then the data type of (r, s) is converted into a byte string according to the method of GB / T 32918 as a signature of the message M and is published externally; if s is equal to 0 or equal to n-r, then the collaborative signature is performed again.

5. A method for co-signing SM2 algorithm with quantum key distribution, characterized in that, The method is applied to the server and comprises: receiving the first encrypted data sent by the client; the generation process of the first encrypted data is as follows: the client uses an SM2 algorithm to generate a first encrypted parameter, obtains a first quantum key in a preset storage medium, generates an encrypted public key and a first digest of a message to be signed according to the first quantum key through key negotiation between the client and the server, obtains a second quantum key in the preset storage medium, uses the second quantum key to encrypt the first encrypted parameter, the message to be signed, and the first digest and generate a corresponding first integrity check value, and obtains the first encrypted data; the preset storage medium stores a plurality of quantum keys injected by a QKD network; the SM2 algorithm is used to generate the first encrypted parameter, and specifically comprises: A random number K1 between [1, n-1] is generated, and D c -1 D c The inverse element on Fq is calculated, and Q1 = K1 D c -1 [ ]G, S1 = D c -1 (K1 D c -1 ) mod n, and Q1 and S1 are taken as the first encryption parameter; wherein Fq is a finite field, G is an n-order base point on an SM2 algorithm elliptic curve E(Fq), and n is the order of the base point G. generating a first digest of a message to be signed according to an encrypted public key obtained through key negotiation between the client and the server and the first quantum key comprises: calculating a first intermediate parameter Z based on GB / T 32918: Z = HASH(ENTL C || ID C || ENTL S || ID S || x G || y G || x || y) Wherein, ID C and ID S are the user identification of the client and the server respectively, ENTL C and ENTL S are the identification length of the user identification, x G and y G are the coordinates of the elliptic curve G point, and x and y are the coordinates of the public key P G . calculating a second intermediate parameter M' according to Z and the message to be signed M: M' = Z || ID key || M ID key is a key ID of the first quantum key; performing a keyed hash operation on M' with the first quantum key to obtain the first digest e of the message to be signed: e = HMAC (M', Key1); Key1 is the first quantum key; obtaining the second quantum key from the QKD network, and using the second quantum key to perform integrity check and decryption on the first encrypted data to obtain the first encrypted parameter, the message to be signed, and the first digest; obtaining the first quantum key from the QKD network, generating a second digest of the message to be signed using the first quantum key, and comparing the first digest and the second digest; if the first digest and the second digest are consistent, generating a second encryption parameter according to the first encryption parameter using an SM2 algorithm, encrypting the second encryption parameter using the second quantum key and generating a corresponding second integrity check value to obtain second encryption data to be sent to the client; so that the client uses the second quantum key to perform integrity check and decryption on the second encryption data to obtain the second encryption parameter, and generates a digital signature according to the second encryption parameter.

6. The method according to claim 5, wherein, Before receiving the first encryption data sent by the client, the method further comprises: Receiving the negotiation data sent by the client; the generation process of the negotiation data is: the client obtains the elliptic curve parameters E(Fq), G and n of the pre-set SM2 algorithm, the elliptic curve E is defined on the finite field Fq, G represents the base point of the n-order on the elliptic curve E; a random number between [1, n-1] is generated, and the generated random number is taken as D C , the first private key data P1=D C [ ]G,[ ] represents the elliptic curve point multiplication operation generation, obtains the third quantum key in the pre-set storage medium, encrypts the first private key data using the third quantum key and generates the corresponding third integrity check value, and obtains the negotiation data; obtaining the third quantum key through the QKD network, and performing integrity check and decryption on the negotiation data using the third quantum key to obtain the first private key data; A random number between [1, n-1] is generated, and the generated random number is used as D S , a public key P G is calculated S [ ]P1-G=(D C D S -1)[ ]G, and the public key is published.

7. The method according to claim 6, wherein, The first encryption parameter generating process is that the client generates a random number K1 between [1, n-1], takes D c -1 D c The inverse element on Fq is calculated, and Q1=K1 D c -1 [ ]G, S1=D c -1 (K1 D c -1 )mod n, and Q1 and S1 are taken as the first encryption parameter; generating a second encryption parameter according to the first encryption parameter using an SM2 algorithm, comprising: Two random numbers K2 and K3 between [1, n-1] are generated, and Q2 = K2 D s -1 [ ]G, Q3 = K3 D s [ ]G, K2 is calculated D s -1 [ ]Q1 + Q3 to obtain a calculation result (x1, y1), i.e., (K1 K2 D c -1 D s -1 + K3 D s [ ]G), and r = x1 + e mod n is calculated, wherein if r is not equal to 0, S2 = D s -1 (K2 D s -1 ) mod n, S3 = D s -1 (r + K3 D s ) mod n, and Q2, Q3, S2 and S3 are taken as the second encryption parameter; if r is equal to 0, the server can regenerate K2, and (x1, y1) and r are recalculated until r is not equal to 0.

8. A device for fusing quantum key distribution and SM2 algorithm collaborative signature, characterized in that, The device is applied to a client, comprising: The data processing module is configured to generate a first encryption parameter using an SM2 algorithm, obtain a first quantum key in a preset storage medium, generate a first digest of a message to be signed according to an encryption public key obtained through key negotiation between the client and a server and the first quantum key, and the first quantum key is saved in the QKD network injected in the preset storage medium. The SM2 algorithm is used to generate a first encryption parameter, comprising: A random number K1 between [1, n-1] is generated, and D c -1 For D c The inverse element on Fq is calculated, and Q1 = K1 D c -1 [ ]G, S1 = D c -1 (K1 D c -1 ) mod n, and Q1 and S1 are taken as the first encryption parameter; wherein Fq is a finite field, G is an n-order base point on an SM2 algorithm elliptic curve E(Fq), and n is the order of the base point G. The first digest of the message to be signed is generated according to the encryption public key obtained through the key negotiation between the client and the server and the first quantum key, comprising: Calculate a first intermediate parameter Z based on GB / T 32918: Z = HASH(ENTL C || ID C || ENTL S || ID S || x G || y G || x||y) Wherein, ID C and ID S are the user identification of the client and the server respectively, ENTL C and ENTL S are the identification length of the user identification, x G and y G are the coordinates of the elliptic curve G point, and x and y are the coordinates of the public key P G . Calculate a second intermediate parameter M' according to Z and the message to be signed M: M' = Z || ID key || M ID key is a key ID of the first quantum key; Perform a keyed hash operation on M' with the first quantum key to obtain the first digest e of the message to be signed: e = HMAC (M', Key1); Key1 is the first quantum key; The encryption module is configured to obtain a second quantum key in a preset storage medium, encrypt the first encryption parameter, the message to be signed, and the first digest using the second quantum key, and generate a corresponding first integrity check value to obtain first encryption data; The data sending module is configured to send the first encryption data to the server; so that the server obtains the first quantum key and the second quantum key from the QKD network, performs integrity check and decryption on the first encryption data using the second quantum key to obtain the first encryption parameter, the message to be signed, and the first digest, generates a second digest of the message to be signed using the first quantum key, and after the first digest and the second digest are consistent, generates a second encryption parameter according to the first encryption parameter using an SM2 algorithm, encrypts the second encryption parameter using the second quantum key and generates a corresponding second integrity check value to obtain second encryption data to be sent to the client. The first collaborative signature module is configured to use the second quantum key to perform integrity check and decryption on the second encrypted data to obtain the second encrypted parameter, and generate a digital signature according to the second encrypted parameter.

9. A device for fusing quantum key distribution and SM2 algorithm collaborative signature, characterized in that, The device is applied to a server and includes: The data receiving module is configured to receive first encrypted data sent by a client; the first encrypted data is generated in the following process: the client uses an SM2 algorithm to generate a first encrypted parameter, obtains a first quantum key from a preset storage medium, generates a first digest of a message to be signed according to an encryption public key obtained through key negotiation between the client and the server and the first quantum key, obtains a second quantum key from the preset storage medium, uses the second quantum key to encrypt the first encrypted parameter, the message to be signed and the first digest to generate a corresponding first integrity check value, and obtains the first encrypted data; the preset storage medium stores a plurality of quantum keys injected by a QKD network; The SM2 algorithm is used to generate the first encrypted parameter, and the generation process includes: A random number K1 between [1, n-1] is generated, and D c -1 For D c The inverse element on Fq is calculated, and Q1 = K1 D c -1 [ ]G, S1 = D c -1 (K1 D c -1 ) mod n, and Q1 and S1 are taken as the first encryption parameter; wherein Fq is a finite field, G is an n-order base point on an SM2 algorithm elliptic curve E(Fq), and n is the order of the base point G. The encryption public key obtained through key negotiation between the client and the server and the first quantum key are used to generate a first digest of a message to be signed, and the generation process includes: A first intermediate parameter Z is calculated based on GB / T 32918: Z = HASH(ENTL C || ID C || ENTL S || ID S || x G || y G || x||y) Wherein, ID C and ID S are the user identification of the client and the server respectively, ENTL C and ENTL S are the identification length of the user identification, x G and y G are the coordinates of the elliptic curve G point, and x and y are the coordinates of the public key P G . A second intermediate parameter M' is calculated according to Z and the message to be signed M: M' = Z || ID key || M ID key is a key ID of the first quantum key; A first digest e of the message to be signed is obtained by performing a keyed hash operation on M' with the first quantum key: e = HMAC (M', Key1); Key1 is the first quantum key; The decryption module is configured to obtain the second quantum key from the QKD network, use the second quantum key to perform integrity check and decryption on the first encrypted data to obtain the first encrypted parameter, the message to be signed and the first digest; The verification module is configured to obtain the first quantum key from the QKD network, use the first quantum key to generate a second digest of the message to be signed, and compare the first digest with the second digest; The second collaborative signature module is configured to, if the first digest and the second digest are correct, use an SM2 algorithm to generate a second encrypted parameter according to the first encrypted parameter, use the second quantum key to encrypt the second encrypted parameter to generate a corresponding second integrity check value, obtain second encrypted data, and send the second encrypted data to the client; so that the client uses the second quantum key to perform integrity check and decryption on the second encrypted data to obtain the second encrypted parameter, and generates a digital signature according to the second encrypted parameter.

Citation Information

Patent Citations

  • Signing and decrypting method and system applied to cloud computing and based on SM2 algorithm

    CN104243456A

  • Two-party collaborative signature method based on SM2 algorithm for resisting energy analysis attack

    CN112422288A

  • Quantum key distribution method based on fusion of QKD network and classical cryptographic algorithm

    CN114221765A