Key generation method and related method, computer device and storage medium
By using the collaborative work of the communicating party and the key generation center in the SM9 identification cryptographic algorithm to separate and store the user signature key, the problem of user signature key generation control and security is solved, and the cloud computing and mobile Internet environments are realized. safe storage and use.
Patent Information
- Application Number
- CN202211241724.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-11
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2042-10-11
AI Technical Summary
In the SM9 identification cryptographic algorithm, users cannot control the generation of user signature keys, which affects their security. Especially in cloud environments and mobile Internet environments, users need to use hardware devices such as USBKey for safe storage and use, causing inconvenience.
The first communicating party and the second communicating party cooperate with the first key generation center and the second key generation center to generate the user's signature private key and the user's signature master public key, and split the user's encrypted private key into multiple Parts are stored separately in the communicating party and the key generation center, ensuring that no party can calculate or obtain the complete signature private key alone.
It realizes the safe storage and use of user signature keys, avoids the control of signature keys by a single key generation center, ensures the security of signature keys and user control, and is suitable for cloud computing and mobile Internet environments.
Smart Images

Figure CN115549904B
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of data security technology, and in particular relates to a key generation method for a signature key of an SM9 user and related methods, computer equipment and storage medium. Background Art
[0002] The SM9 identity cryptographic algorithm is an identity-based cryptographic algorithm released by the National Cryptography Administration in 2016. The SM9 identity cryptographic algorithm uses the user identity as the public key for the user's signature, and the user's private key is generated by the Key Generation Center (KGC) based on the user identity and the master private key generated by the KGC. Since the user identity is used as the user's signature public key, compared with the traditional certificate-based Public Key Infrastructure (PKI) system, the SM9 identity cryptographic algorithm has been simplified in the certificate management link.
[0003] The SM9 identification cryptographic algorithm includes digital signature, key exchange, key encapsulation, and encryption and decryption algorithms. Among them, the user signature key is generated by KGC based on the user identity and KGC's signature master private key. Therefore, KGC is responsible for the generation of user signature keys in the entire system. The problem with the above technology is that the user cannot control the generation of the user signature key, which in turn affects the security of the user signature key.
[0004] Although the use of dual KGC allows users to control the generation of user signature keys, thus solving the security problem of a single KGC that controls the signature keys of all users, in cloud environments and mobile Internet environments, users need to use hardware devices such as USBKey to safely store and use user signature keys on mobile devices, which brings inconvenience to users. Summary of the invention
[0005] In order to solve the above problem, the present invention provides a key generation method.
[0006] The key generation method provided by the present invention comprises the following steps:
[0007] 1. Generate system parameters;
[0008] 2. Based on the system parameters, the first communication party and the second communication party work together to generate a user signature private key ds A , the user signs the master public key and encrypts and sends the user's encrypted private key A .
[0009] further,
[0010] The step 1 comprises the following steps:
[0011] S1. Generate a first system parameter through a first key generation center KGC1, and generate a second system parameter through a second key generation center KGC2,
[0012] in,
[0013] The first system parameters include a first signature master private key ks1 and a first signature master public key P pubs1 , and the first encryption master private key ke1 and the first encryption master public key P pube1 ,
[0014] The first signature master private key ks1 is a random integer, and ks1∈[1, N-1], where N is a prime number. Assuming that group G2 is an additive cyclic group of order N, then the first signature master public key P pubs1 is an element of group G2 and satisfies
[0015] P pubs1 =[ks1]×P2 (1),
[0016] The first encryption master private key ke1 is a random integer, and ke1∈[1, N-1]. Assuming that group G1 is an additive cyclic group of order N, then the first encryption master public key P pube1 is an element of group G1 and satisfies
[0017] P pube1 =[ke1]×P1 (2),
[0018] In formulas (1) and (2), P1 is the generator of group G1, P2 is the generator of group G2, and the meaning of square brackets [] represents the doubling operation on the elliptic curve. The meaning of square brackets [] in the following equations is the same as that of square brackets [] in formula (1).
[0019] The second system parameters include a second signature master private key ks2 and a second signature master public key P pubs2 , the second signature master private key ks2 is a random integer, and ks2∈[1,N-1], and satisfies
[0020] P pubs2 =[ks2]×P2 (3);
[0021] S2. The first key generation center KGC1 and the second key generation center KGC2 respectively calculate the public master key P pubs ,
[0022] in
[0023] The first key generation center KGC1 calculates P pubs =[ks1]×P pubs2 ,
[0024] The second key generation center KGC2 calculates P pubs =[ks2]×P pubs1 ;
[0025] S3. Select a public parameter α, wherein the public parameter α is a quadratic non-residue modulo N;
[0026] S4. The first signature master public key P pubs1 , the first encryption master public key P pube1 , the second signature master public key P pubs2 , public master key P pubs and the public parameter α is publicly released,
[0027] The second step includes: calculating
[0028] h1=H1(ID A ||hid,N)
[0029] Among them, H1(ID A ||hid, N) is the first cryptographic function, ID A is the user identifier, || means merging the byte strings of the data, hid is the function identifier,
[0030] If h1 is the square element of modulus N, use method AA to generate the first part of the user signature private key ds A1 、The second part is the user signature private key ds A2 , the first user signature master public key P pubsA And encrypt and send the user's encrypted private key A , and the user encrypts the private key de A Split into the first part, the user's encrypted private key A1 、The second part is the user's encrypted private key A2 , the first user signature master public key P pubsA That is, the user's signature master public key;
[0031] If h1 is not the square element of modulus N, use method BB to generate the third part of the user signature private key ds AA1 、Part 4 User signature private key ds AA2 , the second user signature master public key P pubsAA And encrypt and send the user's encrypted private key A , and the user encrypts the private key de A Split into the third part, the user's encrypted private key AA1 、Part 4 User Encrypted Private Key AA2 , the second user signature master public key P pubsAA That is, the user's signature master public key.
[0032] further,
[0033] In the method AA, h1 is the square element modulo N, that is, h1≡(h 2 )mod N, ≡ is the congruence sign, where x mod y represents the remainder operation of x on y, and let h be h 2 The larger of the two square roots, the method AA comprises the steps of:
[0034] A1. The first communication party sends a collaborative key generation application to the second communication party;
[0035] A2. The second communication party generates a first random number ds of 256 bits A2 ,ds A2 ∈[1, N-1], by P'1=[(ds A2 ) -1 mod N]×P1 calculates the first data P'1, sends the first data P'1 to the first communication party, and the second communication party saves the first random number ds A2 A second part of the user signature private key as the second communication party;
[0036] A3. The first communication party generates a 256-bit second random number r A , r A ∈[1, N-1], by Q = [r A ]×P'1 calculates the second data Q, and the first communication direction sends the first data P'1, the second data Q and the user identification ID to the first key generation center KGC1. A ;
[0037] A4. The first key generation center KGC1 receives the first data P'1, the second data Q and the user identification ID A After that, the first user signature key generation data and the user encryption private key de are calculated. A , the first user signature key generation data includes s and T;
[0038] A5. The first communication direction sends T in the first user signature key generation data to the second key generation center KGC2. The second key generation center KGC2 receives
[0039] R=[(h+ks2) -1 mod N]×T
[0040] Calculate R and send R to the first communication party;
[0041] A6. The first communication party is
[0042] dsA1 =P'1-[(r A -1 ×h1×s)mod N]×R
[0043] Calculate and obtain the first part of the user signature private key ds of the first communication party A1 ;
[0044] A7, the first communication party and the second communication party are respectively
[0045] P pubsA =[h]×(P pubs1 +P pubs2 )+P pubs
[0046] Calculate the first user signature master public key P pubsA , the first user signature master public key P pubsA That is, the user's signature master public key;
[0047] A8. The first communication party randomly generates a second random integer d1∈[1, N-1], and calculates D1=[d1]×P2 and de A1 =D1+N deA , then send the first private key coordinate encrypted data E and D1 to the second communication party, and save de A1 A first partial user encryption private key as the first communication party;
[0048] A9, the second communication party uses
[0049] S'=[(ds A2 ) -1 mod N]×P pube1
[0050] Calculate S', and set the coordinates of S' to (x S’ ,y S’ ), and x S’ ,y S’ Convert to a byte string and calculate k'=KDF(x S’ ||y S’ , 128), where KDF is a key derivation function and k' is a 128-bit byte string;
[0051] A10. The second communication party decrypts the first private key coordinate encrypted data E to obtain a byte string: x de’A ||y de’A =SM4_DEC(k',E), convert the byte string x de’A ||y de’A Convert to domain elements to get the noised first user encrypted private key de' A, where SM4_DEC(k', E) means using the SM4 decryption algorithm and the 128-bit key k' to decrypt the ciphertext E and output the plaintext;
[0052] A11. The second communication party uses
[0053] de A2 =de' A -D1
[0054] Calculate the second part of the user encryption private key of the second communication party de A2 and save it.
[0055] further,
[0056] In step A4, the calculation includes the following steps:
[0057] A41, the first key generation center KGC1 generates a 256-bit first random integer r, r∈[1,N-1], by
[0058] s=(r×(h+ks1) -1 )mod N
[0059] and T = [r -1 mod N]×Q
[0060] Calculate and obtain the first user signature key generation data s and T;
[0061] A42, the first key generation center KGC1 uses the first encryption master private key ke1 and the user identification ID A ,use
[0062] t1=H1(ID A ||hid,N)+ke1,
[0063] t2=(ke1×t1 -1 )mod N,
[0064] de A =[t2]×P2,
[0065] Calculate the user's encrypted private key de A ;
[0066] A43. The first key generation center KGC1 generates a first random point N on G2. deA , and N deA Not equal to the user's encrypted private key A , and calculate the noised first user encrypted private key de' A :
[0067] de'A =de A -N deA ;
[0068] A44. The first key generation center KGC1 calculates S=[ke1]×P'1, assuming that the coordinates of S are (x S ,y S ), and x S ,y S Convert to a byte string and calculate k = KDF(x S ||y S , 128), wherein KDF is the key derivation function and k is a 128-bit byte string;
[0069] A45, set the noise first user encryption private key de' A The coordinates of (x de'A ,y de'A ), the first key generation center KGC1 converts x de'A ,y de'A Convert to the first coordinate byte string, and encrypt the first coordinate byte string to obtain the first private key coordinate encrypted data E:
[0070] E=SM4_ENC(k,x de'A ||y de'A ),
[0071] Among them, SM4_ENC(k, x de'A ||y de'A ) indicates that the SM4 encryption algorithm and the 128-bit key k are used to encrypt the plaintext x de'A ||y de'A Perform encryption calculation and output ciphertext;
[0072] A46, the first key generation center KGC1 generates the first user signature key data s and T, the first private key coordinate encryption data E and the first random point N deA sent to the first communication party,
[0073] The first part of the user signature private key ds A1 And the second part of the user signature private key ds A2 , satisfying the relationship:
[0074] [ds A2 ]×ds A1 =ds A ,
[0075] The first part of the user's encrypted private key is A1 And the second part of the user's encrypted private key A2 Satisfaction relationship:
[0076] de A =de A1 +de A2 .
[0077] further,
[0078] In the method BB, h1 is a non-square element modulo N, then αh1 is a square element modulo N, that is, αh1≡(hh 2 )mod N, and let hh be hh 2 The larger of the two square roots, the method BB comprises the steps of:
[0079] B1. The first communication party sends a collaborative key generation application to the second communication party;
[0080] B2. The second communication party generates a third random number ds of 256 bits. AA2 ,ds AA2 ∈[1, N-1], by PP'1=[(ds AA2 ) -1 mod N]×P1 calculates the third data PP'1, and sends the third data PP'1 to the first communication party, and the second communication party saves the third random number ds AA2 A fourth part of the user signature private key as the second communication party;
[0081] B3. The first communication party generates a fourth random number rr of 256 bits A ,rr A ∈[1, N-1], by QQ=[rr A ]×PP'1 calculates the fourth data QQ, and the first communication direction sends the third data PP'1, the fourth data QQ and the user identification ID to the first key generation center KGC1. A ;
[0082] B4. The first key generation center KGC1 receives the third data PP'1, the fourth data QQ and the user identification ID A After that, calculate the second user signature key generation data (ss and TT) and the user encryption private key de A , the second user signature key generation data includes ss and TT;
[0083] B5. The first communication direction sends TT in the second user signature key generation data to the second key generation center KGC2. The second key generation center KGC2 receives
[0084] RR=[(hh+ks2) -1 mod N]×TT
[0085] Calculate and obtain the RR, and send the RR to the first communication party;
[0086] B6. The first communication party is
[0087] ds AA1 =PP'1-[(rr A -1 ×h1×α×ss)mod N]×RR
[0088] Calculate the third part of the user signature private key ds of the first communication party AA1 ;
[0089] B7. The first communication party and the second communication party are respectively
[0090] P pubsAA =[(α -1 )mod N]×([hh]×(P pubs1 +P pubs2 )+P pubs )
[0091] Calculate the second user signature master public key P pubsAA , the second user signature master public key P pubsAA That is, the user's signature master public key;
[0092] B8. The first communication party generates a fourth random integer dd1∈[1,N-1], and calculates DD1=[dd1]×P2 and de AA1 =DD1+NN deA , send the second private key coordinate encrypted data EE and DD1 to the second communication party, and save de AA1 A third part of a user encryption private key as the first communication party;
[0093] B9, the second communication party uses
[0094] SS'=[(ds AA2 ) -1 mod N]×P pube1
[0095] Calculate SS', and set the coordinates of SS' to (x SS’ ,y SS’ ), and x SS’ ,y SS’ Convert to a byte string and calculate kk'=KDF(x SS’ ||y SS’ , 128), where KDF is a key derivation function and kk' is a 128-bit byte string;
[0096] B10. The second communication party decrypts the second private key coordinate encrypted data EE to obtain a byte string: x de’AA ||y de’AA =SM4_DEC(kk',EE), convert the byte string x de’AA ||y de’AA Convert to domain elements to get the noised second user encrypted private key de' AA , where SM4_DEC(kk', EE) means using the SM4 decryption algorithm and the 128-bit key kk' to decrypt the ciphertext EE and output the plaintext;
[0097] B11, the second communication party uses
[0098] de AA2 =de' AA -DD1
[0099] Calculate the fourth part of the user encryption private key of the second communication party de AA2 and save it.
[0100] further,
[0101] In step B4, the calculation includes the following steps:
[0102] B41. The first key generation center KGC1 generates a third random integer rr of 256 bits, rr∈[1, N-1], and
[0103] ss=(rr×(hh+ks1) -1 )mod N
[0104] and TT = [rr -1 mod N]×QQ
[0105] Calculate and obtain the second user signature key generation data ss and TT;
[0106] B42, the first key generation center KGC1 uses the first encryption master private key ke1 and the user identification ID A ,use
[0107] t1=H1(ID A ||hid,N)+ke1,
[0108] t2=(ke1×t1 -1 )mod N,
[0109] de A =[t2]×P2,
[0110] Calculate the user's encrypted private key de A ,
[0111] B43. The first key generation center KGC1 generates a second random point NN on G2. deA , and NN deA Not equal to the user's encrypted private key A , and calculate the noise-encrypted second user encryption private key de' AA :de' AA =de A -NN deA ;
[0112] B44. The first key generation center KGC1 calculates SS = [ke1] × PP'1, assuming that the coordinates of SS are (x SS ,y SS ), and x SS ,y SS Convert to a byte string and calculate kk = KDF(x SS ||y SS , 128), wherein KDF is the key derivation function, and kk is a 128-bit byte string;
[0113] B45, set the noise second user encryption private key de' AA The coordinates of (x de'AA ,y de'AA ), the first key generation center KGC1 converts x de'AA ,y de'AA Convert to the second coordinate byte string, and encrypt the second coordinate byte string to obtain the second private key coordinate encrypted data EE:
[0114] EE = SM4_ENC(kk, x de'AA ||y de'AA ),
[0115] Among them, SM4_ENC(kk, x de'AA ||y de'AA ) indicates that the SM4 encryption algorithm and the 128-bit key kk are used to encrypt the plaintext x de'AA ||y de'AA Perform encryption calculation and output ciphertext;
[0116] B46, the first key generation center KGC1 generates the second user signature key generation data ss and TT, the second private key coordinate encryption data EE and the second random point NN deA sent to the first communication party,
[0117] The third part of the user signature private key ds AA1 And the fourth part of the user signature private key ds AA2 Satisfaction relationship:
[0118] [ds AA2 ]×ds AA1 =ds A ,
[0119] The third part of the user encryption private key is AA1 And the fourth part of the user encrypted private key AA2 Satisfaction relationship:
[0120] de A =de AA1 +de AA2 .
[0121] The present invention also provides a digital signature calculation method, wherein:
[0122] Let user ID be A , and assume that the original message to be signed is m, using h1=H1(ID A ||hid, N) to calculate h1, where H1 is the first cryptographic function, || means merging the byte strings of the data, hid is the function identifier, and N is a prime number.
[0123] If h1 is the square element of modulus N, the above key generation method is used to obtain the first part of the user signature private key ds A1 And the second part of the user signature private key ds A2 , then perform method CC,
[0124] or
[0125] If h1 is not the square element of modulus N, the above key generation method is used to obtain the third part of the user signature private key ds AA1 And the fourth part of the user signature private key ds AA2 , then proceed to method DD,
[0126] The method CC comprises the following steps:
[0127] CC1, the first communication party generates a fifth random integer k1 of 256 bits, k1∈[1,N-1], and calculates u=e(P1,P pubsA ) k1 , and the u, the original message to be signed m and the user ID A Sent to the second communication party, where G1 is an additive cyclic group of order N, G2 is an additive cyclic group of order N, G T is a multiplicative cyclic group of order N, then e is the number of operations from G1×G2 to G T The bilinear pairing of P1 is a generator of the group G1, P pubsA Sign the master public key for the first user;
[0128] CC2, the second communication party generates a 256-bit sixth random integer k2 and a seventh random integer k3, where k2∈[1, N-1], k3∈[1, N-1], and then calculates w=u k2 ×e(P1,P pubsA ) k3 ;
[0129] CC3, the second communication party calculates hhh = H2(m||w, N), s1 = (k2×ds A2 )mod N,s2=((k3-hhh)×ds A2 ) mod N, then, the second communication party sends hhh, s1 and s2 to the first communication party, where H2 is a second cryptographic function, and x mod y represents a remainder operation of x on y;
[0130] CC4, the first communication party uses
[0131] S=[k1×s1+s2]×ds A1
[0132] Calculate S and output the digital signature (hhh, S);
[0133] The method DD comprises the following steps:
[0134] DD1. The first communication party generates an eighth random integer kk1 of 256 bits, kk1∈[1,N-1], and calculates uu=e(P1,P pubsAA ) kk1 , and the uu, the original message to be signed m and the user ID A Sent to the second communication party, where G1 is an additive cyclic group of order N, G2 is an additive cyclic group of order N, G T is a multiplicative cyclic group of order N, then e is the number of operations from G1×G2 to G T The bilinear pairing of P1 is a generator of the group G1, P pubsAA Sign the master public key for the second user;
[0135] DD2. The second communication party generates a 256-bit ninth random integer kk2 and a tenth random integer kk3, where kk2∈[1, N-1], kk3∈[1, N-1], and then calculates ww=uu kk2 ×e(P1,P pubsAA ) kk3 ;
[0136] DD3. The second communication party calculates hhhh=H2(m||ww, N), ss1=(kk2×ds AA2 )mod N, ss2=((kk3-hhhh)×dsAA2 ) mod N, then, the second communication party sends hhhh, ss1 and ss2 to the first communication party, where H2 is a second cryptographic function, and x mod y represents a remainder operation of x on y;
[0137] DD4. The first communication party uses
[0138] SS=[kk1×ss1+ss2]×ds AA1
[0139] Calculate SS and output the digital signature (hhhh, SS).
[0140] The present invention also provides a digital signature verification method, wherein:
[0141] Using h1=H1(ID A ||hid, N) to calculate h1, H1 is the first cryptographic function, || means merging the byte strings of the data, hid is the function identifier, N is a prime number,
[0142] If h1 is the square element of modulus N, the above key generation method is used to obtain the first user signature master public key P pubsA , and then the first communication party uses the first user signature master public key P pubsA , function identifier hid, user ID A , message m and digital signature sig are input parameters for digital signature verification.
[0143] or
[0144] If h1 is not the square element of modulus N, the above key generation method is used to obtain the second user signature master public key P pubsAA , and then the first communication party uses the second user's signature master public key P pubsAA , function identifier hid, user ID A , message m and digital signature sig are input parameters for digital signature verification.
[0145] The present invention also provides a key encapsulation method, wherein the key encapsulation is performed using the key generation method described above, including: the encapsulator uses a user ID B and the first encryption master public key P of the first key generation center KGC1 pube1 The key encapsulation calculation is performed.
[0146] The present invention also provides a key decapsulation method, wherein the key generation method is used to decapsulate the key, wherein after the receiver AAA receives the encapsulated ciphertext CCC of the key K, the receiver AAA, as the first communication party, uses the first part of the user encryption private key de A1, the second communication party uses the second part of the user encryption private key de A2 Perform collaborative computing, including:
[0147] GG1, the first communication party sends the encapsulated ciphertext CCC to the second communication party;
[0148] GG2, the second communication party verifies that CCC is a point on G1, G1 is an additive cyclic group of order N, and N is a prime number;
[0149] GG3, the second communication party calculates w'2=e(CCC, de A2 ), let G2 be an additive cyclic group of order N, G T is a multiplicative cyclic group of order N, then e is the number of operations from G1×G2 to G T Bilinear pairings of ;
[0150] GG4. The second communication party sends w'2 to the first communication party;
[0151] GG5. The first communication party calculates w'=e(CCC, de A1 )×w'2;
[0152] GG6. The first communication party calculates the encapsulated key K'=KDF(CCC||w'||ID AAA , klen), ID AAA is the user identifier of the receiver AAA, KDF is a key derivation function, || represents merging the byte strings of data, and klen is the encapsulation bit length of the key K.
[0153] The present invention also provides a data encryption method, wherein the key generation method described above is used to perform key encapsulation, including: the encryptor uses the user ID of the data decryptor BBB B and the first encryption master public key P of the first key generation center KGC1 pube1 Perform encryption calculation on plaintext M.
[0154] The present invention also provides a data decryption method, which uses the above-mentioned key generation method to decrypt data, wherein the decryptor of the data, that is, the receiver A 132 Received ciphertext C 132 After that, the receiver A 132 As the first communication party, use the first part of the user encryption private key A1 , the second communication party uses the second part of the user encryption private key de A2 Perform collaborative computing, including:
[0155] HH1, the first communication party sends the ciphertext C 132 Sending to the second communication party;
[0156] HH2, the second communication party verifies C 132 is a point on G1, G1 is an additive cyclic group of order N, N is a prime number;
[0157] HH3, the second communication party calculates ww'2=e(C 132 , A2 ), let G2 be an additive cyclic group of order N, G T is a multiplicative cyclic group of order N, then e is the number of operations from G1×G2 to G T Bilinear pairings of ;
[0158] HH4. The second communication party sends ww'2 to the first communication party;
[0159] HH5. The first communication party calculates ww'=e(C 132 , A1 )×ww'2;
[0160] HH6. The first communication party calculates and obtains the plaintext M'.
[0161] The present invention further provides a computer device, comprising a memory, a first processor, and a first computer program stored in the memory and executable on the first processor, wherein the first computer program implements one or more of the following methods when executed by the first processor:
[0162] The key generation method described above;
[0163] The digital signature calculation method mentioned above;
[0164] The digital signature verification method described above;
[0165] The key encapsulation method described above;
[0166] The key decapsulation method described above;
[0167] The above data encryption method;
[0168] The above data decryption method.
[0169] The present invention further provides a computer-readable storage medium for storing a second computer program, wherein the second computer program can be executed by at least one second processor to enable the at least one second processor to perform one or more of the following methods:
[0170] The key generation method described above;
[0171] The digital signature calculation method mentioned above;
[0172] The digital signature verification method described above;
[0173] The key encapsulation method described above;
[0174] The key decapsulation method described above;
[0175] The above data encryption method;
[0176] The above data decryption method.
[0177] The key generation method provided by the present invention is a signature key collaborative generation method, which is implemented by collaborative calculation between the first communication party and the second communication party. Among them, after the first communication party and the second communication party apply to the first key generation center and the second key generation center to generate a user signature key, the first communication party and the second communication party respectively generate and store part of the user signature key. Through the present invention, the above two communication parties can collaboratively generate signature keys and calculate digital signatures; thereby realizing the safe storage and use of user signature keys by mobile terminal users without the need to use hardware devices such as USBKey. When the present invention generates a signature key, none of the first key generation center, the second key generation center, the first communication party, and the second communication party knows the user's signature private key, and none of the first communication party and the second communication party knows the user's encryption private key. Thereby, the key entrustment problem of the user signature key is guaranteed, and the security protection and use of the user signature key and the encryption private key on the mobile device are also guaranteed. Therefore, the present invention solves the problem of the secure storage and use management of the user signature key by the mobile terminal of the SM9 signature private key in cloud computing, mobile Internet and other environments under dual KGC.
[0178] Using the key generation method provided by the present invention, in the process of issuing the user encryption private key, the first communication party and the second communication party respectively generate corresponding partial user encryption private keys. On this basis, the first communication party and the second communication party can complete the key decapsulation and data decryption calculation through collaborative calculation. Other features and advantages of the present invention will be described in the subsequent description, and partly become obvious from the description, or be understood by implementing the present invention. The objects and other advantages of the present invention can be realized and obtained by the structures indicated in the description, claims and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0179] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0180] Figure 1A schematic diagram of data transmission relationship of a key generation method according to an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0181] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0182] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by technicians in the technical field to which this application belongs; the terms used in the specification of the application are only for the purpose of describing specific embodiments and are not intended to limit this application; the terms "including" and "having" in the specification and claims of this application and the above-mentioned figure descriptions and any variations thereof are intended to cover non-exclusive inclusions.
[0183] The key generation method for SM9 users provided by the present invention is described in detail below with reference to the accompanying drawings. Figure 1 This is a schematic diagram of the data transmission relationship of the key generation method provided by the present invention. Figure 1 , the key generation method comprises the following steps:
[0184] 1. Generate system parameters;
[0185] S1. Generate system parameters through dual key generation centers KGC1 and KGC2 respectively.
[0186] The first system parameters are generated by the first key generation center KGC1, and the first system parameters include the first signature master private key ks1 and the first signature master public key P pubs1 , and the first encryption master private key ke1 and the first encryption master public key P pube1 The first signature master private key ks1 is a random integer, and ks1∈[1, N-1], where N is a prime number. Let group G2 be an additive cyclic group of order N, then P pubs1 is an element of group G2 and satisfies
[0187] P pubs1 =[ks1]×P2 (1),
[0188] The first encryption master private key ke1 is a random integer, and ke1∈[1,N-1], where N is a prime number. Suppose group G1 is an additive cyclic group of order N, then P pube1 is an element of group G1 and satisfies
[0189] P pube1 =[ke1]×P1 (2),
[0190] In formulas (1) and (2), P1 is the generator of group G1, P2 is the generator of group G2, and the meaning of the square brackets [] represents the doubling operation on the elliptic curve. For details, please refer to Section 4 of the standard "GB / T 38635.1-2020" - "Information Security Technology SM9 Identity Cryptographic Algorithm Part 1: General Principles". In the present invention, the meaning of the square brackets [] in the following equations is the same as that of the square brackets [] in the above formula (1), representing the doubling operation on the elliptic curve.
[0191] Similarly, the second key generation center KGC2 generates the second system parameters, which include the second signature master private key ks2 and the second signature master public key P pubs2 The second signature master private key ks2 is a random integer, and ks2∈[1, N-1], and satisfies
[0192] P pubs2 =[ks2]×P2 (3).
[0193] S2. The public master key P is calculated by the dual key generation centers KGC1 and KGC2 respectively. pubs .
[0194] The first key generation center KGC1 calculates P pubs =[ks1]×P pubs2 ,
[0195] The second key generation center KGC2 calculates P pubs =[ks2]×P pubs1 .
[0196] The public master key generated by the first key generation center KGC1 and the second key generation center KGC2 is the same, both are P pubs .
[0197] S3. Select a common parameter α.
[0198] The public parameter α is a quadratic non-residue modulo N, and is randomly selected by the first key generation center KGC1 and the second key generation center KGC2 through offline negotiation. See the standard "GB / T 38635.1-2020" - "Information Security Technology SM9 Identity Cryptographic Algorithm Part 1: General Principles", N is the group G1 (additive cyclic group with order as prime number N), G2 (additive cyclic group with order as prime number N) and G in SM9. T The order of (a multiplicative cyclic group of order prime number N).
[0199] S4. Set the parameter P pubs1 , Ppube1 , P pubs2 , P pubs and alpha public release.
[0200] The first signature master public key P can be made public by the first key generation center KGC1 pubs1 and the first encryption master public key P pube1 , the second signature master public key P is published by the second key generation center KGC2 pubs2 , the public master key P is published by the first key generation center KGC1 and / or the second key generation center KGC2 pubs And public parameter α. Parameter P can also be made public through other devices or modules pubs1 , P pube1 , P pubs2 , P pubs and α.
[0201] 2. Generate user signature private key ds A , the user signs the master public key and encrypts and sends the user's encrypted private key A .
[0202] Assume that the user ID has been specified by the upper application system as ID A , user ID A It can be digital information such as ID number, mobile phone number, etc. User ID A Used to uniquely identify the user signature private key and user encryption private key of user A. The user signature private key of user A is related to the signature master private key (ks1 and ks2) of the first key generation center KGC1 and the second key generation center KGC2, and is uniquely determined when the main parameters of the system are determined; the user encryption private key of user A is related to the encryption master private key (ke1) of the first key generation center KGC1, and is uniquely determined when the main parameters of the system are determined.
[0203] The first key generation center KGC1 or the second key generation center KGC2 uses
[0204] h1=H1(ID A ||hid,N)
[0205] Calculate h1. Among them, H1(ID A ||hid, N) is the cryptographic function (i.e., the first cryptographic function) defined in 5.3.2.2 of "GB / T 38635.2-2020" - "Information Security Technology SM9 Identification Cryptographic Algorithm Part 2: Algorithm", and its calculation process is to convert any user ID AIt is mapped to a 256-bit integer through function H1, || means merging the byte strings of the data, hid is the function identifier defined in Section 4 of "GB / T 38635.1-2020" - "Information Security Technology SM9 Identification Cryptographic Algorithm Part 1: General Provisions", which is a fixed value and is selected and disclosed by the first key generation center KGC1 and the second key generation center KGC2 through negotiation.
[0206] The present invention introduces a collaborative first communication party and a second communication party, one of which (such as the first communication party) is the user A, and the other (such as the second communication party) is a user collaborative computing party such as a collaborative computing server, and the two can work together to share data. In the present invention, the above h1 can also be calculated by the first communication party and the second communication party. Then, according to whether h1 is a square element of modulus N, method AA is used to generate the first part of the user signature private key ds A1 、The second part is the user signature private key ds A2 , the first user signature master public key P pubsA And encrypt and send the user's encrypted private key A , and the user encrypts the private key A Split into the first part, the user's encrypted private key A1 、The second part is the user's encrypted private key A2 ; or use method BB to generate the third part of the user signature private key ds AA1 、Part 4 User signature private key ds AA2 , the second user signature master public key P pubsAA And encrypt and send the user's encrypted private key A , and the user encrypts the private key A Split into the third part, the user's encrypted private key AA1 、Part 4 User Encrypted Private Key AA2 .
[0207] Method AA: If h1 is a square element modulo N, that is, h1≡(h 2 )mod N, ≡ is the congruence sign, where x mod y represents the remainder operation of x on y, and let h be h 2 The larger of the two square roots of , then method AA comprises the following steps:
[0208] A1. The first communication party sends a collaborative key generation application to the second communication party;
[0209] A2. The second communication party generates a first random number ds of 256 bits A2 ,ds A2 ∈[1, N-1], by P'1=[(ds A2 ) -1 mod N]×P1 calculates the first data P'1, sends the first data P'1 to the first communication party, where P1 is the generator of group G1, and the second communication party saves the first random number ds A2 A second part of the user's signature private key as the second communication party;
[0210] A3. The first communication party generates a 256-bit second random number r A , r A ∈[1, N-1], by Q = [r A ]×P'1 calculates the second data Q, and the first communication direction sends the first data P'1, the second data Q and the user identification ID to the first key generation center KGC1. A ;
[0211] A4. The first key generation center KGC1 receives the first data P'1, the second data Q and the user identification ID A After that, the first user signature key generation data (s and T) and the user encryption private key de are calculated. A , the calculation comprises the following steps:
[0212] A41, the first key generation center KGC1 generates a 256-bit first random integer r, r∈[1,N-1], by
[0213] s=(r×(h+ks1) -1 )mod N
[0214] and T = [r -1 mod N]×Q
[0215] Calculate s and T,
[0216] A42, the first key generation center KGC1 uses the first encryption master private key ke1 and user identification ID in accordance with Section 7.1 of "GB / T 38635.2-2020" - "Information Security Technology SM9 Identity Cryptography Algorithm Part 2: Algorithm" A ,use
[0217] t1=H1(ID A ||hid,N)+ke1,
[0218] t2=(ke1×t1 -1 )mod N,
[0219] de A =[t2]×P2,
[0220] Calculate the user's encrypted private key A ,
[0221] A43. The first key generation center KGC1 generates a first random point N on G2. deA , and N deA Not equal to the user's encrypted private key A , and calculate the noise-encrypted first user encryption private key de' A :
[0222] de' A =de A -N deA ,
[0223] Introduce the noise of the first user's encrypted private key de' A The purpose is to use the first random point N deA Encrypt the user's private key A Perform noise confusion,
[0224] A44. The first key generation center KGC1 calculates S = [ke1] × P'1, assuming that the coordinates of S are (x S ,y S ), using the method in Section 7.2.6 of GB / T38635.1-2020 - Information Security Technology SM9 Identity Cryptographic Algorithm Part 1: General Principles to convert x S ,y S Convert to a byte string and calculate k = KDF(x S ||y S , 128), where KDF is the key derivation function in Section 5.3.6 of "Information Security Technology SM9 Identity Cryptographic Algorithm Part 2: Algorithm" in "GB / T38635.2-2020", k is a 128-bit byte string,
[0225] A45, let the noise-encrypted first user's private key de' A The coordinates of (x de'A ,y de'A ), the first key generation center KGC1 uses the method in Section 7.2.6 of GB / T 38635.1-2020 - Information Security Technology SM9 Identity Cryptographic Algorithm Part 1: General Principles to convert x de'A ,y de'A Convert to the first coordinate byte string, and use k and SM4 cryptographic algorithm to encrypt the first coordinate byte string to obtain the first private key coordinate encrypted data E:
[0226] E=SM4_ENC(k,x de'A ||y de'A ),
[0227] Among them, SM4_ENC(k, x de'A ||y de'A) indicates that the SM4 encryption algorithm defined in GB / T 32907-2016 - Information Security Technology SM4 Block Cipher Algorithm and a 128-bit key k are used to encrypt the plaintext x de'A ||y de'A Perform encryption calculation and output ciphertext,
[0228] A46, the first key generation center KGC1 generates the first user signature key data s and T, the first private key coordinate encryption data E and the first random point N deA Sending to the first communication party;
[0229] A5. The first communication direction sends T in the first user signature key generation data to the second key generation center KGC2. The second key generation center KGC2 receives
[0230] R=[(h+ks2) -1 mod N]×T
[0231] Calculate R and send R to the first communication party;
[0232] A6. The first communication party is
[0233] ds A1 =P'1-[(r A -1 ×h1×s)mod N]×R (3)
[0234] Calculate the first part of the user signature private key ds of the first communication party A1 .
[0235] where ds A1 The following equation is satisfied:
[0236] ds A1 =P'1-[(h1×(h+ks1) -1 ×(h+ks2) -1 )mod N]×P'1
[0237] =P'1-[(h1×(h1+h×(ks1+ks2)+ks1×ks2) -1 )mod N]×P'1;
[0238] A7, the first communication party and the second communication party are respectively
[0239] P pubsA =[h]×(P pubs1 +P pubs2 )+P pubs (4)
[0240] Calculate the first user signature master public key PpubsA At this time, the first user signature master public key P pubsA That is, the user's signature master public key,
[0241] Where P pubsA Satisfies the following equation
[0242] P pubsA =[(h×(ks1+ks2)+ks1×ks2)mod N]×P2;
[0243] A8. The first communication party randomly generates a second random integer d1∈[1, N-1], and calculates D1=[d1]×P2 and de A1 =D1+N deA , send the first private key coordinate encrypted data E and D1 to the second communication party, and save de A1 A first partial user encryption private key as a first communicating party;
[0244] A9. The second communication party uses
[0245] S'=[(ds A2 ) -1 mod N]×P pube1
[0246] Calculate S', and set the coordinates of S' to (x S’ ,y S’ ), using the method in Section 7.2.6 of GB / T 38635.1-2020 - Information Security Technology SM9 Identity Cryptographic Algorithm Part 1: General Principles to convert x S’ ,y S’ Convert to a byte string and calculate k'=KDF(x S’ ||y S’ , 128), k' is a 128-bit byte string;
[0247] A10. The second communication party uses k' and the SM4 cryptographic algorithm to decrypt the first private key coordinate encrypted data E to obtain a byte string:
[0248] x de’A ||y de’A =SM4_DEC(k',E),
[0249] Then use the method in Section 7.2.7 of GB / T 38635.1-2020 - Information Security Technology SM9 Identification Cryptographic Algorithm Part 1: General Principles to convert the decrypted byte string x de’A ||y de’A Convert to domain elements to get the noised first user encrypted private key de' A. SM4_DEC(k', E) means using the SM4 decryption algorithm in GB / T 32907-2016 and the 128-bit key k' to decrypt the ciphertext E and output the plaintext;
[0250] A11. The second communication party uses
[0251] de A2 =de' A -D1
[0252] Calculate the second part of the user encryption private key of the second communication party A2 and save it.
[0253] From the above calculation, we can get the first part of the user signature private key ds of the first communication party: A1 and the second part of the user signature private key ds of the second communication party A2 , satisfying the relationship:
[0254] [ds A2 ]×ds A1 =P1-[(h1×(h1+h×(ks1+ks2)+ks1×ks2) -1 )mod N]×P1=ds A .
[0255] After steps A8-A11, the first communication party and the second communication party each generate a partial user encryption private key, which can be used to collaboratively perform key decapsulation and data decryption.
[0256] Please note that when using method AA, the user's signature private key ds A It is the actual signature private key of user A, which is split into the first part, user signature private key ds A1 And the second part of the user signature private key ds A2 Two parts, however, the user's signature private key ds A In the entire process of implementing the present invention, it will not happen that any of the first communication party and the second communication party and any of the first key generation center KGC1 and the second key generation center KGC2 cannot independently calculate or obtain the user signature private key ds A .
[0257] The first part of the user encryption private key of the first communication party A1 and the second part of the user encryption private key of the second communication party A2 Satisfaction relationship:
[0258] de A =de A1 +de A2 ,
[0259] User encrypted private key A It will not occur during the whole process of executing the present invention.
[0260] Method BB: If h1 is a non-square element modulo N, then αh1 (i.e., α×h1) is a square element modulo N, i.e., αh1≡(hh 2 )modN, and let hh be hh 2 The larger of the two square roots of , method BB comprises the following steps:
[0261] B1. The first communication party sends a collaborative key generation application to the second communication party;
[0262] B2. The second communication party generates a third random number ds of 256 bits AA2 ,ds AA2 ∈[1, N-1], by PP'1=[(ds AA2 ) -1 mod N]×P1 calculates the third data PP'1 and sends the third data PP'1 to the first communication party, where P1 is the generator of group G1, and the second communication party saves the third random number ds AA2 The fourth part of the user signature private key as the second communication party;
[0263] B3. The first communication party generates a 256-bit fourth random number rr A ,rr A ∈[1, N-1], by QQ=[rr A ]×PP'1 calculates the fourth data QQ, and the first communication direction sends the third data PP'1, the fourth data QQ and the user identification ID to the first key generation center KGC1. A ;
[0264] B4. The first key generation center KGC1 receives the third data PP'1, the fourth data QQ and the user identification ID A After that, calculate the second user signature key generation data (ss and TT) and the user encryption private key de A , including the following calculation steps:
[0265] B41. The first key generation center KGC1 generates a third random integer rr of 256 bits, rr∈[1, N-1], and
[0266] ss=(rr×(hh+ks1) -1 )mod N
[0267] and TT = [rr -1 mod N]×QQ
[0268] The second user signature key generation data ss and TT are calculated,
[0269] B42, the first key generation center KGC1 uses the first encryption master private key ke1 and user identification ID in accordance with Section 7.1 of "GB / T 38635.2-2020" - "Information Security Technology SM9 Identity Cryptography Algorithm Part 2: Algorithm" A ,use
[0270] t1=H1(ID A ||hid,N)+ke1,
[0271] t2=(ke1×t1 -1 )mod N,
[0272] de A =[t2]×P2,
[0273] Calculate the user's encrypted private key A ,
[0274] B43. The first key generation center KGC1 generates a second random point NN on G2. deA , and NN deA Not equal to the user's encrypted private key A , calculate the noise-encrypted second user encryption private key de' AA :
[0275] de' AA =de A -NN deA ,
[0276] Introduce the noise-encrypted second user private key de' AA The purpose is to use the second random point NN deA Encrypt the user's private key A Perform noise confusion,
[0277] B44. The first key generation center KGC1 calculates SS = [ke1] × PP'1. Let the coordinates of SS be (x SS ,y SS ), using the method in Section 7.2.6 of GB / T 38635.1-2020 - Information Security Technology SM9 Identity Cryptographic Algorithm Part 1: General Principles to convert x SS ,y SS Convert to a byte string and calculate kk = KDF(x SS ||y SS, 128), where KDF is the key derivation function in Section 5.3.6 of GB / T 38635.2-2020 - Information Security Technology SM9 Identity Cryptographic Algorithm Part 2: Algorithm, kk is a 128-bit byte string,
[0278] B45, set AA The coordinates of (x de'AA ,y de'AA ), the first key generation center KGC1 uses the method in Section 7.2.6 of GB / T 38635.1-2020 - Information Security Technology SM9 Identity Cryptographic Algorithm Part 2: Algorithm to convert x de'AA ,y de'AA Convert to the second coordinate byte string, and use kk and SM4 cryptographic algorithm to encrypt the second coordinate byte string to obtain the second private key coordinate encrypted data EE:
[0279] EE = SM4_ENC(kk, x de'AA ||y de'AA ),
[0280] Among them, SM4_ENC(kk, x de'AA ||y de'AA ) indicates that the SM4 encryption algorithm defined in GB / T 32907-2016 - Information Security Technology SM4 Block Cipher Algorithm and a 128-bit key kk are used to encrypt the plaintext x de'AA ||y de'AA Perform encryption calculations and output ciphertext.
[0281] B46, the first key generation center KGC1 generates the second user signature key data ss and TT, the second private key coordinate encryption data EE and the second random point NN deA Sending to the first communication party;
[0282] B5. The first communication direction sends TT in the second user signature key generation data to the second key generation center KGC2. The second key generation center KGC2 receives
[0283] RR=[(hh+ks2) -1 mod N]×TT
[0284] Calculate and obtain the RR, and send the RR to the first communication party;
[0285] B6. The first communication party is
[0286] ds AA1 =PP'1-[(rr A -1 ×h1×α×ss)mod N]×RR (5)
[0287] Calculate the third part of the first communication party's user signature private key ds AA1 ;
[0288] Among them, ds AA1 The following equation is satisfied:
[0289] ds AA1 =PP'1-[(h1×α×(hh+ks1) -1 ×(hh+ks2) -1 )mod N]×PP'1
[0290] =PP'1-[(h1×(h1+α -1 ×hh×(ks1+ks2)+α -1 ×ks1×ks2) -1 )mod N]×PP'1;
[0291] B7, the first communication party and the second communication party are respectively
[0292] P pubsAA =[(α -1 )mod N]×([hh]×(P pubs1 +P pubs2 )+P pubs ) (6)
[0293] Calculate the second user signature master public key P pubsAA At this time, the second user signature master public key P pubsAA That is, the user's signature master public key,
[0294] Among them, P pubsAA The following equation is satisfied:
[0295] P pubsAA =[(α -1 ×hh×(ks1+ks2)+α -1 ×ks1×ks2)mod N]×P2;
[0296] B8. The first communication party generates a fourth random integer dd1∈[1, N-1], and calculates DD1=[dd1]×P2 and de AA1 =DD1+NN deA , send the second private key coordinate encrypted data EE and DD1 to the second communication party, and save de AA1 A third user encryption private key as the first communication party;
[0297] B9. The second communication party uses
[0298] SS'=[(ds AA2) -1 mod N]×P pube1
[0299] Calculate SS', and set the coordinates of SS' to (x SS’ ,y SS’ ), using the method in Section 7.2.6 of GB / T 38635.1-2020 - Information Security Technology SM9 Identity Cryptographic Algorithm Part 1: General Principles to convert x SS’ ,y SS’ Convert to a byte string and calculate kk'=KDF(x SS’ ||y SS’ , 128), where KDF is the key derivation function of Section 5.3.6 of GB / T 38635.2-2020 - Information Security Technology SM9 Identity Cryptographic Algorithm Part 2: Algorithm, and kk' is a 128-bit byte string;
[0300] B10. The second communication party uses kk' and the SM4 cryptographic algorithm to decrypt the second private key coordinate encrypted data EE to obtain a byte string:
[0301] x de’AA ||y de’AA =SM4_DEC(kk',EE),
[0302] Then use the method in Section 7.2.7 of GB / T 38635.1-2020 - Information Security Technology SM9 Identification Cryptographic Algorithm Part 1: General Principles to convert the decrypted byte string x de’AA ||y de’AA Convert to domain elements to get the noised second user encrypted private key de' AA , where SM4_DEC(kk', EE) means using the SM4 decryption algorithm in GB / T 32907-2016 and the 128-bit key kk' to decrypt the ciphertext EE and output the plaintext;
[0303] B11. The second communication party uses
[0304] de AA2 =de' AA -DD1
[0305] Calculate the fourth part of the second communication party's user encryption private key de AA2 and save it.
[0306] From the above calculation, we can get the third part of the first communication party's user signature private key ds AA1 and the fourth part of the second communication party's user signature private key ds AA2 Satisfaction relationship:
[0307] [ds AA2 ]×ds AA1 =P1-[(h1×(h1+h×(ks1+ks2)+ks1×ks2) -1 )mod N]×P1=ds A .
[0308] After steps B8-B11, the first communication party and the second communication party each generate a partial user encryption private key, which can be used to collaboratively perform key decapsulation and data decryption.
[0309] Please note that when using method BB, the user's signature private key ds A It is the actual signature private key of user A, which is split into the third part, user signature private key ds AA1 And the fourth part of the user signature private key ds AA2 Two parts, however, the user's signature private key ds A In the entire process of implementing the present invention, it will not occur that any of the first communication party and the second communication party and any of the first key generation center KGC1 and the second key generation center KGC2 cannot independently calculate or obtain ds A .
[0310] The third part of the first communication party's user encryption private key de AA1 and the fourth part of the second communication party's user encryption private key de AA2 Satisfaction relationship:
[0311] de A =de AA1 +de AA2 .
[0312] The present invention also provides a digital signature calculation method, the digital signature calculation method adopts the key generation method, and in the digital signature calculation method, the first communication party uses the first part of the user signature private key ds A1 (or use the third part user signature private key ds AA1 ), the second communication party uses the second part of the user signature private key ds A2 (or the fourth part of the user's signature private key ds AA2 ) collaboratively calculates a digital signature. In the digital signature calculation method, a user ID is set A , and assuming that the original message to be signed is m, then use
[0313] h1=H1(ID A ||hid,N)
[0314] Calculate h1, and adopt method CC or method DD according to whether h1 is a square element modulo N, where H1.
[0315] Method CC: If h1 is the square element of modulus N, the first communication party uses the first part of the user signature private key ds A1 , the second communication party uses the second part of the user signature private key ds A2 , specifically including the following steps:
[0316] CC1, the first communication party generates a fifth random integer k1 of 256 bits, k1∈[1,N-1], and calculates u=e(P1,P pubsA ) k1 , and the data u, m and ID A Sent to the second communication party, where e is from G1×G2 to G T For details, see Section 6.1 of "GB / T 38635.1-2020" - "Information Security Technology SM9 Identity Cryptographic Algorithm Part 1: General Principles";
[0317] CC2, the second communication party generates a 256-bit sixth random integer k2 and a seventh random integer k3, where k2∈[1, N-1], k3∈[1, N-1], and then calculates w=u k2 ×e(P1,P pubsA ) k3 ;
[0318] CC3, the second communication party calculates hhh = H2(m||w, N), s1 = (k2×ds A2 )mod N,s2=((k3-hhh)×ds A2 )mod N, where H2 is the cryptographic function defined in 5.3.2.3 of GB / T 38635.2-2020 - Information Security Technology SM9 Identification Cryptographic Algorithm Part 2: Algorithm (i.e., the second cryptographic function), and the second communication party sends hhh, s1, and s2 to the first communication party;
[0319] CC4, first communication party uses
[0320] S=[k1×s1+s2]×ds A1
[0321] Calculate S and output the digital signature (hhh, S).
[0322] Method DD: If h1 is not the square element of modulus N, the first communication party uses the third part of the user signature private key ds AA1 , the second communication party uses the fourth part of the user signature private key ds AA2 , specifically including the following steps:
[0323] DD1. The first communication party generates an eighth random integer kk1 of 256 bits, kk1∈[1,N-1], and calculates uu=e(P1,P pubsAA ) kk1 , and the data uu, m and ID A Sending to a second communication party;
[0324] DD2. The second communication party generates a 256-bit ninth random integer kk2 and a tenth random integer kk3, where kk2∈[1, N-1], kk3∈[1, N-1], and then calculates ww=uu kk2 ×e(P1,P pubsAA ) kk3 ;
[0325] DD3. The second communication party calculates hhhh=H2(m||ww, N), ss1=(kk2×ds AA2 )mod N, ss2=((kk3-hhhh)×ds AA2 )mod N, the second communication party sends hhhh, ss1 and ss2 to the first communication party;
[0326] DD4, the first communication party uses
[0327] SS=[kk1×ss1+ss2]×ds AA1
[0328] Calculate SS and output the digital signature (hhhh, SS).
[0329] The present invention also provides a digital signature verification method, the digital signature verification method adopts the above-mentioned key generation method, and the digital signature verification method adopts the above-mentioned first user signature master public key P pubsA Or the second user signature master public key P pubsAA , identifier hid, user ID A , message m and digital signature (hhhh, SS) are input parameters, and digital signature verification is performed on message m. In the digital signature verification method,
[0330] h1=H1(ID A ||hid,N)
[0331] Calculate h1 and adopt method EE or method FF according to whether h1 is a square element modulo N.
[0332] Method EE: If h1 is the square element of modulus N, the first communication party uses the first user signature master public key P pubsA , function identifier hid, user ID A, message m and digital signature sig are input parameters, and verification is performed according to the algorithm in Section 6.4 of "GB / T38635.2-2020" - "Information Security Technology SM9 Identity Cryptography Algorithm Part 2: Algorithm". pubsA , the first part of the user signature private key ds used by the first communication party A1 and the second part of the user signature private key ds used by the second communication party A2 It can be seen from the relationship that if the message has not been tampered with, the digital signature can be verified.
[0333] Method FF: If h1 is not the square element of modulus N, the first communication party uses the second user signature master public key P pubsAA , function identifier hid, user ID A , message m and digital signature sig are input parameters, and verification is performed according to the algorithm in Section 6.4 of "GB / T38635.2-2020" - "Information Security Technology SM9 Identity Cryptography Algorithm Part 2: Algorithm". pubsAA , the third part of the user signature private key ds used by the first communication party AA1 and the partial user signature private key ds used by the second communication party AA2 It can be seen from the relationship that if the message has not been tampered with, the digital signature can be verified.
[0334] The present invention also provides a key encapsulation method, wherein the key encapsulation method adopts the key generation method described above, and in the key encapsulation method, the encapsulator encapsulates a key K with a bit length of klen (klen is an integer) and then sends it to a user identified as ID B The receiver AAA uses the user identification ID B and the first encryption master public key P of the first key generation center KGC1 pube1 According to the key encapsulation calculation in Section 8.2 of "GB / T 38635.2-2020" - "Information Security Technology SM9 Identity Cryptographic Algorithm Part 2: Algorithm", the output is (KKK, CCC), where KKK is the encapsulated key and CCC is the encapsulated ciphertext.
[0335] The present invention also provides a key decapsulation method, wherein the key decapsulation method adopts the key generation method described above, and in the key decapsulation method, after the receiver AAA receives the encapsulated ciphertext CCC of the key K, the receiver AAA, as the first communication party, uses its first part of the user encryption private key de A1 and the second communication party (using the second part of the user encryption private key de A2 ) performs collaborative calculation to recover the key K'. The calculation process is as follows:
[0336] GG1, the first communication party (receiver AAA) sends CCC to the second communication party;
[0337] GG2, the second communication party verifies that CCC is a point on G1;
[0338] GG3, the second communication party calculates w'2=e(CCC, de A2 );
[0339] GG4. The second communication party sends w'2 to the first communication party;
[0340] GG5. The first communication party calculates w'=e(CCC, de A1 )×w'2;
[0341] GG6. The first communication party calculates the encapsulated key K'=KDF(CCC||w'||ID AAA , klen). ID AAA The user ID of the receiver AAA.
[0342] The present invention also provides a data encryption method, wherein the data encryption method adopts the above-mentioned key generation method, and in the data encryption method, the encryptor uses the user ID of the data decryptor BBB B and the first encryption master public key P of the first key generation center KGC1 pube1 According to Section 9.2 of "GB / T 38635.2-2020" - "Information Security Technology SM9 Identification Cryptographic Algorithm Part 2: Algorithm", after encrypting the plaintext M, the ciphertext C is output. 132 =C1||C3||C2.
[0343] The present invention also provides a data decryption method, wherein the data decryption method adopts the key generation method described above, and in the data encryption method, the decryptor of the data, i.e., the receiver A 132 Received ciphertext C 132 =C1||C3||C2, receiver A 132 As the first communication party, use the first part of the user encryption private key de A1 and the second communication party (using the second part of the user encryption private key de A2 ) performs collaborative calculation to decrypt the plaintext M. The calculation process is as follows:
[0344] HH1, first communication party (receiver A 132 ) 132 Sending to a second communication party;
[0345] HH2, second communication party verification C 132 is a point on G1;
[0346] HH3, the second communication party calculates ww'2=e(C 132 , A2 );
[0347] HH4, the second communication party sends ww'2 to the first communication party;
[0348] HH5. The first communication party calculates ww'=e(C 132 , A1 )×ww'2;
[0349] HH6. The first communicating party calculates and outputs the plaintext M' in accordance with B3-B5 in Section 9.4 of "GB / T 38635.2-2020" - "Information Security Technology SM9 Identification Cryptographic Algorithm Part 2: Algorithm", where ω' in B3-B5 in Section 9.4 of "GB / T 38635.2-2020" - "Information Security Technology SM9 Identification Cryptographic Algorithm Part 2: Algorithm" is ww'.
[0350] The present invention also provides a computer device, comprising a storage device, a first processor, and a first computer program stored in the storage device and executable on the first processor. When the first computer program is executed by the first processor, one or more of the above-mentioned key generation method, digital signature calculation method, digital signature verification method, key encapsulation method, key decapsulation method, data encryption method, and data decryption method are implemented.
[0351] The present invention also provides a computer-readable storage medium for storing a second computer program, which can be executed by at least one second processor so that the at least one second processor executes one or more of the above-mentioned key generation method, digital signature calculation method, digital signature verification method, key encapsulation method, key decapsulation method, data encryption method and data decryption method.
[0352] The signature key generation method provided by the present invention generates partial user signature keys by the first communication party and the second communication party respectively, and generates user signature keys by communicating with the first key generation center and the second key generation center respectively. The user signature keys are partially stored in the first communication party and the second communication party respectively. In the process of generating the user signature key, none of the first communication party, the second communication party, the first key generation center and the second key generation center can calculate the complete user signature key, thereby realizing the effective control of the user over the signature key, solving the problem of KGC's complete control over the user signature key under a single KGC, that is, the trusteeship of the user key, and realizing the secure generation, storage and use of the user signature key by the user's mobile terminal in cloud computing, mobile Internet and other environments.
[0353] Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent substitutions for some of the technical features therein; and these modifications or substitutions do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A key generation method, characterized in that: The steps include:
1. Generate system parameters; 2. Based on the system parameters, the first communication party and the second communication party work together to generate a user signature private key ds A , the user signs the master public key and encrypts and sends the user's encrypted private key A ; The step 1 comprises the following steps: S1. Generate a first system parameter through a first key generation center KGC1, and generate a second system parameter through a second key generation center KGC2, in, The first system parameters include a first signature master private key ks1 and a first signature master public key P pubs1 , and the first encryption master private key ke1 and the first encryption master public key P pube1 , The first signature master private key ks1 is a random integer, and ks1∈[1, N-1], where N is a prime number. Assuming that group G2 is an additive cyclic group of order N, then the first signature master public key P pubs1 is an element of group G2 and satisfies P pubs1 =[ks1]×P2 (1), The first encryption master private key ke1 is a random integer, and ke1∈[1, N-1]. Assuming that group G1 is an additive cyclic group of order N, then the first encryption master public key P pube1 is an element of group G1 and satisfies P pube1 =[ke1]×P1 (2), In formulas (1) and (2), P1 is the generator of group G1, P2 is the generator of group G2, and the meaning of square brackets [] represents the doubling operation on the elliptic curve. The meaning of square brackets [] in the following equations is the same as that of square brackets [] in formula (1). The second system parameters include a second signature master private key ks2 and a second signature master public key P pubs2 , the second signature master private key ks2 is a random integer, and ks2∈[1,N-1], and satisfies P pubs2 =[ks2]×P2 (3); S2. The first key generation center KGC1 and the second key generation center KGC2 respectively calculate the public master key P pubs , in The first key generation center KGC1 calculates P pubs =[ks1]×P pubs2 , The second key generation center KGC2 calculates P pubs =[ks2]×P pubs1 , S3. Select a public parameter α, wherein the public parameter α is a quadratic non-residue modulo N, S4. The first signature master public key P pubs1 , the first encryption master public key P pube1 , the second signature master public key P pubs2 , public master key P pubs and public parameter α is publicly released; The second step includes: calculating h1=H1(ID A ||bridge,N) Among them, H1(ID A ||hid, N) is the first cryptographic function, ID A is the user identifier, || means merging the byte strings of the data, hid is the function identifier, If h1 is the square element of modulus N, use method AA to generate the first part of the user signature private key ds A1 、The second part is the user signature private key ds A2 , the first user signature master public key P pubsA And encrypt and send the user's encrypted private key A , and the user encrypts the private key de A Split into the first part of the user's encrypted private key A1 、The second part is the user's encrypted private key A2 , the first user signature master public key P pubsA That is, the user's signature master public key, If h1 is not the square element of modulus N, use method BB to generate the third part of the user signature private key ds AA1 、Part 4 User signature private key ds AA2 , the second user signature master public key P pubsAA And encrypt and send the user's encrypted private key A , and the user encrypts the private key de A Split into the third part, the user's encrypted private key AA1 、Part 4 User Encrypted Private Key AA2 , the second user signature master public key P pubsAA That is, the user's signature master public key; In the method AA, h1 is the square element modulo N, that is, h1≡(h 2 )mod N, ≡ is the congruence sign, where x mod y represents the remainder operation of x on y, and let h be h 2 The larger of the two square roots, the method AA comprises the steps of: A1. The first communication party sends a collaborative key generation application to the second communication party. A2. The second communication party generates a first random number ds of 256 bits A2 ,ds A2 ∈[1, N-1], by P'1=[(ds A2 ) - 1 mod N]×P1 calculates the first data P'1, sends the first data P'1 to the first communication party, and the second communication party saves the first random number ds A2 As the second part of the user signature private key of the second communication party, A3. The first communication party generates a 256-bit second random number r A , r A ∈[1, N-1], by Q = [r A ]×P'1 calculates the second data Q, and the first communication direction sends the first data P'1, the second data Q and the user identification ID to the first key generation center KGC1. A , A4. The first key generation center KGC1 receives the first data P'1, the second data Q and the user identification ID A After that, the first user signature key generation data and the user encryption private key de are calculated. A , the first user signature key generation data includes s and T, A5. The first communication direction sends T in the first user signature key generation data to the second key generation center KGC2. The second key generation center KGC2 receives R=[(h+ks2) -1 mod N]×T Calculate R and send R to the first communication party, A6. The first communication party is ds A1 =P’1-[(r A -1 ×h1×s)mod N]×R Calculate and obtain the first part of the user signature private key ds of the first communication party A1 , A7, the first communication party and the second communication party are respectively P pubsA =[h]×(P pubs1 +P pubs2 )+P pubs Calculate the first user signature master public key P pubsA , the first user signature master public key P pubsA That is, the user's signature master public key, A8. The first communication party randomly generates a second random integer d1∈[1, N-1], and calculates D1=[d1]×P2 and de A1 =D1+N deA , then send the first private key coordinate encrypted data E and D1 to the second communication party, and save de A1 as a first part of a user encryption private key of the first communication party, A9, the second communication party uses S’=[(ds A2 ) -1 mod N]×P pube1 Calculate S', and set the coordinates of S' to (x S’ ,y S’ ), and x S’ ,y S’ Convert to a byte string and calculate k'=KDF(x S’ ||y S’ , 128), where KDF is the key derivation function, k' is a 128-bit byte string, A10. The second communication party decrypts the first private key coordinate encrypted data E to obtain a byte string: x de’A ||y de’A =SM4_DEC(k',E), convert the byte string x de’A ||y de’A Convert to domain elements to get the noised first user encrypted private key de' A , where SM4_DEC(k', E) means using the SM4 decryption algorithm and the 128-bit key k' to decrypt the ciphertext E and output the plaintext. A11. The second communication party uses of A2 =of' A -D1 Calculate the second part of the user encryption private key of the second communication party de A2 and save; In the method BB, h1 is a non-square element modulo N, then αh1 is a square element modulo N, that is, αh1≡(hh 2 )mod N, and let hh be hh 2 The larger of the two square roots, the method BB comprises the steps of: B1. The first communication party sends a collaborative key generation application to the second communication party. B2. The second communication party generates a third random number ds of 256 bits. AA2 ,ds AA2 ∈[1, N-1], by PP'1=[(ds AA2 ) -1 mod N]×P1 calculates the third data PP'1, and sends the third data PP'1 to the first communication party, and the second communication party saves the third random number ds AA2 As the fourth part of the user signature private key of the second communication party, B3. The first communication party generates a fourth random number rr of 256 bits A ,rr A ∈[1, N-1], by QQ=[rr A ]×PP'1 calculates the fourth data QQ, and the first communication direction sends the third data PP'1, the fourth data QQ and the user identification ID to the first key generation center KGC1. A , B4. The first key generation center KGC1 receives the third data PP'1, the fourth data QQ and the user identification ID A After that, calculate the second user signature key generation data (ss and TT) and the user encryption private key de A , the second user signature key generation data includes ss and TT, B5. The first communication direction sends TT in the second user signature key generation data to the second key generation center KGC2. The second key generation center KGC2 receives <h2 style=";text-align:left;direction:ltr">RR=[(hh+ks2)<h2 style=";text-align:left;direction:ltr"> -1 <h2 style=";text-align:left;direction:ltr"> mod N]×TT Calculate and obtain RR, and send RR to the first communication party, B6. The first communication party is ds AA1 =PP’1-[(rr A -1 ×h1×α×ss)mod N]×RR Calculate the third part of the user signature private key ds of the first communication party AA1 , B7. The first communication party and the second communication party are respectively P pubsAA =[(α -1 )mode N]×([hh]×(P pubs1 +P pubs2 )+P pubs ) Calculate the second user signature master public key P pubsAA , the second user signature master public key P pubsAA That is, the user's signature master public key, B8. The first communication party generates a fourth random integer dd1∈[1,N-1], and calculates DD1=[dd1]×P2 and de AA1 =DD1+NN deA , send the second private key coordinate encrypted data EE and DD1 to the second communication party, and save de AA1 The third part of the user encryption private key of the first communication party, B9, the second communication party uses SS’=[(ds AA2 ) -1 mod N]×P pube1 Calculate SS', and set the coordinates of SS' to (x SS’ ,y SS’ ), and x SS’ ,y SS’ Convert to a byte string and calculate kk'=KDF(x SS’ ||y SS’ , 128), where KDF is the key derivation function, kk' is a 128-bit byte string, B10. The second communication party decrypts the second private key coordinate encrypted data EE to obtain a byte string: x de’AA ||y de’AA =SM4_DEC(kk',EE), convert the byte string x de’AA ||y de’AA Convert to domain elements to get the noised second user encrypted private key de' AA , where SM4_DEC(kk', EE) means using the SM4 decryption algorithm and the 128-bit key kk' to decrypt the ciphertext EE and output the plaintext. B11, the second communication party uses the AA2 =the' AA -DD1 Calculate the fourth part of the user encryption private key of the second communication party de AA2 and save it.
2. The key generation method according to claim 1, characterized in that: In step A4, the calculation includes the following steps: A41, the first key generation center KGC1 generates a 256-bit first random integer r, r∈[1,N-1], by s=(r×(h+ks1) -1 )towards N and T = [r -1 mod N]×Q Calculate and obtain the first user signature key generation data s and T; A42, the first key generation center KGC1 uses the first encryption master private key ke1 and the user identification ID A ,use t1=H1(ID A ||hid,N)+ke1, t2=(ke1×t1 -1 )mod N, of A =[t2]×P2, Calculate the user's encrypted private key de A ; A43. The first key generation center KGC1 generates a first random point N on G2. deA , and N deA Not equal to the user's encrypted private key A , and calculate the noised first user encrypted private key de' A : of' A of A -N deA ; A44. The first key generation center KGC1 calculates S=[ke1]×P'1, assuming that the coordinates of S are (x S ,y S ), and x S ,y S Convert to a byte string and calculate k = KDF(x S ||y S , 128), wherein KDF is the key derivation function and k is a 128-bit byte string; A45, set the noise first user encryption private key de' A The coordinates of (x de'A ,y de'A ), the first key generation center KGC1 converts x de'A ,y de'A Convert to the first coordinate byte string, and encrypt the first coordinate byte string to obtain the first private key coordinate encrypted data E: E=SM4_ENC(k,x de ' A ||y de ' A ), Among them, SM4_ENC(k, x de'A ||y de'A ) indicates that the SM4 encryption algorithm and the 128-bit key k are used to encrypt the plaintext x de'A ||y de'A Perform encryption calculation and output ciphertext; A46, the first key generation center KGC1 generates the first user signature key data s and T, the first private key coordinate encryption data E and the first random point N deA sent to the first communication party, The first part of the user signature private key ds A1 And the second part of the user signature private key ds A2 , satisfying the relationship: [ds A2 ]×ds A1 =ds A , The first part of the user's encrypted private key is A1 And the second part of the user's encrypted private key A2 Satisfaction relationship: of A =of A1 +of A2 。 3. The key generation method according to claim 1, characterized in that: In step B4, the calculation includes the following steps: B41. The first key generation center KGC1 generates a third random integer rr of 256 bits, rr∈[1, N-1], and ss=(rr×(hh+ks1) -1 )towards N and TT=[rr -1 mod N]×QQ Calculate and obtain the second user signature key generation data ss and TT; B42, the first key generation center KGC1 uses the first encryption master private key ke1 and the user identification ID A ,use t1=H1(ID A ||hid,N)+ke1, t2=(ke1×t1 -1 )mod N, of A =[t2]×P2, Calculate the user's encrypted private key de A , B43. The first key generation center KGC1 generates a second random point NN on G2. deA , and NN deA Not equal to the user's encrypted private key A , and calculate the noise-encrypted second user encryption private key de' AA :de' AA =de A -NN deA ; B44. The first key generation center KGC1 calculates SS = [ke1] × PP'1, assuming that the coordinates of SS are (x SS ,y SS ), and x SS ,y SS Convert to a byte string and calculate kk = KDF(x SS ||y SS , 128), wherein KDF is the key derivation function, and kk is a 128-bit byte string; B45, set the noise second user encryption private key de' AA The coordinates of (x de'AA ,y de'AA ), the first key generation center KGC1 converts x de'AA ,y de'AA Convert to the second coordinate byte string, and encrypt the second coordinate byte string to obtain the second private key coordinate encrypted data EE: EE=SM4_ENC(kk,x de ' AA ||and de ' AA ), Among them, SM4_ENC(kk, x de'AA ||y de'AA ) indicates that the SM4 encryption algorithm and the 128-bit key kk are used to encrypt the plaintext x de'AA ||y de'AA Perform encryption calculation and output ciphertext; B46, the first key generation center KGC1 generates the second user signature key generation data ss and TT, the second private key coordinate encryption data EE and the second random point NN deA sent to the first communication party, The third part of the user signature private key ds AA1 And the fourth part of the user signature private key ds AA2 Satisfaction relationship: [ds AA2 ]×ds AA1 =ds A , The third part of the user encryption private key is AA1 And the fourth part of the user encrypted private key AA2 Satisfaction relationship: of A =of AA1 +of AA2 。 4. A digital signature calculation method, characterized in that: Let user ID be A , and assume that the original message to be signed is m, using h1=H1(ID A ||hid, N) to calculate h1, where H1 is the first cryptographic function, || means merging the byte strings of the data, hid is the function identifier, and N is a prime number. If h1 is the square element of modulus N, the first part of the user signature private key ds is obtained by using the key generation method described in any one of claims 1-2. A1 And the second part of the user signature private key ds A2 , then perform method CC, or If h1 is not the square element of modulus N, the third part of the user signature private key ds is obtained by using the key generation method described in any one of claims 1 and 3. AA1 And the fourth part of the user signature private key ds AA2 , then proceed to method DD, The method CC comprises the following steps: CC1, the first communication party generates a fifth random integer k1 of 256 bits, k1∈[1,N-1], and calculates u=e(P1,P pubsA ) k1 , and the u, the original message to be signed m and the user ID A Sent to the second communication party, where G1 is an additive cyclic group of order N, G2 is an additive cyclic group of order N, G T is a multiplicative cyclic group of order N, then e is the number of operations from G1×G2 to G T The bilinear pairing of P1 is a generator of the group G1, P pubsA Sign the master public key for the first user; CC2, the second communication party generates a 256-bit sixth random integer k2 and a seventh random integer k3, where k2∈[1, N-1], k3∈[1, N-1], and then calculates w=u k2 ×e(P1,P pubsA ) k3 ; CC3, the second communication party calculates hhh = H2(m||w, N), s1 = (k2×ds A2 )mod N,s2=((k3-hhh)×ds A2 ) mod N, then, the second communication party sends hhh, s1 and s2 to the first communication party, where H2 is a second cryptographic function, and x mod y represents a remainder operation of x on y; CC4, the first communication party uses S=[k1×s1+s2]×ds A1 Calculate S and output the digital signature (hhh, S); The method DD comprises the following steps: DD1. The first communication party generates an eighth random integer kk1 of 256 bits, kk1∈[1,N-1], and calculates uu=e(P1,P pubsAA ) kk1 , and the uu, the original message to be signed m and the user ID A Sent to the second communication party, where G1 is an additive cyclic group of order N, G2 is an additive cyclic group of order N, G T is a multiplicative cyclic group of order N, then e is the number of operations from G1×G2 to G T The bilinear pairing of P1 is a generator of the group G1, P pubsAA Sign the master public key for the second user; DD2. The second communication party generates a 256-bit ninth random integer kk2 and a tenth random integer kk3, where kk2∈[1, N-1], kk3∈[1, N-1], and then calculates ww=uu kk2 ×e(P1,P pubsAA ) kk3 ; DD3. The second communication party calculates hhhh=H2(m||ww, N), ss1=(kk2×ds AA2 )mod N, ss2=((kk3-hhhh)×ds AA2 ) mod N, then, the second communication party sends hhhh, ss1 and ss2 to the first communication party, where H2 is a second cryptographic function, and x mod y represents a remainder operation of x on y; DD4. The first communication party uses SS=[kk1×ss1+ss2]×ds AA1 Calculate SS and output the digital signature (hhhh, SS).
5. A digital signature verification method, characterized in that: Using h1=H1(ID A ||hid, N) to calculate h1, where H1 is the first cryptographic function, || means merging the byte strings of the data, hid is the function identifier, and N is a prime number. If h1 is the square element of the modulus N, the first user signature master public key P is obtained by using the key generation method described in any one of claims 1-2. pubsA , and then the first communication party uses the first user signature master public key P pubsA , function identifier hid, user ID A , message m and digital signature (hhh, S) are input parameters, and digital signature verification is performed. or If h1 is not the square element of the modulus N, the second user signature master public key P is obtained by using the key generation method described in any one of claims 1 and 3. pubsAA , and then the first communication party uses the second user's signature master public key P pubsAA , function identifier hid, user ID A , message m and digital signature (hhhh, SS) are input parameters for digital signature verification.
6. A key encapsulation method, characterized in that: The key generation method according to any one of claims 1 to 3 is used to encapsulate the key, including: the encapsulator uses the user identification ID of the receiver AAA B and the first encryption master public key P of the first key generation center KGC1 pube1 The key encapsulation calculation is performed.
7. A key decapsulation method, characterized in that: The key generation method according to any one of claims 1 to 3 is used to decapsulate the key, wherein after the receiver AAA receives the encapsulated ciphertext CCC of the key K, the receiver AAA, as the first communication party, uses the first part of the user encryption private key de A1 , the second communication party uses the second part of the user encryption private key de A2 Perform collaborative computing, including: GG1, the first communication party sends the encapsulated ciphertext CCC to the second communication party; GG2, the second communication party verifies that CCC is a point on G1, G1 is an additive cyclic group of order N, and N is a prime number; GG3, the second communication party calculates w'2=e(CCC, de A2 ), let G2 be an additive cyclic group of order N, G T is a multiplicative cyclic group of order N, then e is the number of operations from G1×G2 to G T Bilinear pairings of ; GG4. The second communication party sends w'2 to the first communication party; GG5. The first communication party calculates w'=e(CCC, de A1 )×w'2; GG6. The first communication party calculates the encapsulated key K'=KDF(CCC||w'||ID AAA , klen), ID AAA is the user identifier of the receiver AAA, KDF is a key derivation function, || represents merging the byte strings of data, and klen is the encapsulation bit length of the key K.
8. A data encryption method, characterized in that: The key generation method according to any one of claims 1 to 3 is used to perform key encapsulation, including: the encryptor uses the user ID of the decryptor BBB of the data B and the first encryption master public key P of the first key generation center KGC1 pube1 Perform encryption calculation on plaintext M.
9. A data decryption method, characterized in that: The key generation method according to any one of claims 1 to 3 is used to decrypt data, wherein the decryptor of the data is the receiver A. 132 Received ciphertext C 132 After that, the receiver A 132 As the first communication party, use the first part of the user encryption private key A1 , the second communication party uses the second part of the user encryption private key de A2 Perform collaborative computing, including: HH1, the first communication party sends the ciphertext C 132 Sending to the second communication party; HH2, the second communication party verifies C 132 is a point on G1, G1 is an additive cyclic group of order N, N is a prime number; HH3, the second communication party calculates ww'2=e(C 132 , A2 ), let G2 be an additive cyclic group of order N, G T is a multiplicative cyclic group of order N, then e is the number of operations from G1×G2 to G T Bilinear pairings of ; HH4. The second communication party sends ww'2 to the first communication party; HH5. The first communication party calculates ww'=e(C 132 , A1 )×ww'2; HH6. The first communication party calculates and obtains the plaintext M'.
10. A computer device comprising a memory, a first processor, and a first computer program stored in the memory and executable on the first processor, characterized in that: When the first computer program is executed by the first processor, one or more of the following methods are implemented: The key generation method according to any one of claims 1 to 3; The digital signature calculation method as claimed in claim 4; The digital signature verification method according to claim 5; The key encapsulation method according to claim 6; The key decapsulation method according to claim 7; The data encryption method according to claim 8; The data decryption method as claimed in claim 9.
11. A computer-readable storage medium for storing a second computer program, characterized in that: The second computer program may be executed by at least one second processor so that the at least one second processor performs one or more of the following methods: The key generation method according to any one of claims 1 to 3; The digital signature calculation method as claimed in claim 4; The digital signature verification method according to claim 5; The key encapsulation method according to claim 6; The key decapsulation method according to claim 7; The data encryption method according to claim 8; The data decryption method as claimed in claim 9.
