SM2 signature method based on mobile KEY key protection technology
By using product secret splitting technology on mobile devices to split the SM2 signature private key and collaboratively calculate the signature, the problems of high computational cost and low signature efficiency in the existing technology are solved, and efficient private key protection on resource-constrained devices is achieved. and security improvements.
Patent Information
- Application Number
- CN202111273107.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-29
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2041-10-29
AI Technical Summary
The existing SM2 digital signature method based on the collaboration of two parties has high computational cost and low signature efficiency on mobile devices with limited resources, and cannot effectively protect the security of private keys.
Product secret splitting technology is used to split the SM2 signature private key into two parts. The communicating parties collaborate to calculate the signature public key and complete signature, which only involves simple multiplication operations, avoiding the use of zero-knowledge proof and homomorphic encryption technology, and reducing computing costs.
It improves the signature efficiency, enhances the security of the private key, prevents attackers from exporting the complete private key, and is suitable for mobile devices with limited resources.
Smart Images

Figure CN113918979B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of information security technology, and in particular to an SM2 signature method based on mobile KEY key protection technology. Background Art
[0002] The SM2 digital signature algorithm is an important component of the elliptic curve cryptographic algorithm standard. It is used to implement digital signatures, ensure the authenticity of identity, the integrity of data, and the non-repudiation of behavior. It is the core technology and basic support for cyberspace security. It has now become an ISO / IEC international standard and has been widely used in domestic commercial encryption applications for many years.
[0003] In recent years, with the improvement of mobile Internet and the rapid popularization of smart terminals, traditional Internet applications have been continuously extended and developed into the wireless field. Mobile applications are changing people's living habits in all aspects, and the implementation of many applications will be completed on mobile terminals. However, while applications such as mobile payment and mobile office bring great convenience to users, security issues are also becoming increasingly prominent. For example, when performing identity authentication, digital signatures are a major technical means, but if the signature private key is stored intact on the mobile smart terminal, attackers may use various attack methods to export the signature private key from the mobile smart terminal, thereby causing the insecurity of the entire system.
[0004] In order to improve the security of private keys, Chinese patent CN108667626A discloses an SM2 digital signature method based on two-party collaboration. However, since this method uses zero-knowledge proof, homomorphic encryption and other technologies in the collaborative signature process, it has a high computational cost and low signature efficiency, and is not suitable for resource-constrained mobile devices. Summary of the invention
[0005] The purpose of the present invention is to provide an SM2 signature method based on mobile KEY key protection technology, which adopts product secret splitting technology, has low computational cost, improves signature efficiency, and can be applied to resource-constrained mobile devices, thereby overcoming the problem that the existing SM2 digital signature method based on two-party collaboration cannot be applied to resource-constrained mobile devices due to high computational cost and low signature efficiency.
[0006] The technical solution of the present invention is to provide an SM2 signature method based on mobile KEY key protection technology, which is special in that it includes the following steps:
[0007] Step 1: System initialization;
[0008] The first communication party and the second communication party share the elliptic curve parameter E(F) of the SM2 algorithm. p ), G and n, the elliptic curve E is defined in the finite field F pThe elliptic curve on G represents the base point of order n on the elliptic curve E, n is a finite positive integer, and the values of each parameter are pre-set according to the SM2 algorithm;
[0009] Step 2: Generate secret key;
[0010] The first communication party generates a child private key d 1 and the child public key P 1 , the second communication party generates a sub-private key d 2 and the child public key P 2 , the first communication party uses the second communication party's sub-public key P 2 and its own child private key d 1 Negotiate the signature public key P, and the second communication party uses the sub-public key P of the first communication party 1 and its own child private key d 2 Negotiate signature public key P;
[0011] Step 3: Collaborative signature;
[0012] The first communication party generates a temporary sub-private key k 1 and temporary child public key Q 1 ; The second communication party generates a temporary sub-private key k 2 and temporary child public key Q 2 ;
[0013] The first communication party and the second communication party collaborate to generate a complete signature (r, s) based on the message to be signed M, the other party's temporary sub-public key, their own sub-private key and their own temporary sub-private key respectively;
[0014] Step 4: Output the complete signature;
[0015] The first communicating party outputs (r,s) as the complete signature.
[0016] Furthermore, step 2 specifically includes the following steps:
[0017] Step 2.1: The first communication party generates a sub-private key d 1 and the child public key P 1 ;
[0018] The first communication party generates a random number d between [1, n-1] 1 , d 1 As a child private key, there are: d 1 ∈[1,n-1], calculate d 1 [*]G, the calculation result is used as the sub-public key P 1 ; Where [*] represents the elliptic curve point multiplication operation;
[0019] Step 2.2: The second communication party generates a sub-private key d 2 and the child public key P2 ;
[0020] The second communication party generates a random number d between [1, n-1] 2 , d 2 As the child private key, calculate d 2 [*]G, the calculation result is used as the sub-public key P 2 ;
[0021] Step 2.3: The first communication party uses the second communication party's sub-public key P 2 and its own child private key d 1 Negotiate the signature public key P, and the second communication party uses the sub-public key P of the first communication party 1 and its own child private key d 2 Negotiate signature public key P;
[0022] The first communication party calculates d 1 [*]P 2 [-]G, the calculation result is used as the signature public key P, where [-] represents the elliptic curve point subtraction operation;
[0023] The second communication party calculates d 2 [*]P 1 [-]G, and use the result as the signature public key P.
[0024] Furthermore, step 3 specifically includes the following steps:
[0025] Step 3.1, the first communication party processes the message to be signed;
[0026] The first communication party concatenates the common identity Z of the first communication party and the second communication party and the message M to form M′, calculates hash(M′), and uses the calculation result as e;
[0027] Step 3.2, the second communication party processes the message to be signed;
[0028] The second communication party concatenates the common identity Z of the second communication party and the first communication party and the message M to form M′, calculates hash(M′), and uses the calculation result as e;
[0029] Step 3.3: The first communication party generates a temporary sub-private key k 1 and temporary child public key Q 1 ;
[0030] The first communication party generates a random number k between [1, n-1] 1 , k 1 As a temporary child private key, calculate k 1 [*]G, use the calculation result as the temporary sub-public key Q 1 , and Q 1Sending to a second communication party;
[0031] Step 3.4: The second communication party generates a temporary sub-private key k 2 and temporary child public key Q 2 ;
[0032] The second communication party generates a random number k between [1, n-1] 2 , k 2 As a temporary child private key, calculate k 2 [*]G, use the calculation result as the temporary sub-public key Q 2 , and Q 2 Sending to the first communication party;
[0033] Step 3.5: The first communication party and the second communication party collaborate to sign;
[0034] Step 3.51: The second communication party calculates k 2 [*]Q 1 , and the calculation result (x 1 ,y 1 );
[0035] Step 3.52: The second communication party calculates (x 1 +e)mod n, the calculation result is r, where mod represents the modulus operation;
[0036] Step 3.53: The second communication party generates a random number between [1, n] and uses the generated random number as k 3 , and calculate and The calculation results are respectively used as c 1 and c 2 , where r is the result of step 3.52; c 1 Sent to the first communication party, wherein, Indicates d 2 In F p The inverse element on;
[0037] Step 3.54: The first communication party calculates k 1 [*]Q 2 , and the calculation result (x 1 ,y 1 );
[0038] Step 3.55: The first communication party calculates (x 1 +e)mod n, and use the result as r;
[0039] Step 3.56: The first communication party calculates The result of the calculation is taken as s 1 , where r is the result of step 3.55; send s 1 To a second communication party; wherein, Indicates d 1 In F p The inverse element on;
[0040] Step 3.57: The second communication party calculates The result of the calculation is taken as s 2 ; Send 2 and c 2 to the first communication party;
[0041] Step 3.58: The first communication party calculates Get the partial signature s, (r, s) constitute the complete signature.
[0042] The beneficial effects of the present invention are:
[0043] 1. The present invention splits the SM2 signature private key into two parts, which are kept by the first communication party and the second communication party respectively. In the key generation stage and the collaborative signature stage, the communication parties need to collaborate to calculate to generate the signature public key and the complete SM2 signature. No party can obtain the complete private key and output a complete signature alone. This can prevent attackers from exporting the complete private key, and the private key security is relatively high.
[0044] 2. The present invention adopts the product secret splitting technology in the collaborative signature process. This technology only involves simple multiplication operations in the calculation process, and does not use zero-knowledge proof and homomorphic encryption technology, which greatly saves computing costs and improves signature efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 It is a flow chart of the SM2 signature method based on the mobile KEY key protection technology in the embodiment.
[0046] Figure 2 Schematic diagram of the key generation process in the embodiment.
[0047] Figure 3 Schematic diagram of the collaborative signature process in the embodiment. DETAILED DESCRIPTION
[0048] In order to make the above-mentioned purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are described in detail below in conjunction with the drawings of the specification. Obviously, the described embodiments are part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary persons in the art without creative work should fall within the scope of protection of the present invention.
[0049] In the following description, many specific details are set forth to facilitate a full understanding of the present invention, but the present invention may also be implemented in other ways different from those described herein, and those skilled in the art may make similar generalizations without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.
[0050] For ease of description, this embodiment uses a first communication party and a second communication party to represent the two communication parties, wherein the first communication party is a mobile terminal and the second communication party is a server.
[0051] Figure 1 FIG. 4 is a flow chart of the SM2 signature method based on the mobile KEY key protection technology of this embodiment. Figure 1 As shown, it mainly includes the steps of system initialization, key generation, collaborative signature and output of complete signature. The following is a detailed description of each step:
[0052] Step 1: System initialization;
[0053] The first communication party and the second communication party share a finite field F p The elliptic curve on 2 =x 3 +ax+b(a,b∈F p ,4a 3 +27b 2 ≠0), the specific values of the parameters p, a, b of the curve are the same as the values of the parameters in Appendix A.2 of GB / T 32918.2-2016. The communicating parties agree in advance that the cryptographic hash algorithm to be used is the cryptographic hash algorithm given in GB / T 32905-2016, that is, the SM3 algorithm.
[0054] Step 2: Generate key;
[0055] Combination Figure 2 , it can be seen that in the key generation phase, it mainly consists of the following three steps:
[0056] Step 2.1: The first communication party generates a sub-public key P 1 and child private key d 1 ;
[0057] The first communication party generates a random number d between [1, n-1] 1 , d 1 As the child private key, calculate d 1 [*]G, and use the result as the child public key P 1 ;
[0058] Step 2.2: The second communication party generates a sub-public key P 2and child private key d 2 ;
[0059] The second communication party generates a random number d between [1, n-1] 2 , d 2 As the child private key, calculate d 2 [*]G, the calculation result is used as the sub-public key P 2 ;
[0060] Step 2.3: The first communication party uses the sub-public key P 2 and child private key d 1 Calculate the signature public key P = d 1 [*]P 2 [-]G, the second communication party uses the sub-public key P 1 and child private key d 2 Calculate the signature public key P = d 2 [*]P 1 [-]G.
[0061] Step 3: Collaborative signature;
[0062] In the collaborative signature phase, the first communication generates a temporary sub-public key Q 1 and temporary child private key k 1 , the second communication party generates a temporary public-private key pair Q 2 and temporary child private key k 2 , the two communicating parties respectively use the message to be signed M, their own temporary sub-private key and sub-private key, and the other party's temporary sub-public key to collaborate to produce a complete signature (r, s). The specific process of collaborative signature is shown in Figure 3 As shown:
[0063] Step 3.1, the first communication party processes the message to be signed;
[0064] The first communication party concatenates the common identity Z of the first communication party and the second communication party and the message M to form M′, calculates SM3(M′), and uses the calculation result as e;
[0065] Step 3.2, the second communication party processes the message to be signed;
[0066] The second communication party processes the message to be signed in the same way as the first communication party processes the message to be signed;
[0067] Step 3.3, the first communication party generates a temporary sub-public-private key pair;
[0068] The first communication party generates a random number k between [1, n-1] 1 , k 1 As a temporary child private key, calculate k 1 [*]G, use the calculation result as the temporary sub-public key Q 1; and Q 1 Sending to a second communication party;
[0069] Step 3.4, the second communication party generates a temporary sub-public-private key pair;
[0070] The second communication party generates a random number k between [1, n-1] 2 , k 2 As a temporary child private key, calculate k 2 [*]G, use the calculation result as the temporary sub-public key Q 2 , and Q 2 Sending to the first communication party;
[0071] Step 3.5, both parties of communication collaborate to sign;
[0072] The second communication party calculates k 2 [*]Q 1 , and the calculation result (x 1 ,y 1 ), calculate (x 1 +e)mod n, and use the calculation result as r, where mod represents the modulus operation; generate a random number between [1,n], and use the generated random number as k 3 , and calculate and The calculation results are respectively used as c 1 and c 2 ; c 1 Sent to the first communication party, wherein, Indicates d 2 In F p The inverse element on;
[0073] The first communication party calculates k 1 [*]Q 2 , and the calculation result (x 1 ,y 1 ), and calculate (x 1 +e)mod n, and use the result as r; calculate The result of the calculation is taken as s 1 ; Send 1 To a second communication party; wherein, Indicates d 1 In F p The inverse element on;
[0074] Second communication party calculation The result of the calculation is taken as s 2 ; Send 2 and c 2 to the first communication party;
[0075] First communication party calculation Get partial signature s.
[0076] Step 4: Output the complete signature;
[0077] The first communicating party outputs (r,s) as the complete signature.
[0078] In summary, the above embodiments are only used to illustrate the present invention, rather than to limit the technical solutions described in the present invention; therefore, although this specification has described the present invention in detail with reference to the above embodiments, those skilled in the art should understand that the present invention can still be modified or replaced by equivalents; and all technical solutions and improvements thereof that do not depart from the spirit and scope of the present invention should be included in the scope of the claims of the present invention.
Claims
1. An SM2 signature method based on mobile KEY key protection technology, characterized in that: The following steps are involved: Step 1: System initialization; The first communication party and the second communication party share the elliptic curve parameter E(F) of the SM2 algorithm. p ), G and n, the elliptic curve E is defined in the finite field F p The elliptic curve on G represents the base point of order n on the elliptic curve E, n is a finite positive integer, and the values of each parameter are pre-set according to the SM2 algorithm; Step 2: Generate secret key; The first communication party generates a sub-private key d1 and a sub-public key P1; the second communication party generates a sub-private key d2 and a sub-public key P2; the first communication party uses the second communication party's sub-public key P2 and its own sub-private key d1 to negotiate the signature public key P, and the second communication party uses the first communication party's sub-public key P1 and its own sub-private key d2 to negotiate the signature public key P; Step 3: Collaborative signature; The first communication party generates a temporary sub-private key k1 and a temporary sub-public key Q1; the second communication party generates a temporary sub-private key k2 and a temporary sub-public key Q2; The first communication party and the second communication party collaborate to generate a complete signature (r, s) based on the message to be signed M, the other party's temporary sub-public key, their own sub-private key and their own temporary sub-private key respectively; Specifically include: Step 3.1, the first communication party processes the message to be signed; The first communication party concatenates the common identity Z of the first communication party and the second communication party and the message M to form M′, calculates hash(M′), and uses the calculation result as e; Step 3.2, the second communication party processes the message to be signed; The second communication party concatenates the common identity Z of the second communication party and the first communication party and the message M to form M′, calculates hash(M′), and uses the calculation result as e; Step 3.3, the first communication party generates a temporary sub-private key k1 and a temporary sub-public key Q1; The first communication party generates a random number k1 between [1, n-1], uses k1 as a temporary sub-private key, calculates k1[*]G, uses the calculation result as a temporary sub-public key Q1, and sends Q1 to the second communication party; Step 3.4, the second communication party generates a temporary sub-private key k2 and a temporary sub-public key Q2; The second communication party generates a random number k2 between [1, n-1], uses k2 as a temporary sub-private key, calculates k2[*]G, uses the calculation result as a temporary sub-public key Q2, and sends Q2 to the first communication party; Step 3.5: The first communication party and the second communication party collaborate to sign; Step 3.51, the second communication party calculates k2[*]Q1 and obtains the calculation result (x1, y1); Step 3.52: The second communication party calculates (x1+e)modn according to the calculation results of step 3.2 and step 3.51, and uses the calculation result as r, where mod represents a modulo operation; Step 3.53: The second communication party generates a random number between [1,n], uses the generated random number as k3, and calculates and The calculation results are respectively used as c1 and c2, where r is the calculation result of step 3.52; c1 is sent to the first communication party, where, Indicates that d2 is in F p The inverse element on; Step 3.54, the first communication party calculates k1[*]Q2 and obtains the calculation result (x1, y1); Step 3.55: The first communication party calculates (x1+e)modn according to the calculation results of step 3.1 and step 3.54, and uses the calculation result as r; Step 3.56: The first communication party calculates The calculation result is taken as s1, where r is the calculation result of step 3.55; s1 is sent to the second communication party; wherein, Indicates that d1 is in F p The inverse element on; Step 3.57: The second communication party calculates The calculation result is taken as s2; s2 and c2 are sent to the first communication party; Step 3.58: The first communication party calculates Get the partial signature s, (r, s) constitutes the complete signature; Step 4: Output the complete signature; The first communicating party outputs (r,s) as the complete signature.
2. The SM2 signature method based on mobile KEY key protection technology according to claim 1 is characterized in that: Step 2 specifically includes the following steps: Step 2.1, the first communication party generates a sub-private key d1 and a sub-public key P1; The first communication party generates a random number d1 between [1, n-1], uses d1 as the child private key, that is, d1∈[1, n-1], calculates d1[*]G, and uses the calculation result as the child public key P1; where [*] represents the elliptic curve point multiplication operation; Step 2.2, the second communication party generates a sub-private key d2 and a sub-public key P2; The second communication party generates a random number d2 between [1, n-1], uses d2 as the child private key, calculates d2[*]G, and uses the calculation result as the child public key P2; Step 2.3, the first communication party uses the second communication party's sub-public key P2 and its own sub-private key d1 to negotiate the signature public key P, and the second communication party uses the first communication party's sub-public key P1 and its own sub-private key d2 to negotiate the signature public key P; The first communication party calculates d1[*]P2[-]G and uses the calculation result as the signature public key P, where [-] represents the elliptic curve point subtraction operation; The second communication party calculates d2[*]P1[-]G and uses the result as the signature public key P.
