A safe and controllable method and system for using SM2 signature production data
By adopting secure collaborative computing and encryption algorithms in SM2 digital signatures, the signature private keys are divided and managed, and the problem of difficult security of private keys in non-hardware environments is solved, and the security, controllability and compliance of signed data are achieved.
Patent Information
- Application Number
- CN202210785735.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-04
- Publication Date
- 2024-11-08
- Estimated Expiration
- 2042-07-04
AI Technical Summary
When implementing SM2 digital signatures in non-hardware mode, the security of the user's private key is difficult to guarantee, there is a risk of stealing and misappropriation, and it does not comply with the requirements of the "Electronic Signature Law of the People's Republic of China". The electronic signature production data is not only controlled by the signer.
By splitting the signature private key into multiple copies and performing secure collaborative calculations between the signature device and the signature assist system, ensuring that the secret share of each device is not leaked during the encryption and decryption process, using multiplier encryption and homomorphic encryption The algorithm performs key management to ensure the security and controllability of signature production data.
Effectively prevent the signature private key from being stolen and cracked, ensuring the security of the digital signature generation process, the signature production data is only controlled by the signer, meeting the requirements of electronic signature method, and improving the security of the use of private keys.
Smart Images

Figure CN115314207B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of information security technology, and in particular to a method and system for securely and controllably using SM2 signature production data. Background Art
[0002] SM2 is a type of elliptic curve public key cryptographic algorithm developed and promulgated by the State Cryptography Administration, and has now become a national standard (see GB / T 32918.2-2016 "Information Security Technology SM2 Elliptic Curve Public Key Cryptographic Algorithm Part 2: Digital Signature Algorithm"). Based on this algorithm, digital signatures, key exchange and data encryption can be realized. The digital signature is briefly described as follows:
[0003] Use the user's SM2 private key d A When a message M is digitally signed, r and s need to be calculated, where r = (e + x 1 ) mod n, where n is the order of the base point G of the SM2 elliptic curve, and e is the hash value (i.e., hash value, hash value) derived from the user ID and the message M (according to the SM2 algorithm, e is derived from the user ID A The hash value Z derived from the same parameters A The hash value of the data after merging with the message M, see SM2 specification), x 1 Taken from (x 1 ,y 1 )=Q, and Q=[k]G, where G is the base point of the SM2 elliptic curve; calculate s=((1+d A ) -1 kr(1+d A ) -1 d A )mod n, where k is a randomly selected integer in the interval [1,n-1], then (r,s) is the digital signature for the message M (note that the symbol used for mod n in the SM2 specification is modn).
[0004] The security of the user's signature private key is extremely important in digital signatures. Therefore, for security reasons, the private key should usually be generated, stored and used in dedicated cryptographic hardware. However, for various reasons, people often have or need to implement the SM2 digital signature algorithm in a pure software manner. In this case, the user's private key is not generated, stored and used in dedicated cryptographic hardware, but stored in the permanent storage medium of the computing device. The private key is generated and used in the memory of the computing device, which poses a risk of the private key being stolen or misused. In response to the risk of the signature private key being stolen or misused when implementing the SM2 digital signature algorithm in a pure software manner, people have proposed a series of SM2 digital signature collaborative generation methods based on secret sharing. In these methods, the user's SM2 signature private key or the secret of the signature private key is divided into multiple parts, called secret shares, which are stored and used in multiple devices respectively, one of which is stored and used in the user's computing device, and the other one or more secret shares are stored and used in computing devices with a very high security protection level (such as a cryptographic server); when it is necessary to use the user's SM2 private key to digitally sign a message M, multiple computing devices use their respective secret shares to obtain a digital signature for the message M through secure collaborative calculation. The so-called secure collaborative calculation means that during this calculation process, the secret share of each device will not be leaked or cracked.
[0005] The "Electronic Signature Law of the People's Republic of China" requires that the electronic signature production data is only controlled by the signer, and dividing the private key or the related secrets of the private key into multiple parts and storing them in multiple devices for use in digital signatures does not fully meet this requirement, because other entities other than the user have mastered part of the secret of the user's private key, namely the signature production data, that is, when the digital signature is generated, the signature production data is not only controlled by the signer. Therefore, for the implementation of SM2 digital signatures using non-hardware methods, it is necessary to ensure that the digital signature production data, namely the user's signature private key, is only controlled by the signer when the digital signature is generated, and to ensure the security of the digital signature generation process. Preventing the user's signature private key from being leaked or cracked is a problem that needs to be solved. Summary of the invention
[0006] The purpose of the present invention is to propose a technical solution to the problems existing in implementing the SM2 digital signature algorithm in an environment where non-cryptographic hardware is adopted at the user end, so as to overcome the shortcomings of the prior art.
[0007] In view of the purpose of the present invention, the technical solution proposed by the present invention includes a safe and controllable use method of SM2 signature production data and a corresponding system.
[0008] In the following description of the technical solution of the present invention, if P and Q are elements (points) in the elliptic curve point group, then P+Q represents the point addition of P and Q, PQ represents P plus the inverse of Q, [k]P represents the point addition of k elliptic curve points P, that is, P+P+...+P (there are k Ps in total); the ellipsis "..." represents multiple data items of the same (type) or multiple operations of the same type; -1 represents the modulo n multiplicative inverse of an integer c (i.e., cc -1 mod n=1); unless otherwise specified, the multiplication inverse in this patent application is the modulo n multiplication inverse of the order n of the SM2 elliptic curve point group (i.e., the order n of the base point G); when multiple integers are multiplied (including integer sign multiplication, constant and integer sign multiplication), the multiplication sign "·" is omitted if no ambiguity is generated, such as k 1 ·k 2 Simplified to k 1 k 2 , 3·c is simplified to 3c; mod n represents modulo operation, which corresponds to modn in GB / T32918.2-2016 "Information Security Technology SM2 Elliptic Curve Public Key Cryptography Algorithm Part 2: Digital Signature Algorithm"; in addition, the priority of the operator mod n of the modulo operation is the lowest, such as a+b mod n is equivalent to (a+b) mod n, ab mod n is equivalent to (ab) mod n, and ab mod n is equivalent to (ab) mod n.
[0009] In the solution of the present invention, the calculation s=((1+d A ) -1 kr(1+d A ) -1 d A ) mod n, which is converted into the calculation of s = ((k + r)(1 + d A ) -1 -r)mod n.
[0010] The safe and controllable use method of the SM2 signature production data of the present invention is as follows.
[0011] Signature device has P A =[d A ]G,c A1 =(c 0 (1+d A ) -1 )mod n,t 2 =E H ((c 0 ) -1 ), where G is the base point of the SM2 elliptic curve point group, d A The user's SM2 signature private key, PA The signature private key d A The corresponding SM2 public key, n is the order of the base point G (that is, the order of the SM2 elliptic curve point group), n is a prime number, (1+d A ) -1 is (1+d A ) modulo n multiplicative inverse (i.e. ((1+d A ) -1 (1+d A ))mod n=1), c 0 is a secret integer in [1,n-1] unknown to the signature device, c A1 is the secret of the signature device, (c 0 ) -1 c 0 Modulo n multiplicative inverse, E H ((c 0 ) -1 ) means for (c 0 ) -1 Encryption operation (c A1 The encrypted data (1+d A ) -1 , c 0 is the encryption key);
[0012] For (c 0 ) -1 The encryption operation E H (·) includes encryption operations of the multiplier encryption algorithm, referred to as multiplier encryption operations, and encryption operations of the homomorphic encryption algorithm, referred to as homomorphic encryption operations, where homomorphic encryption operations include encryption operations of the additive homomorphic encryption algorithm and encryption operations of the fully homomorphic encryption algorithm (note that encryption algorithms are different from encryption operations, and encryption algorithms include encryption operations and decryption operations);
[0013] If the encryption operation E H (·) is the multiplier encryption operation, then:
[0014] t 2 =E H ((c 0 ) -1 )=((c 0 ) -1 (t 0 ) -1 ) mod n (multiplier encryption), where (t 0 ) -1 t 0 The modulo n multiplicative inverse of 0 is to calculate t 2When t is a random integer selected from [1,n-1] as the key for the multiplier encryption operation (multiplier encryption key, which is a symmetric key), or t 0 is the multiplier encryption key of the signature auxiliary system in [1,n-1] (an integer);
[0015] If the encryption operation E H (·) is a homomorphic encryption operation, then:
[0016] t 2 =E H ((c 0 ) -1 ) is the result of encryption operation using the public key of the homomorphic encryption algorithm of the signature auxiliary system, or the result of encryption operation using the public key of the public-private key pair (key pair) of the temporarily generated homomorphic encryption algorithm, which is the same as the encryption operation E H (·) The private key corresponding to the public key used for decryption operation is t 0 ;
[0017] E H (·) corresponds to the decryption operation D H (·)(decryption operation of the multiplier encryption algorithm or the decryption operation of the homomorphic encryption algorithm); multiplier decryption operation D H The key t of (·) 0 and homomorphic decryption operation D H The private key t of (·) 0 (The private key t of the temporarily generated homomorphic encryption algorithm 0 Or the private key t of the homomorphic encryption algorithm of the signature auxiliary system 0 ) is called the decryption operation D H (·) decryption key;
[0018] If 0 is a temporarily generated key of a multiplier encryption algorithm or a temporarily generated private key of a homomorphic encryption algorithm, then:
[0019] Key 0 After encryption using the symmetric key of the signature auxiliary system, t 0 The ciphertext g 2 , or, key t 0 After encryption using the public key of the signature auxiliary system, t 0 The ciphertext g 2 (The public key of the signature auxiliary system includes a common public key such as the public key of the RSA and SM2 algorithms, or a group public key of the group encryption algorithm); the signature device has t 0 The ciphertext g 2 ;
[0020] (g 2 =E(t 0), where E(t 0 ) represents the key t 0 Encryption, where E(·) is not necessarily a simple encryption operation)
[0021] If t 0 is the multiplier encryption key of the signature auxiliary system or the private key of the homomorphic encryption algorithm of the signature auxiliary system, then g 2 Empty (i.e., none);
[0022] (Signature device has P A =[d A ]G,c A1 =(c 0 (1+d A ) -1 )mod n,t 2 =E H ((c 0 ) -1 ), g 2 =E(t 0 ))
[0023] When you need to use the user's SM2 private key d A When digitally signing a message M, the signature device and the signature auxiliary system generate a digital signature as follows (need to use the user's SM2 signature private key d A , the subject that digitally signs the message M may be an application or system that calls the cryptographic function of the signing device inside or outside the signing device):
[0024] Before or when digitally signing a message M, the signing device randomly selects an integer t in [1, n-1] 1 , calculate c 1 =(t 1 c A1 )mod n(c 1 The encrypted data (1+d A ) -1 , (c 0 t 1 ) mod n is the multiplier encryption key);
[0025] If E H (·) is a multiplier encryption operation, then the signature device uses t 2 =E H ((c 0 ) -1 ) Calculate c 2 =E H ((c 0 ) -1 (t 1 ) -1), where (t 1 ) -1 t 1 The modulo n multiplicative inverse (ie ((t 1 ) -1 t 1 )mod n=1, at this time, c 2 =E H ((c 0 ) -1 (t 1 ) -1 )=((c 0 ) -1 t 2 )mod n);
[0026] If E H (·) is the encryption operation of the homomorphic encryption algorithm, then the signature device uses t 2 =E H ((c 0 ) -1 ) and homomorphic encryption operation to obtain c 2 =E H ((c 0 ) -1 (t 1 ) -1 (mod n));
[0027] (P A =[d A ]G,c 1 =(t 1 c 0 (1+d A ) -1 )mod n,c 2 =E H ((t 1 c 0 ) -1 (mod n)), g 2 =E(t 0 ))
[0028] The signature device uses the message M to calculate the subsequent calculation r = (e + x 1 ) mod n hash value e (according to SM2 algorithm, e is the user ID A The hash value Z derived from the same parameters A The hash value of the data after merging with the message M, see SM2 specification);
[0029] The signature device will P A , e is sent to the signature assistance system;
[0030] The signature device randomly selects an integer k in [1,n-1]1 , calculate Q 1 =[k 1 ]G;
[0031] The signature assistance system randomly selects an integer k in [1,n-1] 2 , calculate Q 2 =[k 2 ](G+P A );
[0032] (Q 1 =[k 1 ]G,Q 2 =[k 2 (1+d A )]G)
[0033] The signature device and the signature auxiliary system ensure that the other party does not reselect k 1 , k 2 , without recalculating Q 1 , Q 2 In the case of Q 1 , Q 2 (Send to the other party);
[0034] In order to ensure that the other party does not reselect k 1 , k 2 , without recalculating Q 1 , Q 2 In the case of Q 1 , Q 2 It means that one party cannot receive the Q 1 or Q 2 Then reselect your k 2 or k 1 , and then recalculate Q 2 or Q 1 ;
[0035] The signature device calculates Q = Q 1 +Q 2 ;
[0036] Signature Assisted System Calculation Q f =Q 1 +Q 2 ;
[0037] (Q=[k 1 +k 2 (1+d A )]G,Q f =[k 1 +k 2 (1+d A )]G)
[0038] The signature device and signature auxiliary system check Q and Q respectively. f Is it zero (infinity point)? If Q and / or Q f If it is zero, reselect k 1 , k 2 , recalculate Q, Q f , until Q and Q f is a non-zero element;
[0039] The signature device calculates r = (e + x 1 ) mod n, where x 1 Taken from (x 1 ,y 1 ) = Q;
[0040] Signature Assist System Calculation f =(e+x 1f ) mod n, where x 1f Taken from (x 1f ,y 1f )=Q f ;
[0041] The signature device and the signature auxiliary system respectively check whether (s+r) mod n = 0 and / or (s+r f ) mod n = 0 (i.e., whether (k + r) mod n = 0 and / or (k + r f ) mod n = 0), if yes, go to error handling, otherwise, continue;
[0042] Signature device calculations 1 =((k 1 +r)c 1 )mod n;
[0043] (Usually, the signature device checks s 1 Is it 0 (digit 0), if so, the signature device and signature auxiliary system reselect k 1 , k 2 , recalculate Q, Q f , recalculate r and r f , until s 1 Not 0)
[0044] (s 1 =((k 1 +r)(t 1 c 0 (1+d A ) -1 ))mod n)
[0045] The signature device will P A 、s 1、c 2 , g 2 Transmitted to the signature assistance system;
[0046] (Typically, the Signature Assistance System checks 1 Is it 0 (number 0), if so, then go to error handling, for example, recalculate, if not, then continue)
[0047] If g 2 Not empty (that is, the decryption key t 0 is a temporarily generated key, including a temporarily generated multiplier encryption key and a temporarily generated private key in a key pair of a homomorphic encryption algorithm), then the signature auxiliary system decrypts g 2 Get the c 2 The key t for decryption operation 0 , using the decryption key t 0 C 2 Perform decryption operation to obtain c 2m =D H (c 2 )mod n(Under normal circumstances, c 2m =((c 0 ) -1 (t 1 ) -1 )mod n);
[0048] If g 2 If it is empty, the signature auxiliary system directly uses the one it has for decryption operation D H The decryption key t of (·) 0 (multiplier decryption key or homomorphic encryption algorithm private key) to c 2 Perform decryption operation to obtain c 2m =D H (c 2 )mod n(Under normal circumstances, c 2m =((c 0 ) -1 (t 1 ) -1 )mod n);
[0049] Signature Assisted System Calculations 2 =(s 1 c 2m ) mod n (You can check s before calculating 1 Is it 0?
[0050] (Q=[k 1 +k 2 (1+d A )]G,Q f =[k 1 +k2 (1+d A )]G,s 2 =((k 1 +r)(1+d A ) -1 )mod n)
[0051] The signature auxiliary system calculates s = ((k 2 +s 2 )-r f )mod n, send s to the signing device;
[0052] (Q=[k 1 +k 2 (1+d A )]G,Q f =[k 1 +k 2 (1+d A )]G,s=((k 2 +(k 1 +r)(1+d A ) -1 -r f )mod n)
[0053] The signature assistance system verifies s before sending it to the signing device. 2 Or whether s is using the public key P A The corresponding private key d A Calculated, if verification fails, it will go into error handling;
[0054] After the signing device receives s, it verifies whether s is signed using the public key P A The corresponding private key d A Calculated according to the calculation method of SM2 digital signature, if the verification is successful, (r, s) is the digital signature of message M, if the verification is not successful, it will enter error processing;
[0055] (Q=[k 1 +k 2 (1+d A )]G,Q f =[k 1 +k 2 (1+d A )]G,
[0056] s=((k 2 +(k 1 +r)(1+d A ) -1 -r)mod n=((k 1 +k 2 (1+d A )+r)(1+dA ) -1 -r)mod n)
[0057] In the above calculation formula, for an integer a, a(mod n) represents a number that is congruent to a modulo n (two integers a and b modulo n are congruent, i.e., a mod n = b mod n, which is represented by a≡b(mod n), and the (mod n) operator has the lowest priority);
[0058] The signature assistance system assists and helps the signature device to complete the generation of the digital signature (for example, calculate s 2 or s), first verify whether the user using the signature device, i.e. the signer, is the person with the public key P A The owner of
[0059] The signature assistance system is a device or system that assists and cooperates with the signature device to complete the generation of the SM2 digital signature;
[0060] The signature device, i.e. the computing device owned by the signer, is a device with computing capabilities and including hardware and software (such as personal computers, mobile terminals such as mobile phones); the signature device implements the above-mentioned digital signature collaborative calculation steps through the cryptographic module and cryptographic program implemented therein, and implements the SM2 digital signature function.
[0061] For the above secure and controllable use method of SM2 signature production data, the calculation c is updated before or when generating a digital signature. 1 、c 2 Not required (i.e. multiple digital signatures can use the same 1 、c 2 ).
[0062] For the above secure and controllable use of SM2 signature production data, it is allowed to calculate c 1 、c 2 When fixed, take t 1 =1, i.e. fixed c 1 =c A1 , c 2 =t 2 ; If t is fixed 1 =1, then for (c 0 ) -1 The encryption operation t 2 =E H ((c 0 ) -1 ) allows encryption with symmetric key cryptography or public key cryptography other than multiplicative encryption and homomorphic encryption, where the signature auxiliary system has decryption t 2 Get (c 0 ) -1 The key (symmetric key or private key).
[0063] Regarding the above-mentioned safe and controllable use method of SM2 signature making data, the signature device and the signature auxiliary system ensure that the other party does not reselect k 1 , k 2 , without recalculating Q 1 , Q 2 In the case of Q 1 , Q 2 One way to do this is as follows:
[0064] Signature Device Complete Q 1 =[k 1 ]After calculating G, calculate Q 1 The hash value h 1 , h 1 Send to the signature assistance system;
[0065] Signature Assist System Complete Q 2 =[k 2 ](G+P A ) After calculation, calculate Q 2 The hash value h 2 , h 2 Send to the signature device;
[0066] The signature device receives the signature assistance system's h 2 After that, Q 1 Send to the signature assistance system;
[0067] The signature assistance system receives the signature device's h 1 After that, Q 2 Send to the signature device;
[0068] The signature device receives Q 2 After that, calculate and check Q 2 Is the hash value of h 2 If not, then go to error handling, if so, then accept Q 2 ;
[0069] Signature Assist System receives Q 1 After that, calculate and check Q 1 Is the hash value of h 1 If not, then go to error handling, if so, then accept Q 1 .
[0070] For the above-mentioned safe and controllable use method of SM2 signature production data, the signature device and the signature auxiliary system respectively check whether (s+r) mod n = 0 and / or (s+r) will appear in the subsequent calculation. f ) mod n = 0 is as follows:
[0071] The signature device checks whether Q+[r]G is the zero element (point at infinity) of the SM2 elliptic curve point group. If so, (s+r) mod n = 0 will occur, otherwise not;
[0072] Signature Assist System Check Q f +[r f ] Is G the zero element (point at infinity) of the SM2 elliptic curve point group? If so, then (s+r f ) mod n = 0, otherwise not.
[0073] For the above-mentioned secure and controllable use method of SM2 signature production data, the signature auxiliary system verifies s before sending s to the signature device. 2 Or whether s is using the public key P A The corresponding private key d A One way to calculate this is as follows:
[0074] Signature Assist System Check Q 1 +[r f ]G and [s 2 ](G+P A ) are the same, if they are the same, then s 2 is to use the public key P A The corresponding private key d A Calculated, otherwise not;
[0075] or,
[0076] Signature Assist System Check Q f +[r f ]G and [(s+r f )mod n](G+P A ) are the same, if they are the same, then s is the public key P A The corresponding private key d A Calculated, otherwise not.
[0077] For the above-mentioned secure and controllable use method of SM2 signature production data, after the signature device receives s, it verifies whether s is a signature using the public key P A The corresponding private key d A A method calculated according to the SM2 digital signature is as follows:
[0078] The signature device checks Q+[r]G and [(s+r)mod n](G+P A ) are the same, if they are the same, the verification passes, otherwise, the verification fails.
[0079] For the above-mentioned secure and controllable use method of SM2 signature production data, it is necessary to identify and confirm whether the user using the signature device, i.e. the signer, is the public key P A There are many ways to find the owner of the user's public key P. A It is bound to the user's account in the signature assistance system. The user must first use the account name to complete the login (identity authentication) in the signature assistance system to use the signature assistance system. In fact, there are other ways to do not need to bind the user's account in the signature assistance system with the public key P A For the binding solution, users can even log in to the signature assistance system anonymously and still complete the relevant identification and confirmation. The following solutions support anonymous identification and confirmation.
[0080] For the above-mentioned secure and controllable use method of SM2 signature production data, the signature auxiliary system identifies and confirms whether the user using the signature device, i.e. the signer, is the public key P A A method for the owner of is as follows:
[0081] In the public key P A After generation, it contains the public key P A , the data combination of the user's (i.e., the signer's) identity authentication information forms public key authentication information (user identity authentication information is private data known or owned only by the public key or private key owner, such as a password, biometric authentication information, or an electronic communication address used to send verification confirmation information, such as a mobile phone number, email address, etc. Strictly speaking, user identity authentication information is public key ownership authentication information, not identity authentication information, because the user's name or account name is not required and it can be anonymous), the public key authentication information is encrypted using a symmetric key cryptographic algorithm and the symmetric key of the signature auxiliary system to obtain the encrypted public key authentication information, or the public key authentication information is digitally signed and encrypted using a public key cryptographic algorithm Obtaining the public key authentication information of the signature encryption, wherein the signature encryption includes signing first and then encrypting, or encrypting first and then signing, wherein the signature uses the private key of the public key registration system, and the encryption uses the public key of the signature auxiliary system (the public key of the signature auxiliary system includes the common RSA, SM2 public key, and the group public key of the group encryption algorithm); the public key authentication information encrypted by the symmetric key and the public key authentication information encrypted by the public key cryptographic algorithm are collectively referred to as the encrypted public key authentication information (public key encryption can use random symmetric key to encrypt data, and public key encryption uses random symmetric key); the encrypted public key authentication information is stored in the signature device; the public key registration system is a system for registering and managing user public keys;
[0082] When the signature assistance system needs to authenticate and confirm whether the user using the signature device, i.e. the signer, is the person with the public key P A When the owner of the signature is identified, the signature device submits the encrypted public key authentication information to the signature auxiliary system;
[0083] The signature auxiliary system decrypts the encrypted public key authentication information to obtain the plain text of the public key authentication information. For the signature encrypted public key authentication information, the signature auxiliary system also verifies the validity of the digital signature and continues after the verification is passed;
[0084] The signature auxiliary system determines the public key P contained in the public key authentication information obtained by decryption A Is it the public key P currently used for digital signature generation and verification? A (For example, verify s 2 and / or s's public key P A ), if not, go to error handling, if so, continue;
[0085] The signature auxiliary system obtains the user identity authentication information from the decrypted public key authentication information, and then uses the user identity authentication information to authenticate the user of the signature device, i.e. the signer. If the user identity authentication passes, it is confirmed that the user using the signature device, i.e. the signer, is the person with the public key P. A Otherwise, the authentication fails.
[0086] For the secure and controllable use method of the SM2 signature production data of the present invention, the user's SM2 signature private key d is generated. A 、Public key P A The methods include:
[0087] P A d A Generation method 1:
[0088] The user (signer or initializer) uses the signature device to generate d A , calculate P A =[d A ]G, randomly select an integer c in [1,n-1] 0 , calculate c A1 =(c 0 (1+d A ) -1 )mod n,t 2 =E H ((c 0 ) -1 ), where E H ((c 0 ) -1 ) means for (c 0 ) -1 Encryption operation:
[0089] If the encryption operation E H (·) is the multiplier encryption operation, then:
[0090] The signature device randomly selects an integer t in [1,n-1]0 As the key (symmetric key) for the multiplier encryption operation, calculate t 2 =E H ((c 0 ) -1 )=((c 0 ) -1 (t 0 ) -1 ) mod n (multiplier encryption), where (t 0 ) -1 t 0 The modulo n multiplicative inverse of ;
[0091] If the encryption operation E H (·) is a homomorphic encryption operation, then:
[0092] The signing device temporarily generates a key pair (public-private key pair) of the homomorphic encryption algorithm, where the private key is t 0 , and then use the homomorphic encryption algorithm to use the public key pair (c 0 ) -1 Perform encryption operation to obtain t 2 =E H ((c 0 ) -1 ),
[0093] Alternatively, the signing device uses the public key of the homomorphic encryption algorithm of the signature auxiliary system to perform a homomorphic encryption on (c 0 ) -1 Perform encryption operation to obtain t 2 =E H ((c 0 ) -1 ), the private key used for decryption operation corresponding to the public key used in the encryption operation is the private key t of the homomorphic encryption algorithm of the signature auxiliary system 0 ;
[0094] If 0 is a temporarily generated key of a multiplier encryption algorithm or a temporarily generated private key of a homomorphic encryption algorithm, then the signature device uses the public key of the signature auxiliary system and the public key cryptographic algorithm to 0 Encrypted to get g 2 (The public key of the signature auxiliary system includes a common public key such as the public key of the RSA and SM2 algorithms, or a group public key of the group encryption algorithm);
[0095] (P A =[d A ]G,c A1 =(c 0 (1+d A ) -1 )mod n,t 2=E H ((c 0 ) -1 ), g 2 =E(t 0 ), where E(t 0 ) represents the key t 0 Encryption, where E(·) is not necessarily a simple encryption operation)
[0096] P A d A Generation method 2:
[0097] The user (signer or initializer) uses a computing device other than the signing device to press P A d A Generate method 1 in the same way to generate d A , calculate P A =[d A ]G,c A1 =(c 0 (1+d A ) -1 )mod n,t 2 =E H ((c 0 ) -1 ), g 2 (At this time, all P A d A In the first generation method, the calculation originally performed by the signature device is changed to a calculation device other than the signature device), and then d A 、c 0 ,t 0 Destroy, A 、c A1 ,t 2 , g 2 Export, (through a certain method) P A 、c A1 ,t 2 , g 2 Import to the signature device;
[0098] P A d A Generation method three:
[0099] The user (signer or initializer) uses a computing device other than the signing device to randomly select an integer d in [1, n-1] 2 、c 0 , calculate G 2 =[(d 2 ) -1 ]G,c A2 =(c 0 d2 )mod n,t 2 =E H ((c 0 ) -1 ), where (d 2 ) -1 is d 2 The modulo n multiplicative inverse (i.e. ((d 2 ) -1 d 2 )mod n=1), (c 0 ) -1 c 0 Modulo n multiplicative inverse, E H ((c 0 ) -1 ) means for (c 0 ) -1 Encryption operations;
[0100] If the encryption operation E H (·) is the multiplier encryption operation, then:
[0101] The computing device other than the signature device randomly selects an integer t in [1,n-1] 0 As the key (symmetric key) for the multiplier encryption operation, calculate t 2 =((c 0 ) -1 (t 0 ) -1 ) mod n (multiplier encryption), where (t 0 ) -1 t 0 The modulo n multiplicative inverse of ;
[0102] If the encryption operation E H (·) is a homomorphic encryption operation, then:
[0103] The computing device other than the signing device temporarily generates a key pair (public-private key pair) of the homomorphic encryption algorithm, where the private key is t 0 , and then use the homomorphic encryption algorithm to use the public key pair (c 0 ) -1 Perform encryption operation to obtain t 2 =E H ((c 0 ) -1 ),
[0104] Alternatively, a computing device other than the signing device uses the public key of the homomorphic encryption algorithm of the signature auxiliary system to perform a homomorphic encryption on (c 0 ) -1 Perform encryption operation to obtain t 2 =E H((c 0 ) -1 ), the private key used for decryption operation corresponding to the public key used in the encryption operation is the private key t of the homomorphic encryption algorithm of the signature auxiliary system 0 ;
[0105] If 0 is a temporarily generated key of a multiplier encryption algorithm or a temporarily generated private key of a homomorphic encryption algorithm, then a computing device other than the signature device uses the public key of the signature auxiliary system and the public key cryptographic algorithm to perform a 0 Encrypted to get g 2 (The public key of the signature auxiliary system includes a common public key such as the public key of the RSA and SM2 algorithms, or a group public key of the group encryption algorithm);
[0106] The computing device other than the signing device will 2 、c 0 ,t 0 Destroy, the user (signer or initializer) will G 2 、c A2 ,t 2 , g 2 From a computing device other than the signature device, (by a certain method) G 2 、c A2 ,t 2 , g 2 Import signature device (g 2 May be empty, i.e. None);
[0107] (G 2 =[(d 2 ) -1 ]G,c A2 =(c 0 d 2 )mod n,t 2 =E H ((c 0 ) -1 ), g 2 =E(t 0 ))
[0108] The signature device randomly selects an integer d in [1,n-1] 1 , calculate P A =[(d 1 ) -1 ]G 2 -G, calculate c A1 =(d 1 c A2 )mod n, change d 1 destroy;
[0109] (At this time d 1d 2 ≡(1+d A ) -1 (mod n), P A =[d A ]G)
[0110] P A d A Generation method 4:
[0111] The user (i.e., the signer) uses a signature device (e.g., anonymously) to send a private key collaborative generation request to the key collaborative generation system;
[0112] The key collaborative generation system randomly selects an integer d in [1,n-1] 2 、c 0 , calculate G 2 =[(d 2 ) -1 ]G,c A2 =(c 0 d 2 )mod n,t 2 =E H ((c 0 ) -1 ), where (d 2 ) -1 is d 2 The modulo n multiplicative inverse (i.e. ((d 2 ) -1 d 2 )mod n=1), (c 0 ) -1 c 0 Modulo n multiplicative inverse, E H ((c 0 ) -1 ) means for (c 0 ) -1 Encryption operations;
[0113] If the encryption operation E H (·) is the multiplier encryption operation, then:
[0114] The key collaborative generation system randomly selects an integer t in [1,n-1] 0 As the key (symmetric key) for the multiplier encryption operation, calculate t 2 =((c 0 ) -1 (t 0 ) -1 )mod n (multiplier encryption), its (t 0 ) -1 t 0 The modulo n multiplicative inverse of
[0115] Alternatively, the key collaborative generation system uses the signature auxiliary system to encrypt the multiplier key t in [1,n-1] 0 , calculate t 2 =((c 0 ) -1 (t 0 ) -1 )mod n;
[0116] If the encryption operation E H (·) is a homomorphic encryption operation, then:
[0117] The key collaborative generation system temporarily generates a key pair (public-private key pair) of the homomorphic encryption algorithm, where the private key is t 0 , and then use the homomorphic encryption algorithm to use the public key pair (c 0 ) -1 Perform encryption operation to obtain t 2 =E H ((c 0 ) -1 ),
[0118] Alternatively, the key collaborative generation system uses the public key of the homomorphic encryption algorithm of the signature auxiliary system and uses the homomorphic encryption algorithm to encrypt (c 0 ) -1 Perform encryption operation to obtain t 2 =E H ((c 0 ) -1 ), the private key used for decryption operation corresponding to the public key used in the encryption operation is the private key t of the homomorphic encryption algorithm of the signature auxiliary system 0 ;
[0119] If 0 is a temporarily generated key of a multiplier encryption algorithm or a temporarily generated private key of a homomorphic encryption algorithm, then:
[0120] The key collaborative generation system uses a symmetric key cryptographic algorithm and a symmetric key pair key of a signature auxiliary system. 0 Encrypted to get g 2 (t 0 The encryption key t for the multiplier 0 Or the private key t in the key pair of the temporarily generated homomorphic encryption algorithm 0 ), or the key collaborative generation system uses the public key of the signature auxiliary system and the public key cryptographic algorithm to generate t 0 Encrypted to get g 2 (The public key of the signature auxiliary system includes a common public key such as the public key of the RSA and SM2 algorithms, or a group public key of the group encryption algorithm);
[0121] (g2 =E(t 0 ), where E(t 0 ) represents the key t 0 Encryption, where E(·) is not necessarily a simple encryption operation)
[0122] If t 0 is the multiplier encryption key of the signature auxiliary system or the private key of the homomorphic encryption algorithm of the signature auxiliary system, then g 2 Empty (i.e., none);
[0123] The key collaborative generation system then converts d 2 、c 0 ,t 0 Destroy, G 2 、c A2 ,t 2 , g 2 Return to the signature device (g 2 May be empty, i.e. None);
[0124] (G 2 =[(d 2 ) -1 ]G,c A2 =(c 0 d 2 )mod n,t 2 =E H ((c 0 ) -1 ), g 2 =E(t 0 ))
[0125] The signature device randomly selects an integer d in [1,n-1] 1 , calculate P A =[(d 1 ) -1 ]G 2 -G, calculate c A1 =(d 1 c A2 )mod n, change d 1 destroy;
[0126] The signature device verifies P without revealing its own secrets. A Is it a private key? A 's public key, and (c A1 t 2m ) mod n is (1+d A ) -1 , where t 2m Indicates t 2 The corresponding plaintext number (normally (c 0 )-1 , that is, verify the calculation c A2 ,t 2 c 0 、(c 0 ) -1 Is it derived from the same c 0 , and they are mutually inverse modulo n multiplication, that is, (c 0 (c 0 ) -1 )mod n=1);
[0127] If the verification is successful, then d 1 d 2 ≡(1+d A ) -1 (mod n), P A =[d A ]G,c A1 =((1+d A ) -1 c 0 )mod n,t 2 =E H ((c 0 ) -1 ), where d 1 d 2 ≡(1+d A ) -1 (mod n) means d 1 d 2 and (1+d A ) -1 Modulo n is congruent, otherwise, go to error handling;
[0128] (P A =[d A ]G,c A1 =(c 0 (1+d A ) -1 )mod n,t 2 =E H ((c 0 ) -1 ), g 2 =E(t 0 ))
[0129] P A d A Generation method five:
[0130] The key collaborative generation system has G d =[(d 0 ) -1 ], where d 0 is the integer secret of the key cooperative generation system in [1,n-1], (d0 ) -1 is d 0 The modulo n multiplicative inverse of ;
[0131] The user (i.e., the signer) uses a signature device (e.g., anonymously) to send a private key collaborative generation request to the key collaborative generation system;
[0132] The key collaborative generation system randomly selects an integer d in [1,n-1] 2 、c 0 , calculate d 20 =((d 2 ) -1 d 0 )modn,c A2 =(c 0 d 2 )mod n,t 2 =E H ((c 0 ) -1 ), where (d 2 ) -1 is d 2 The modulo n multiplicative inverse (i.e. ((d 2 ) -1 d 2 )mod n=1), (c 0 ) -1 c 0 Modulo n multiplicative inverse, E H ((c 0 ) -1 ) means for (c 0 ) -1 Encryption operations;
[0133] If the encryption operation E H (·) is the multiplier encryption operation, then:
[0134] The key collaborative generation system randomly selects an integer t in [1,n-1] 0 As the key (symmetric key) for the multiplier encryption operation, calculate t 2 =((c 0 ) -1 (t 0 ) -1 )mod n (multiplier encryption), its (t 0 ) -1 t 0 The modulo n multiplicative inverse of
[0135] Alternatively, the key collaborative generation system uses the signature auxiliary system to encrypt the multiplier key t in [1,n-1] 0 , calculate t 2 =((c0 ) -1 (t 0 ) -1 )mod n;
[0136] If the encryption operation E H (·) is a homomorphic encryption operation, then:
[0137] The key collaborative generation system temporarily generates a key pair (public-private key pair) of the homomorphic encryption algorithm, where the private key is t 0 , and then use the homomorphic encryption algorithm to use the public key pair (c 0 ) -1 Perform encryption operation to obtain t 2 =E H ((c 0 ) -1 ),
[0138] Alternatively, the key collaborative generation system uses the public key of the homomorphic encryption algorithm of the signature auxiliary system and uses the homomorphic encryption algorithm to encrypt (c 0 ) -1 Perform encryption operation to obtain t 2 =E H ((c 0 ) -1 ), the private key used for decryption operation corresponding to the public key used in the encryption operation is the private key t of the homomorphic encryption algorithm of the signature auxiliary system 0 ;
[0139] If 0 is a temporarily generated key of a multiplier encryption algorithm or a temporarily generated private key of a homomorphic encryption algorithm, then:
[0140] The key collaborative generation system uses a symmetric key cryptographic algorithm and a symmetric key pair key of a signature auxiliary system. 0 Encrypted to get g 2 (t 0 The encryption key t for the multiplier 0 Or the private key t in the key pair of the temporarily generated homomorphic encryption algorithm 0 ), or the key collaborative generation system uses the public key of the signature auxiliary system and the public key cryptographic algorithm to generate t 0 Encrypted to get g 2 (The public key of the signature auxiliary system includes a common public key such as the public key of the RSA and SM2 algorithms, or a group public key of the group encryption algorithm);
[0141] (g 2 =E(t 0 ), where E(t 0 ) represents the key t 0Encryption, where E(·) is not necessarily a simple encryption operation)
[0142] If t 0 is the multiplier encryption key of the signature auxiliary system or the private key of the homomorphic encryption algorithm of the signature auxiliary system, then g 2 Empty (i.e., none);
[0143] The key collaborative generation system then converts d 2 、c 0 ,t 0 Destroy, G d d 20 、c A2 ,t 2 , g 2 Return to the signature device (g 2 May be empty, i.e. None);
[0144] (G d =[(d 0 ) -1 ]G,d 20 =((d 2 ) -1 d 0 )mod n,c A2 =(c 0 d 2 )mod n,t 2 =E H ((c 0 ) -1 ), g 2 =E(t 0 ))
[0145] The signature device randomly selects an integer d in [1,n-1] 1 , calculate P A =[((d 1 ) -1 d 20 )mod n]G d -G, calculate c A1 =(d 1 c A2 )mod n, change d 1 d 20 destroy;
[0146] The signature device verifies P without revealing its own secrets. A Is it a private key? A 's public key, and (c A1 t 2m ) mod n is (1+d A ) -1 , where t2m Indicates t 2 The corresponding plaintext number (normally (c 0 ) -1 , that is, verify the calculation c A2 ,t 2 c 0 、(c 0 ) -1 Is it derived from the same c 0 , and they are mutually inverse modulo n multiplication, that is, (c 0 (c 0 ) -1 )mod n=1);
[0147] If the verification is successful, then d 1 d 2 ≡(1+d A ) -1 (mod n), P A =[d A ]G,c A1 =((1+d A ) -1 c 0 )mod n,t 2 =E H ((c 0 ) -1 ), where d 1 d 2 ≡(1+d A ) -1 (mod n) means d 1 d 2 and (1+d A ) -1 Modulo n is congruent, otherwise, go to error handling;
[0148] (P A =[d A ]G,c A1 =(c 0 (1+d A ) -1 )mod n,t 2 =E H ((c 0 ) -1 ), g 2 =E(t 0 ))
[0149] The signature device implements the above SM2 signature private key generation steps through the private key generation function component (program, program module) implemented therein to generate the user private key d A 、Public key P A and data c A1 ,t2 , g 2 .
[0150] The above P A d A The generation method indirectly generates the user SM2 signature private key d A and public key P A .
[0151] Based on the above-mentioned safe and controllable use method of SM2 signature production data, a corresponding safe and controllable use system of SM2 signature production data can be constructed, the system includes a signature device and a signature auxiliary system, wherein the signature device has P A =[d A ]G,c A1 =(c 0 (1+d A ) -1 )mod n,t 2 =E H ((c 0 ) -1 ), c A1 The secret of the signature device; when the user's SM2 private key d is needed A When digitally signing a message M, the signature device and the signature auxiliary system generate a digital signature for the message M according to the secure and controllable use method of the SM2 signature production data.
[0152] Based on the technical solution of the present invention, the signature making data (1+d A ) -1 Completely controlled by the signer, with the ciphertext c A1 The digital signature is stored in the form of ciphertext in its computing device, and is also used in the form of ciphertext during the digital signature generation process, and c A1 It is also kept secret as a signature device, which effectively prevents the signature production data (1+d A ) -1 Leaked; the number of c transmitted by the signature device to the signature auxiliary system during the signature generation process 2 is non-secret, and the number (c 0 t 1 ) -1 does not appear in the final digital signature (the number c 0 t 1 or (c 0 t 1 ) -1 It is used as the key for encryption and decryption of c. 1 is the result of the multiplier encryption operation, c 0 t 1is the encryption key for the multiplier encryption operation, (c 0 t 1 ) -1 is the decryption key for the multiplier decryption operation); from the perspective of entities other than the signature device and the signature auxiliary system, the security of the generated SM2 digital signature is comparable to the direct use (1+d A ) -1 or A The security of the generated SM2 digital signature is the same; from the perspective of entities other than the signature device and the signature auxiliary system, whether the signature auxiliary system uses k 2 Participate in the generation of digital signatures, the security of the generated SM2 digital signature is the same; however, from the perspective of the owner of the SM2 signature private key, this can prevent (1+d A ) -1 The ciphertext c A1 After being stolen, the attacker uses c A1 Crack SM2 signature private key d A Therefore, from the perspective of the SM2 signature private key owner, the method of the present invention improves the security of the use of the signature private key, and the signature auxiliary system can be used in the calculation of s 2 Before or after s, the identity authentication of the user of the signature device is enhanced in a certain way, for example, through the user's public key P A The identity authentication information (such as password, biometric verification information, etc.) in the authentication information is used to authenticate the user of the signature device, thereby ensuring that the user's signature data is not stolen; based on the technical solution of the present invention, the entire digital signature calculation process is under the control of the signature device, and the signature auxiliary system can ensure that only P A The real owner can use c A1 The digital signature is generated, and the technical solution of the present invention is a safe and controllable technical solution for the use of signature production data. BRIEF DESCRIPTION OF THE DRAWINGS
[0153] Figure 1 Schematic diagram of the system of the present invention.
[0154] Figure 2 A schematic diagram of the distributed deployment of the present invention. DETAILED DESCRIPTION
[0155] The present invention is further described below in conjunction with the examples. The following embodiments and examples are only several possible embodiments and examples listed in the present invention, and do not represent all possible embodiments and examples, and are not intended to limit the present invention.
[0156] E of the present invention H (·) and D HOne of the implementation methods of (·) is to use a homomorphic encryption algorithm, including an additive homomorphic encryption algorithm and a fully homomorphic encryption algorithm that supports both additive homomorphism and multiplicative homomorphism. The present invention has no restrictions on the additive homomorphic encryption algorithm and the fully homomorphic encryption algorithm used, as long as they can support integer homomorphic encryption operations. For example, for the additive homomorphic encryption algorithm, the Paillier algorithm can be used, and for the fully homomorphic encryption algorithm, the Gentry algorithm can be used.
[0157] In the following description It represents the multiplication of two ciphertext numbers in homomorphic encryption, and the result corresponds to the ciphertext number of the product of two corresponding plaintext numbers; ⊕ represents the addition of two ciphertext numbers in homomorphic encryption, and the result corresponds to the ciphertext number of the addition of two corresponding plaintext numbers; ⊙ represents the multiplication of a plaintext number and a ciphertext number in homomorphic encryption, and the result corresponds to the ciphertext number of the product of two corresponding plaintext numbers.
[0158] Whether it is the additive homomorphic encryption algorithm or the fully homomorphic encryption algorithm, there is an E H (a) Need to calculate E H (ab), where a and b are integers, can be expressed as b⊙E H (a) is used for calculation. For the fully homomorphic encryption algorithm, it can also be calculated as Method calculation.
[0159] In the specific implementation of the present invention, if E H (·) If the homomorphic encryption algorithm is used, E H (a(modn)), where a(mod n) represents a number that is congruent to a modulo n. Here, a number that is congruent to a modulo n is used instead of a directly, in order to avoid the secret being cracked by directly decomposing a when a is the result of multiplying two or more secret numbers (confidential numbers). For example, a=pq. Since p and q have relatively few digits (relatively speaking, they are not very large numbers), it is relatively easy to decompose p and q from a, resulting in p and q being cracked. However, if a number that is congruent to a modulo n is used, the direct cracking of p and q becomes more difficult or impossible.
[0160] Implementation H One solution for (a(mod n)) is as follows (of course not all possible):
[0161] Will calculate E H (a(mod n)) becomes the calculation E H (a+zn)=E H (a)⊕E H(zn), where z is an integer randomly selected during the calculation process (such as the signature device) (not limited to an integer selected within [1, n-1]n), or an integer calculated from an integer randomly selected (such as the signature device) (z can be positive, negative, or zero). The selection principle of z is that the number of plaintexts encrypted during the calculation process, i.e., a+zn, does not exceed the encryption operation E of the homomorphic encryption algorithm. H (·) For the representation range of the encrypted integer, or for the encryption operation E beyond the homomorphic encryption algorithm H (·) The probability of representing the range of the encrypted integer is extremely small (the probability of exceeding is within the specified range) (the encryption operation E of the homomorphic encryption algorithm H (·) Use complements to represent positive, negative, and zero. If E H (·) If the modulus of the encrypted integer is m, m is divided into two parts, the lower half of which represents positive integers and zero, and the upper half represents negative integers, similar to the complement code in binary numbers).
[0162] An important link in the specific implementation of the present invention is E H (·),D H (·) specific implementation, which involves the use of E H (·),D H The cryptographic operation of (·) and t 0 , g 2 Specific implementation method.
[0163] E H (·),D H (·) Implementation 1.
[0164] E H (·),D H (·) Using multiplier encryption algorithm, E H (·),D H (·) are the encryption and decryption operations of the multiplier encryption algorithm, which is a simple symmetric key encryption method. The encryption and decryption keys are t 0 is an integer randomly selected from [1, n-1];
[0165] Encryption Operation 2 =E H ((c 0 ) -1 ) is used to calculate t 2 =((c 0 ) -1 (t 0 ) -1 )mod n;
[0166] Using t 2 =E H ((c0 ) -1 ) Calculate t 3 =E H (t 2m q), where t 2m t 2 The corresponding plaintext number (ie (c 0 ) -1 ), q is an integer in [1,n-1], which is used to calculate t 3 =(t 2 q)mod n;
[0167] Decryption operation t 4 =D H (t 3 ) is used to calculate t 4 =(t 3 t 0 )mod n;
[0168] Using t 2 =E H ((c 0 ) -1 ) Calculate c 2 =E H ((c 0 ) -1 (t 1 ) -1 ), where t 1 is an integer in [1,n-1], (t 1 ) -1 t 1 The modular n multiplicative inverse of 2 =((t 1 ) -1 t 2 )mod n;
[0169] Using the key t 0 C 2 Perform decryption operation c 2m =D H (c 2 ) mod n is to calculate c 2m =(c 2 t 0 )mod n;
[0170] Here the encryption is adopted (t 0 ) -1 , decrypt t 0 , in turn, encryption uses t 0 , decryption(t 0 ) -1 It is also possible to adopt it, the two approaches are completely equivalent;
[0171] Others use E H (·),D H (·) The calculation process of encryption and decryption is completely similar and will not be repeated here.
[0172] For E H (·),D H (·) is the case of the multiplier encryption algorithm, in which the key t used for encryption and decryption operations is 0 There are two implementation scenarios: 0 is the key that the signature assistance system has in advance, or, t 0 is to calculate t 2 When a key is randomly selected in [1,n-1], for the latter case, t 0 Encrypt to get its ciphertext g 2 .
[0173] t 0 The implementation case where the signature auxiliary system has a pre-existing key is only used when P A d A The generation method is established at four times, then g 2 Empty (not required).
[0174] t 0 is to calculate t 2 When a key is randomly selected in [1,n-1], there are two types of situations. One is to use P A d A When generating method one, two or three, t 0 The signature device or a computing device other than the signature device is computing t 2 When a (integer) key is randomly selected in [1,n-1], the second is to use P A d A Generation method four times, t 0 The key collaborative generation system calculates t 2 A (integer) key is randomly selected in [1,n-1].
[0175] For the first case, the signature device or a computing device other than the signature device uses the public key and public key cryptographic algorithm of the signature auxiliary system to 0 Encrypted to get g 2 (The public key of the signature auxiliary system includes a common public key such as the public key of the RSA and SM2 algorithms, or a group public key of the group encryption algorithm);
[0176] For the second case, 0 The encryption includes two implementation methods: using the symmetric key of the signature auxiliary system to encrypt g using the symmetric key cryptographic algorithm 2Alternatively, use the public key of the signature auxiliary system to perform a public key cryptographic algorithm on t 0 Encrypted to get g 2 , using public key cryptography to 0 When encrypting, the public key used can be the public key of a common cryptographic algorithm such as RSA, SM2, or SM9, or the group public key of a group encryption algorithm (in this case, 2 The corresponding private key for decryption is the group member's private key).
[0177] If the encryption and decryption key t 0 is the key that the signature auxiliary system has in advance. If you need to use t 0 Perform decryption operation D H (·), the system performing the decryption operation (such as the signature auxiliary system or other authorization system) directly uses the key t of the signature auxiliary system 0 Perform the decryption operation (t 0 Usually stored in a dedicated cryptographic device and used within the cryptographic device).
[0178] If the encryption and decryption key t 0 is to calculate t 2 When a key is randomly selected in [1,n-1], then, when t is needed 0 Perform decryption operation D H (·), the system performing the decryption operation (such as the signature auxiliary system or other authorization system) needs to use the signature auxiliary system for decryption g 2 The key (symmetric key or private key) decrypts g 2 Get the key t 0 , then use t 0 Perform decryption operation D H (·).
[0179] E H (·),D H (·) Implementation 2,
[0180] E H (·),D H (·) Adopt homomorphic encryption algorithms, including additive homomorphic encryption algorithms and fully homomorphic encryption algorithms, E H (·),D H (·) are the encryption operation and decryption operation of the homomorphic encryption algorithm, respectively. The encryption operation uses the public key of the homomorphic encryption algorithm, and the decryption operation uses the private key of the homomorphic encryption algorithm.
[0181] Encryption Operation 2 =E H ((c 0 ) -1) is a public key pair using the homomorphic encryption algorithm (c 0 ) -1 Perform encryption operations of homomorphic computing algorithms;
[0182] Using t 2 Calculate t 3 =E H (t 2m q(mod n)), where t 2m t 2 The corresponding plaintext number (ie (c 0 ) -1 ), q is an integer in [1,n-1], and is calculated using the homomorphic encryption algorithm: 3 =(q⊙t 2 )⊕E H (zn), where z is selected as described above; if the fully homomorphic encryption algorithm is used, then t 3 The calculation can also be calculated using a homomorphic encryption algorithm:
[0183] Decryption operation t 4 =D H (t 3 ) is to use homomorphic encryption operation E H (·) The private key t corresponding to the public key used 0 Perform decryption operation;
[0184] Using t 2 =E H ((c 0 ) -1 ) Calculate c 2 =E H ((c 0 ) -1 (t 1 ) -1 (mod n)), where t 1 is an integer in [1, n-1], and is calculated using the homomorphic encryption algorithm: c 2 =((t 1 ) -1 ⊙c 2 )⊕E H (zn), where z is selected as described above; if the fully homomorphic encryption algorithm is used, then c 2 The calculation can also be calculated using a homomorphic encryption algorithm:
[0185]
[0186] c 2m =D H (c 2)mod n is used with homomorphic encryption operation E H (·) The private key t of the homomorphic encryption algorithm corresponding to the public key used 0 Perform decryption operation;
[0187] Others use E H (·),D H (·) The calculation process of encryption and decryption is completely similar and will not be repeated here.
[0188] For E H (·),D H (·) When the homomorphic encryption algorithm is used, the public key and private key (public-private key pair) used for encryption and decryption operations are the homomorphic encryption algorithm key pair (public-private key pair) of the signature auxiliary system, or the calculation t 2 A key pair (public-private key pair) of a homomorphic encryption algorithm that is temporarily generated.
[0189] For the case where the public key and private key used for encryption and decryption operations are the homomorphic encryption algorithm key pair (public-private key pair) of the signature auxiliary system, then g 2 Is empty.
[0190] For the public key and private key used for encryption and decryption operations, t 2 In the case of a temporarily generated homomorphic encryption algorithm key pair, the private key t in the temporarily generated homomorphic encryption algorithm public-private key pair must be 0 Encrypt and get its ciphertext g 2 . 0 The encryption includes two implementation methods: using the symmetric key of the signature auxiliary system to encrypt g using the symmetric key cryptographic algorithm 2 Alternatively, use the public key of the signature auxiliary system to perform a public key cryptographic algorithm on t 0 Encrypted to get g 2 . Use public key cryptography to 0 When encrypting, the public key used can be the public key of a common cryptographic algorithm such as RSA, SM2, or SM9, or the group public key of a group encryption algorithm (in this case, the corresponding pair g 2 The decrypted private key is the private key of the group member. 0 is to calculate t 2 The private key in the public-private key pair of the homomorphic encryption algorithm is temporarily generated at the time. Therefore, when the private key t is needed 0 Perform decryption operation D H (·), the system performing the decryption operation (such as the signature auxiliary system or other authorization system) needs to use the signature auxiliary system for decryption g 2 The key (symmetric key or private key) decrypts g 2Get the private key t 0 , then use t 0 Perform decryption operation D H (·).
[0191] The signature auxiliary system of the present invention has the following features: H (·) The corresponding decryption operation D H (·) is implemented in the case of a key (multiplier encryption key or private key of a homomorphic encryption algorithm). The key for the decryption operation is usually stored in a dedicated cryptographic device (such as Figure 1 As shown). For the encryption operation E H (·) The corresponding decryption operation D H The key of (·) is encrypted into ciphertext g by the key of the signature auxiliary system. 2 In this case, the decryption g 2 The symmetric key or private key is usually stored in a special cryptographic device (such as Figure 1 As shown); to perform encryption operation E H (·) The corresponding decryption operation D H (·) needs to be decrypted by a cryptographic device first. 2 , obtain the key for decryption operation (temporarily generated multiplier encryption key or temporarily generated private key of homomorphic encryption algorithm), and then perform decryption operation (decryption operation is also usually performed in cryptographic device).
[0192] In the present invention, the signature assistance system authenticates and confirms whether the user of the signature device, i.e. the signer, is the public key P before assisting and helping the signature device to complete the generation of the digital signature. A The owner is necessary to prevent signatures from creating data (1+d A ) -1 The ciphertext is the secret c A1 In the specific implementation, it is necessary to identify whether the user using the signature device, i.e. the signer, is the person with the public key P A There are many ways to identify the owner of, for example, the user's public key P A Bind to the user's account in the signature assistance system. For example, the account information in the user account database of the signature assistance system contains the user's public key P A To use the signature assistance system, users must first log in to the signature assistance system using their account name (identity authentication), for example, through face recognition, security tokens, etc. After completing user identity authentication, the signature assistance system obtains the user's public key P from the user account database. A, or the distinguished name of the public key digital certificate provided by the user corresponds to the user account, etc., but this method is not suitable for the anonymous requirement of privacy protection. The anonymous requirement here is not to expose the true identity of the user of the signing device during the generation process of the digital signature. It is also not suitable for implementing the present invention in a distributed deployment environment (because this usually requires centralized storage of user account information). The distributed deployment here refers to multiple signature auxiliary systems being deployed in different places.
[0193] As mentioned above, the present invention proposes a signature auxiliary system that supports anonymous authentication to confirm whether the user using the signature device, i.e., the signer, is the public key P A The owner's scheme, which will contain the public key P A , the public key authentication information is formed by combining the data of the user's (i.e., the signer's) identity authentication information to form public key authentication information (the user's identity authentication information is private data known or owned only by the public key or private key owner, such as a password, biometric authentication information, or an electronic communication address used to send verification confirmation information, such as a mobile phone number, an email address, etc. Strictly speaking, the user's identity authentication information is the public key ownership authentication information, not the identity authentication information, because the user's name or account name is not required and it can be anonymous), as the public key authentication information is encrypted by using a symmetric key cryptographic algorithm and the symmetric key of the signature auxiliary system to obtain the encrypted public key authentication information, or the public key authentication information is digitally signed and encrypted by using a public key cryptographic algorithm to obtain the signed encrypted public key authentication information, which is used to authenticate and confirm whether the user using the signature device, i.e., the signer, is the public key P A A specific implementation method of generating public key authentication information encrypted by symmetric key or public key authentication information encrypted by signature in an anonymous manner is as follows:
[0194] In the generated P A , c A1 ,t 2 , g 2 After (where g 2 Allowed to be empty), the signing device (for example, anonymously) submits P to the public key registration system A , apply for registration P A ;
[0195] Public Key Registration System Check P A Is it registered (for registered P A , the public key registration system records it), if it has been registered, it will prompt that it has been registered, if it has not been registered, it will continue;
[0196] The signing device proves to the public key registration system that it has P without revealing its own secrets. A The corresponding signature private key d A (i.e., prove that the user of the signature device is the private key d AThe owner of the signature device has c calculated in the agreed manner. A1 , that is, to prove that the signature device has c A1 Yes (c 0 (1+d A ) -1 )mod n and P A =[d A ]G,c A1 d A All are secrets of the signature device). After the proof is passed, the subsequent operation will be carried out, otherwise it will be transferred to error processing;
[0197] The signing device submits the identity authentication information for user identity authentication to the public key registration system (i.e., private data for user identity authentication, such as passwords, biometric verification information, or electronic communication addresses for sending verification confirmation information, such as mobile phone numbers, email addresses, etc.), and then the public key registration system uses the symmetric key of the signature auxiliary system and the symmetric key cryptographic algorithm to authenticate the P A The public key authentication information of the user's identity authentication information is encrypted to form encrypted public key authentication information, or the public key registration system uses its own private key and a public key cryptographic algorithm to encrypt the public key authentication information containing P A The public key authentication information of the user identity authentication information is signed (the public key includes an ordinary RSA, SM2, SM9 signature private key, or a group signature private key), and then the public key registration system uses the public key of the signature auxiliary system and adopts a public key cryptographic algorithm (the public key includes an ordinary public key such as RSA, SM2 or a group public key) to encrypt the signed public key authentication information to obtain the public key authentication information that is first signed and then encrypted, or the public key registration system uses the public key of the signature auxiliary system and adopts a public key cryptographic algorithm to encrypt the public key authentication information containing P A The public key authentication information of the user's identity authentication information is encrypted to obtain the encrypted public key authentication information. The public key registration system then uses its own private key and the public key cryptographic algorithm to digitally sign the encrypted public key authentication information to obtain the public key authentication information that is first encrypted and then signed. The public key authentication information that is first signed and then encrypted and the public key authentication information that is first encrypted and then signed are collectively referred to as signature-encrypted public key authentication information; the symmetric key-encrypted public key authentication information and the signature-encrypted public key authentication information are collectively referred to as encrypted public key authentication information.
[0198] In the public key P A During the implementation of registration and public key authentication information generation, the signature device proves to the public key registration system that it has P without revealing its own secrets. A The corresponding signature private key d AThere are many methods. For example, the signing device can sign a random string submitted by the public key registration system through the secure and controllable use method of SM2 signature production data described above (when signing, the public key registration system or the signature auxiliary system does not verify P A Is it owned by the user of the signing device, because now P A Register, generate public key authentication information, or do not have public key authentication information), or the signature device proves to the public key registration system that it has P A The corresponding signature private key d A , the following is a possible method and implementation method (there are many ways):
[0199] The public key registration system randomly selects an integer t in [1,n-1] and calculates T 1 =[t](G+P A ), T 1 Send to the signature device;
[0200] The signature device randomly selects an integer b in [1,n-1] and calculates T 2 =[(c A1 b)mod n]T 1 ;
[0201] If E H (·) is a multiplier encryption operation, then the signature device uses t 2 =E H ((c 0 ) -1 ) Calculate t 3 =E H ((c 0 ) - 1 b -1 );
[0202] If E H (·) is the encryption operation of the homomorphic encryption algorithm, then the signature device uses t 2 =E H ((c 0 ) -1 ) and homomorphic encryption operation to obtain t 3 =E H ((c 0 ) -1 b -1 (mod n));
[0203] The signature device will be T 2 ,t 3 , g 2 Send to the public key registration system;
[0204] If g2 If it is not empty, the public key registration system uses the signature auxiliary system to decrypt g 2 The decryption key of g 2 Get the decryption operation D H The decryption key t of (·) 0 , use t 0 t 3 Perform decryption operation to obtain t 4 =D H (t 3 )mod n;
[0205] If g 2 If it is empty, the public key registration system directly uses the signature collaboration system for decryption operation D H The decryption key t of (·) 0 , for t 3 Perform decryption operation to obtain t 4 =D H (t 3 )mod n;
[0206] The public key registration system calculates T = [t 4 ]T 2 , check whether T and [t]G are the same. If they are the same, the proof passes, otherwise it fails.
[0207] In a specific implementation, the signature device may periodically update the encrypted public key authentication information.
[0208] In a specific implementation, the signature device can update the encrypted public key authentication information in the following manner:
[0209] The signature device submits the encrypted public key authentication information to the public key registration system, and the public key registration system decrypts the encrypted public key authentication information. If the signature is encrypted public key authentication information, the public key registration system also verifies the validity of the digital signature contained in the encrypted public key authentication information (subsequent processing is performed only after the verification is passed);
[0210] The public key registration system uses the user identity authentication in the decrypted public key authentication information to authenticate the user of the signature device. If the authentication fails, the system proceeds to error processing. If the authentication passes, the system continues.
[0211] The signing device proves to the public key registration system that it has P without revealing its own secrets. A The corresponding signature private key d A (For example, according to the public key P A the same method or a different method as when registering);
[0212] The signing device proves to the public key registration system that it has P A The corresponding signature private key dA After that, the signature device and the public key registration system follow the registration P A Generate new encrypted public key authentication information (usually update user identity authentication information, P A unchanged, but the update method here allows updating P A , that is, it actually allows one public key authentication information to generate another new public key authentication information), and the new encrypted public key authentication information includes public key authentication information encrypted by a symmetric key and public key authentication information encrypted by a public key cryptographic algorithm signature.
[0213] In a specific implementation, if the user identity authentication information in the public key authentication information is a password, the public key registration system will digitally sign the public key authentication information before or after encryption only after confirming that the password meets the security requirements.
[0214] In a specific implementation, if the user identity authentication information in the public key authentication information is a password and the public key authentication information contains the user's electronic communication address (such as an email address, mobile phone number, etc.), the public key registration system provides the user with the function of resetting or recovering the password in the public key authentication information through the user's electronic communication address contained in the public key authentication information (except for sending verification information to the electronic communication address, the password reset or recovery process is similar to the public key authentication information update process).
[0215] The public key identification information and its registration and use methods in the technical solution and specific implementation methods of the present invention do not require users to provide real identity information, and privacy can be protected anonymously (in order to protect user privacy, biometric information can be converted information) (note that supporting anonymous methods does not mean that the generation and use of public key identification information must be anonymous).
[0216] From the above description, we can see that in addition to the signature auxiliary system directly owning the D of the decryption operation H The decryption key t of (·) 0 (symmetric key of multiplier encryption, private key of homomorphic encryption algorithm) implementation method, the present invention also has a signature auxiliary system through g 2 Indirect decryption operation D H The decryption key t of (·) 0 In the implementation mode, the signature auxiliary system indirectly obtains the decryption operation D H The decryption key t of (·) 0 The implementation method is to facilitate the distributed deployment of the signature assistance system (such as Figure 2 As shown), for example, if the decryption key t 0If the encryption is done using the group public key of the group encryption algorithm, each signature auxiliary system that is a member of the group can use its own group encryption algorithm private key to decrypt the signature encrypted using the group public key. 0 The ciphertext k 2 , get the key t for decryption operation 0 (The so-called group encryption algorithm is that the group has a public key and the group members have their own private keys. The data is encrypted with the group public key, and each group member can decrypt the data with his or her own private key. Attribute-based encryption also belongs to the group encryption algorithm).
[0217] In the case where the signature assistance system is deployed in a distributed manner, the public key authentication information can be encrypted using a signature. In this case, the public key used to encrypt the public key authentication information can be an ordinary public key such as RSA, SM2, SM9, or a group public key. It is better to use a group public key (note that being suitable for distributed deployment does not mean that it must be used for distributed deployment).
[0218] Regarding the secure and controllable use method of the SM2 signature production data of the present invention, A d A Generation methods 4 and 5: The signature device verifies P without revealing its own secret A Is it a private key? A 's public key, and (c A1 t 2m ) mod n is (1+d A ) -1 , where t 2m t 2 There are many possible methods and implementations of the plaintext, one of which is as follows (there are many ways):
[0219] The signing device randomly selects an integer q in [1,n-1];
[0220] If E H (·) is a multiplier encryption operation, then the signature device uses t 2 Calculate t 3 =E H ((t 2m q)mod n)=(t 2 q) mod n, where t 2m t 2 The corresponding plaintext number (normally (c 0 ) -1 But now we need to verify it (c 0 ) -1 );
[0221] If E H(·) is a homomorphic encryption operation, then the signature device uses t 2 And homomorphic encryption operation to calculate t 3 =E H (t 2m q(mod n)), where t 2m t 2 The corresponding plaintext number;
[0222] The signature device calculates T = [c A1 ](G+P A ),G q = [q] G, T, t 3 , g 2 Send to the key collaborative generation system;
[0223] If g 2 Not empty (that is, the decryption key t 0 is a temporarily generated multiplier encryption key or a private key of a homomorphic encryption algorithm), then the key collaborative generation system uses the key from g 2 Decrypted to get the decryption key t 0 ; The key collaborative generation system uses the decryption key t obtained by decryption 0 t 3 Perform decryption operation to obtain t 4 =D H (t 3 )mod n;
[0224] If g 2 Empty (i.e. no g 2 , that is, the decryption key t 0 is the multiplier encryption key of the signature cooperative device), the key cooperative generation system uses the decryption operation D of the signature auxiliary system H The decryption key t of (·) 0 , for t 3 Perform decryption operation to obtain t 4 =D H (t 3 )mod n;
[0225] (If E H (·) is the multiplier encryption operation, using t 0 To conduct 3 It is easy to perform the decryption operation, that is, t 4 =(t 3 t 0 )mod n=((c 0 ) -1 q)mod n)
[0226] The key collaborative generation system calculates T 2 =[t 4 ]T, T2 Return to the signing device;
[0227] Signature Device Check T 2 Whether with G q If they are the same, the verification passes; otherwise, the verification fails and the error handling is executed.
[0228] Based on the method for secure and controllable use of SM2 signature data of the present invention, a corresponding secure and controllable use system for SM2 signature data can be constructed, the system includes a signature device and a signature auxiliary system, wherein the signature device has P A =[d A ]G,c A1 =(c 0 (1+d A ) -1 )mod n,t 2 =E H ((c 0 ) -1 ), c A1 The secret of the signature device; when the user's SM2 private key d is needed A When digitally signing a message M, the signature device and the signature auxiliary system generate a digital signature for the message M according to the safe and controllable use method of the SM2 signature production data; further, the implemented system may also include a public key registration system and a key collaborative generation system.
[0229] The signature device in the specific implementation of the present invention can be a device such as a personal computer, a mobile phone terminal, etc. that includes software and hardware and has computing power. It acts as a client in the process of interacting with the signature assistance system, the key collaborative generation system, and the public key registration system; the signature assistance system, the key collaborative generation system, and the public key registration system of the present invention are systems that provide corresponding service functions, and they act as server systems in the process of interacting with the signature device.
[0230] Other specific technical implementations not described are well known and self-evident to technicians in the relevant fields.
Claims
1. A method for securely and controllably using SM2 signature production data, characterized by: Signature device has P A =[d A ]G,c A1 =(c0(1+d A ) -1 )mod n, t2=E H ((c0) -1 ), where G is the base point of the SM2 elliptic curve point group, d A The user's SM2 signature private key, P A The signature private key d A The corresponding SM2 public key, n is the order of the base point G, n is a prime number, (1+d A ) -1 is (1+d A ), where c0 is a secret integer in [1, n-1] unknown to the signing device, and c A1 is the secret of the signature device, (c0) -1 is the multiplicative inverse of c0 modulo n, E H ((c0) -1 ) means for (c0) -1 Encryption operations; For (c0) -1 The encryption operation E H (·) includes encryption operations of multiplier encryption algorithms, referred to as multiplier encryption operations, and encryption operations of homomorphic encryption algorithms, referred to as homomorphic encryption operations, where homomorphic encryption operations include encryption operations of additive homomorphic encryption algorithms and encryption operations of fully homomorphic encryption algorithms; If the encryption operation E H (·) is the multiplier encryption operation, then: t2=E H ((c0) -1 )=((c0) -1 (t0) -1 ) mod n, where (t0) -1 are the modulo n multiplicative inverse of t0, where t0 is an integer randomly selected in [1, n-1] as the key for the multiplier encryption operation when calculating t2, or t0 is the multiplier encryption key of the signature assistance system in [1, n-1]; If the encryption operation E H (·) is a homomorphic encryption operation, then: t2=E H ((c0) -1 ) is the result of encryption operation using the public key of the homomorphic encryption algorithm of the signature auxiliary system, or the result of encryption operation using the public key of the public-private key pair of the temporarily generated homomorphic encryption algorithm, which is the same as the encryption operation E H (·) The private key corresponding to the public key used for decryption operation is t0; E H (·) corresponds to the decryption operation D H (·); Multiplier decryption operation D H (·) with the key t0 and the homomorphic decryption operation D H The private key t0 of (·) is called the decryption operation D H (·) decryption key; If t0 is a temporarily generated key of a multiplier encryption algorithm or a temporarily generated private key of a homomorphic encryption algorithm, then: The key t0 is encrypted by using the symmetric key of the signature auxiliary system to obtain the ciphertext g2 of t0, or the key t0 is encrypted by using the public key of the signature auxiliary system to obtain the ciphertext g2 of t0; the signature device has the ciphertext g2 of t0; If t0 is the multiplier encryption key of the signature auxiliary system or the private key of the homomorphic encryption algorithm of the signature auxiliary system, then g2 is empty; When you need to use the user's SM2 private key d A When digitally signing a message M, the signing device and the signing auxiliary system generate a digital signature as follows: Before or when digitally signing a message M, the signing device randomly selects an integer t1 in [1, n-1] and calculates c1=(t1c A1 )mod n; If E H (·) is a multiplier encryption operation, then the signature device uses t2=E H ((c0) -1 ) Calculate c2 = E H ((c0) -1 (t1) -1 ), where (t1) -1 is the modulo n multiplicative inverse of t1; If E H (·) is the encryption operation of the homomorphic encryption algorithm, then the signature device uses t2=E H ((c0) -1 ) and homomorphic encryption operation to obtain c2=E H ((c0) -1 (t1) -1 (mod n)); The signature device uses the message M to calculate a hash value e which is subsequently used to calculate r = (e + x1) mod n; The signature device will P A , e is sent to the signature assistance system; The signature device randomly selects an integer k1 in [1,n-1] and calculates Q1=[k1]G; The signature assistance system randomly selects an integer k2 in [1,n-1] and calculates Q2=[k2](G+P A ); The signature device and the signature auxiliary system exchange Q1 and Q2 while ensuring that the other party does not reselect k1 and k2 and does not recalculate Q1 and Q2; The exchange of Q1 and Q2 under the condition that the other party does not reselect k1 and k2 and does not recalculate Q1 and Q2 means that one party cannot reselect its own k2 or k1 and then recalculate Q2 or Q1 after receiving Q1 or Q2 from the other party; The signature device calculates Q=Q1+Q2; Signature Assisted System Calculation Q f =Q1+Q2; The signature device and signature auxiliary system check Q and Q respectively. f Is it zero? If Q and / or Q f If it is zero, reselect k1 and k2 and recalculate Q and Q f , until Q and Q f is a non-zero element; The signature device calculates r = (e + x1) mod n, where x1 is taken from (x1, y1) = Q; Signature Assist System Calculation f =(e+x 1f ) mod n, where x 1f Taken from (x 1f ,y 1f )=Q f ; The signature device and the signature auxiliary system respectively check whether (s+r) mod n = 0 and / or (s+r f ) mod n = 0, if yes, proceed to error handling, otherwise, continue; The signature device calculates s1=((k1+r)c1)mod n; The signature device will P A , s1, c2, g2 are transmitted to the signature assistance system; If g2 is not empty, the signature auxiliary system decrypts g2 to obtain the key t0 for decrypting c2, and uses the decrypted key t0 to decrypt c2 to obtain c 2m =D H (c2) mod n; If g2 is empty, the signature auxiliary system directly uses the decryption operation D it has H (·) decrypts c2 with the decryption key t0, and obtains c 2m =D H (c2) mod n; The signature auxiliary system calculates s2 = (s1c 2m )mod n; The signature auxiliary system calculates s = ((k2 + s2) - r f )mod n, send s to the signing device; Before sending s to the signing device, the signature assistance system verifies whether s2 or s is signed using the public key P A The corresponding private key d A Calculated, if verification fails, it will go into error handling; After the signing device receives s, it verifies whether s is signed using the public key P A The corresponding private key d A Calculated according to the calculation method of SM2 digital signature, if the verification is successful, (r, s) is the digital signature of message M, if the verification is not successful, it will enter error processing; In the above calculation formula, for an integer a, a(mod n) represents the number that is congruent to a modulo n; Before assisting and helping the signature device to complete the generation of the digital signature, the signature assistance system first authenticates and confirms whether the user of the signature device, i.e. the signer, is the public key P A The owner of The signature assistance system is a device or system that assists and cooperates with the signature device to complete the generation of the SM2 digital signature; The signature device, i.e., the computing device owned by the signer, is a device with computing capabilities and includes software and hardware; the signature device implements the above-mentioned digital signature collaborative computing steps through the cryptographic module and cryptographic program implemented therein, and implements the SM2 digital signature function.
2. The method for securely and controllably using SM2 signature production data according to claim 1 is characterized in that: For the above secure and controllable method of using SM2 signature production data, it is not necessary to update the calculations c1 and c2 before or when generating a digital signature each time.
3. The method for securely and controllably using SM2 signature production data according to claim 2 is characterized in that: The secure and controllable use method of the SM2 signature production data allows t1=1 to be fixed when calculating c1 and c2, that is, c1=c A1 , c2=t2; if t1=1, then for (c0) -1 The encryption operation t2 = E H ((c0) -1 ) allows encryption by symmetric key cryptographic algorithms or public key cryptographic algorithms other than multiplicative encryption and homomorphic encryption, where the signature auxiliary system has decryption t2 to obtain (c0) -1 The key.
4. The method for securely and controllably using SM2 signature production data according to claim 3 is characterized by: A method for the signature device and the signature auxiliary system to exchange Q1 and Q2 while ensuring that the other party does not reselect k1 and k2 and does not recalculate Q1 and Q2 is as follows: After the signature device completes the calculation of Q1=[k1]G, it calculates the hash value h1 of Q1 and sends h1 to the signature auxiliary system; The signature assistance system completes Q2 = [k2] (G + P A ) after calculation, calculate the hash value h2 of Q2 and send h2 to the signature device; After receiving h2 from the signature auxiliary system, the signature device sends Q1 to the signature auxiliary system; After receiving h1 from the signature device, the signature assistance system sends Q2 to the signature device; After receiving Q2, the signature device calculates and checks whether the hash value of Q2 is h2. If not, it goes into error processing. If so, it accepts Q2. After receiving Q1, the signature assistance system calculates and checks whether the hash value of Q1 is h1. If not, it enters error processing. If so, it accepts Q1.
5. The method for securely and controllably using SM2 signature production data according to claim 3 is characterized by: The signature device and the signature auxiliary system respectively check whether (s+r) mod n = 0 and / or (s+r f ) mod n = 0 is as follows: The signature device checks whether Q+[r]G is the zero element of the SM2 elliptic curve point group. If so, (s+r) mod n = 0 will occur, otherwise not; Signature Assist System Check Q f +[r f ] Is G the zero element of the SM2 elliptic curve point group? If so, then (s+r f ) mod n = 0, otherwise not.
6. The method for securely and controllably using SM2 signature production data according to claim 3 is characterized by: sign The auxiliary system verifies whether s2 or s is signed using the public key P before sending s to the signing device. A The corresponding private key d A One way to calculate this is as follows: Signature Assistance System Check Q1+[r f ]G and [s2](G+P A ) are the same, if they are the same, then s2 is the public key P A The corresponding private key d A Calculated, otherwise not; or, Signature Assist System Check Q f +[r f ]G and [(s+r f )mod n](G+P A ) are the same, if they are the same, then s is the public key P A The corresponding private key d A Calculated, otherwise not.
7. The method for securely and controllably using SM2 signature production data according to claim 3 is characterized by: After the signing device receives s, it verifies whether s is signed using the public key P A The corresponding private key d A A method calculated according to the SM2 digital signature is as follows: The signature device checks Q+[r]G and [(s+r)mod n](G+P A ) are the same, if they are the same, the verification passes, otherwise, the verification fails.
8. The method for securely and controllably using SM2 signature production data according to claim 3 is characterized by: The signature auxiliary system verifies whether the user using the signature device, i.e. the signer, is the person with the public key P A A method for the owner of is as follows: In the public key P A After generation, it contains the public key P A , the data combination of the user's identity authentication information forms public key authentication information, the public key authentication information is encrypted by using a symmetric key cryptographic algorithm and a symmetric key of a signature auxiliary system to obtain encrypted public key authentication information, or the public key authentication information is digitally signed and encrypted by using a public key cryptographic algorithm to obtain signed and encrypted public key authentication information, the signature encryption includes signing first and then encrypting, or encrypting first and then signing, wherein the signature uses the private key of the public key registration system, and the encryption uses the public key of the signature auxiliary system; the public key authentication information encrypted by using a symmetric key and the public key authentication information encrypted by using a public key cryptographic algorithm are collectively referred to as encrypted public key authentication information; the encrypted public key authentication information is stored in the signature device; the public key registration system is a system for registering and managing user public keys; When the signature assistance system needs to authenticate and confirm whether the user using the signature device, i.e. the signer, is the person with the public key P A When the owner of the signature is identified, the signature device submits the encrypted public key authentication information to the signature auxiliary system; The signature auxiliary system decrypts the encrypted public key authentication information to obtain the plain text of the public key authentication information. For the signature encrypted public key authentication information, the signature auxiliary system also needs to verify the validity of the digital signature and continue after the verification is passed; The signature auxiliary system determines the public key P contained in the public key authentication information obtained by decryption A Is it the public key P currently used for digital signature generation and verification? A If not, go to error handling, if so, continue; The signature auxiliary system obtains the user identity authentication information from the decrypted public key authentication information, and then uses the user identity authentication information to authenticate the user of the signature device, i.e. the signer. If the user identity authentication passes, it is confirmed that the user using the signature device, i.e. the signer, is the person with the public key P. A Otherwise, the authentication fails.
9. The method for securely and controllably using SM2 signature production data according to claim 3 is characterized by: A secure and controllable method for using the SM2 signature to create data generates the user's SM2 signature private key d A 、Public key P A The methods include: P A d A Generation method 1: The user uses the signature device to generate d A , calculate P A =[d A ]G, randomly select an integer c0 in [1,n-1], and calculate c A1 =(c0(1+d A ) -1 )mod n, t2=E H ((c0) -1 ), where E H ((c0) -1 ) means for (c0) -1 Encryption operation: If the encryption operation E H (·) is the multiplier encryption operation, then: The signature device randomly selects an integer t0 in [1, n-1] as the key for the multiplier encryption operation and calculates t2 = E H ((c0) -1 )=((c0) -1 (t0) -1 ) mod n, where (t0) -1 is the modulo n multiplicative inverse of t0; If the encryption operation E H (·) is a homomorphic encryption operation, then: The signing device temporarily generates a key pair of a homomorphic encryption algorithm, where the private key is t0, and then uses the homomorphic encryption algorithm to use the public key pair (c0) in the temporarily generated key pair. -1 Perform encryption operation to obtain t2 = E H ((c0) -1 ), Alternatively, the signing device uses the public key of the homomorphic encryption algorithm of the signature auxiliary system to encrypt (c0) using the homomorphic encryption algorithm -1 Perform encryption operation to obtain t2 = E H ((c0) -1 ), the private key used for decryption operation corresponding to the public key used in the encryption operation is the private key t0 of the homomorphic encryption algorithm of the signature auxiliary system; If t0 is a temporarily generated key of a multiplier encryption algorithm or a temporarily generated private key of a homomorphic encryption algorithm, the signature device uses the public key of the signature auxiliary system and the public key cryptographic algorithm to encrypt t0 to obtain g2; P A d A Generation method 2: The user uses a computing device other than the signing device to press P A d A Generate method 1 in the same way to generate d A , calculate P A =[d A ]G,c A1 =(c0(1+d A ) -1 )mod n, t2=E H ((c0) -1 ), g2, and then d A , c0, t0 are destroyed, and P A 、c A1 , t2, g2 are exported, and P A 、c A1 , t2, g2 are imported into the signature device; P A ,d A Generation method three: The user uses a computing device other than the signature device to randomly select an integer d2, c0 in [1, n-1] and calculate G2 = [(d2) -1 ]G,c A2 =(c0d2)mod n,t2=E H ((c0) -1 ), where (d2) -1 is the modulo n multiplicative inverse of d2, (c0) -1 is the multiplicative inverse of c0 modulo n, E H ((c0) -1 ) means for (c0) -1 Encryption operations; If the encryption operation E H (·) is the multiplier encryption operation, then: The computing device outside the signature device randomly selects an integer t0 in [1,n-1] as the key for the multiplier encryption operation and calculates t2=((c0) -1 (t0) -1 ) mod n, where (t0) -1 is the modulo n multiplicative inverse of t0; If the encryption operation E H (·) is a homomorphic encryption operation, then: A computing device other than the signing device temporarily generates a key pair of a homomorphic encryption algorithm, where the private key is t0, and then uses the homomorphic encryption algorithm to use the public key pair (c0) in the temporarily generated key pair. -1 Perform encryption operation to obtain t2 = E H ((c0) -1 ), Alternatively, a computing device other than the signing device uses the public key of the homomorphic encryption algorithm of the signature auxiliary system to perform homomorphic encryption on (c0) -1 Perform encryption operation to obtain t2 = E H ((c0) -1 ), the private key used for decryption operation corresponding to the public key used in the encryption operation is the private key t0 of the homomorphic encryption algorithm of the signature auxiliary system; If t0 is a temporarily generated key of a multiplier encryption algorithm or a temporarily generated private key of a homomorphic encryption algorithm, a computing device other than the signature device uses a public key of the signature auxiliary system and a public key cryptographic algorithm to encrypt t0 to obtain g2; The computing device other than the signature device destroys d2, c0, and t0, and the user destroys G2, c A2 , t2, g2 are derived from a computing device other than the signature device, and G2, c A2 , t2, g2 import signature device; The signature device randomly selects an integer d1 in [1,n-1] and calculates P A =[(d1) -1 ]G2-G, calculate c A1 =(d1c A2 )mod n, destroy d1; P A ,d A Generation method 4: The user uses the signature device to send a private key collaborative generation request to the key collaborative generation system; The key collaborative generation system randomly selects an integer d2 and c0 in [1,n-1] and calculates G2=[(d2) -1 ]G,c A2 =(c0d2)mod n,t2=E H ((c0) -1 ), where (d2) -1 is the modulo n multiplicative inverse of d2, (c0) -1 is the multiplicative inverse of c0 modulo n, E H ((c0) -1 ) means for (c0) -1 Encryption operations; If the encryption operation E H (·) is the multiplier encryption operation, then: The key collaborative generation system randomly selects an integer t0 in [1,n-1] as the key for the multiplier encryption operation and calculates t2=((c0) -1 (t0) -1 ) mod n, its (t0) -1 is the modulo n multiplicative inverse of t0, Alternatively, the key collaborative generation system uses the signature auxiliary system's multiplier encryption key t0 in [1,n-1] to calculate t2 = ((c0) -1 (t0) -1 )mod n; If the encryption operation E H (·) is a homomorphic encryption operation, then: The key collaborative generation system temporarily generates a key pair of the homomorphic encryption algorithm, where the private key is t0, and then uses the homomorphic encryption algorithm to use the public key pair (c0) in the temporarily generated key pair. -1 Perform encryption operation to obtain t2 = E H ((c0) -1 ), Alternatively, the key collaborative generation system uses the public key of the homomorphic encryption algorithm of the signature auxiliary system and uses the homomorphic encryption algorithm to encrypt (c0) -1 Perform encryption operation to obtain t2 = E H ((c0) -1 ), the private key used for decryption operation corresponding to the public key used in the encryption operation is the private key t0 of the homomorphic encryption algorithm of the signature auxiliary system; If t0 is a temporarily generated key of a multiplier encryption algorithm or a temporarily generated private key of a homomorphic encryption algorithm, then: The key collaborative generation system uses a symmetric key cryptographic algorithm and a symmetric key of the signature auxiliary system to encrypt the key t0 to obtain g2, or the key collaborative generation system uses a public key of the signature auxiliary system and a public key cryptographic algorithm to encrypt t0 to obtain g2; If t0 is the multiplier encryption key of the signature auxiliary system or the private key of the homomorphic encryption algorithm of the signature auxiliary system, then g2 is empty; Then the key collaborative generation system destroys d2, c0, and t0, and A2 , t2, g2 are returned to the signature device; The signature device randomly selects an integer d1 in [1,n-1] and calculates P A =[(d1) -1 ]G2-G, calculate c A1 =(d1c A2 )mod n, destroy d1; The signature device verifies P without revealing its own secrets. A Is it a private key? A 's public key, and (c A1 t 2m ) mod n is (1+d A ) -1 , where t 2m Indicates the plaintext number corresponding to t2; If the verification is successful, then d1d2≡(1+d A ) -1 (mod n), P A =[d A ]G,c A1 =((1+d A ) -1 c0)mod n, t2=E H ((c0) -1 ), where d1d2≡(1+d A ) -1 (mod n) means d1d2 and (1+d A ) -1 Modulo n is congruent, otherwise, go to error handling; P A d A Generation method five: The key collaborative generation system has G d =[(d0) -1 ], where d0 is the integer secret of the key cooperative generation system in [1,n-1], (d0) -1 is the modulo n multiplicative inverse of d0; The user uses the signature device to send a private key collaborative generation request to the key collaborative generation system; The key collaborative generation system randomly selects an integer d2 and c0 in [1,n-1] and calculates d 20 =((d2) -1 d0)mod n,c A2 =(c0d2)mod n,t2=E H ((c0) -1 ), where (d2) -1 is the modulo n multiplicative inverse of d2, (c0) -1 is the multiplicative inverse of c0 modulo n, E H ((c0) -1 ) means for (c0) -1 Encryption operations; If the encryption operation E H (·) is the multiplier encryption operation, then: The key collaborative generation system randomly selects an integer t0 in [1,n-1] as the key for the multiplier encryption operation and calculates t2=((c0) -1 (t0) -1 )mod n, its (t0) -1 is the modulo n multiplicative inverse of t0, Alternatively, the key collaborative generation system uses the signature auxiliary system's multiplier encryption key t0 in [1,n-1] to calculate t2 = ((c0) -1 (t0) -1 )mod n; If the encryption operation E H (·) is a homomorphic encryption operation, then: The key collaborative generation system temporarily generates a key pair of the homomorphic encryption algorithm, where the private key is t0, and then uses the homomorphic encryption algorithm to use the public key pair (c0) in the temporarily generated key pair. -1 Perform encryption operation to obtain t2 = E H ((c0) -1 ), Alternatively, the key collaborative generation system uses the public key of the homomorphic encryption algorithm of the signature auxiliary system and uses the homomorphic encryption algorithm to encrypt (c0) -1 Perform encryption operation to obtain t2 = E H ((c0) -1 ), the private key used for decryption operation corresponding to the public key used in the encryption operation is the private key t0 of the homomorphic encryption algorithm of the signature auxiliary system; If t0 is a temporarily generated key of a multiplier encryption algorithm or a temporarily generated private key of a homomorphic encryption algorithm, then: The key collaborative generation system uses a symmetric key cryptographic algorithm and a symmetric key of the signature auxiliary system to encrypt the key t0 to obtain g2, or the key collaborative generation system uses a public key of the signature auxiliary system and a public key cryptographic algorithm to encrypt t0 to obtain g2; If t0 is the multiplier encryption key of the signature auxiliary system or the private key of the homomorphic encryption algorithm of the signature auxiliary system, then g2 is empty; Then the key collaborative generation system destroys d2, c0, and t0, and G d d 20 、c A2 , t2, g2 are returned to the signature device; The signature device randomly selects an integer d1 in [1,n-1] and calculates P A =[((d1) -1 d 20 )mod n]G d -G, calculate c A1 =(d1c A2 )mod n, change d1, d 20 destroy; The signature device verifies P without revealing its own secrets. A Is it a private key? A 's public key, and (c A1 t 2m ) mod n is (1+d A ) -1 , where t 2m Indicates the plaintext number corresponding to t2; If the verification is successful, then d1d2≡(1+d A ) -1 (mod n), P A =[d A ]G,c A1 =((1+d A ) -1 c0)mod n, t2=E H ((c0) -1 ), where d1d2≡(1+d A ) -1 (mod n) means d1d2 and (1+d A ) -1 Modulo n is congruent, otherwise, go to error handling; The signature device implements the above SM2 signature private key generation step through the private key generation function component implemented therein to generate the user private key d A 、Public key P A and data c A1 , t2, g2.
10. A system for secure and controllable use of SM2 signature production data based on the secure and controllable use method of SM2 signature production data according to any one of claims 1 to 9, characterized in that: The secure and controllable use system of SM2 signature production data includes a signature device and a signature auxiliary system, wherein the signature device has a P A =[d A ]G,c A1 =(c0(1+d A ) -1 )mod n, t2=E H ((c0) -1 ), c A1 The secret of the signature device; when the user's SM2 private key d is needed A When digitally signing a message M, the signature device and the signature auxiliary system generate a digital signature for the message M according to the secure and controllable use method of the SM2 signature production data.
