Private key generation method and related methods, systems, computer equipment and storage media
Through the cooperation between the system key generation center and the user password device, users can independently generate SM9 user signature private keys, which solves the problem of uncontrollable user signature private keys and achieves security and compatibility.
Patent Information
- Application Number
- CN202210137437.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-15
- Publication Date
- 2025-09-19
- Estimated Expiration
- 2042-02-15
AI Technical Summary
In the SM9 identity cryptography algorithm, the generation of the user signature private key cannot be controlled by the user, leading to security issues.
The user signature private key is generated through cooperation between the system key generation center and the user's cryptographic device. The user independently generates and controls his or her own signature private key, including the generation process of system parameters, the user key generation center's signature master public key and private key, and the user's signature private key. The security of the private key is ensured through the cancellation mechanism.
It enables users to have complete independent control over their signature private keys, solves the security issue of uncontrollable generation of user signature private keys, and is compatible with existing cryptographic device interfaces without changing the implementation code.
Smart Images

Figure CN114547681B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of information security technology, and in particular relates to a private key generation method for an SM9 user signature private key and a corresponding private key generation system, a digital signature generation method, a digital signature verification method, a digital signature generation system, a digital signature verification system, a computer device, and a computer-readable storage medium. Background Art
[0002] The SM9 identity cryptographic algorithm is an identity-based cryptographic algorithm released by the State Cryptography Administration in 2016. SM9 uses the user's identity as the user's public key. The user's private key is generated by a key generation center (KGC) based on the user's identity and the KGC's master key (the private key). By using the user's identity as the public key, SM9 simplifies certificate management compared to traditional digital certificate-based public key infrastructure (PKI) systems.
[0003] The SM9 identification cryptographic algorithm includes digital signatures, key exchange, key encapsulation, and encryption and decryption algorithms. The digital signature algorithm uses the user's signature key, while the key exchange, key encapsulation, and encryption and decryption algorithms use the user's encryption key. The user's private signature key is generated by the key generation center based on the user's identity and the key generation center's master private signature key. Therefore, the key generation center is responsible for generating user private signature keys throughout the system. This leads to the problem of users being unable to control the generation of their private signature keys. Summary of the Invention
[0004] In response to the above problems, the present invention provides a method for generating a private key for an SM9 user signature private key.
[0005] The private key generation method provided by the present invention includes:
[0006] Generate system parameters;
[0007] Generate the user key generation center signature master public key P pubs2 ;
[0008] The system key generation center signs the master public key P of the user key generation center pubs2 Sign and publish user parameters;
[0009] The user generates a user signature private key ds based on the user parameters u .
[0010] further,
[0011] The generation of the system parameters is achieved by the system key generation center, including:
[0012] The system key generation center generates the system key generation center signature master private key ks1 and the system key generation center signature master public key P through the system key generation center pubs1 , the system key generation center signature master private key ks1 is a random integer, and ks1∈[1,N-1], where N is a prime number, and group G2 is an additive cyclic group of order N, then the system key generation center signature master public key P pubs1 is an element in group G2 and satisfies
[0013] P pubs1 =[ks1]P2 (1),
[0014] In formula (1), P2 is the generator of group G2, the square brackets [] represent the doubling operation on the elliptic curve, and the numbers in the square brackets [] are integers;
[0015] The system key generation center selects the system identification ID S , and use the system key to generate the central signature master private key ks1 and system identification ID S Generate the corresponding system user private key ds S ,ds S satisfy
[0016] ds S =ks1×(H1(ID S ||hid,N)+ks1) -1 (2),
[0017] In formula (2), H1(ID S ||hid, N) is a cryptographic function, || indicates merging the byte strings of data, and hid is a function identifier represented by one byte, which is selected and disclosed by the system key generation center.
[0018] further,
[0019] The generation system parameters also include:
[0020] The system key generation center signs the master public key P pubs1 and system identification ID S Public release.
[0021] further,
[0022] The generated user key generation center signature master public key P pubs2 This is achieved through the user's cryptographic device, and at the same time, the user key generation center signature master private key ks2 is generated by the cryptographic device.
[0023] further,
[0024] The system key generation center signs the master public key P of the user key generation center pubs2 Sign and publish user parameters including:
[0025] The user generates the signature master public key P of the user key generation center through the cryptographic device pubs2 and user ID A Submit to the system key generation center, which will check the user identity and the user ID A To verify,
[0026] If the verification fails, an error is returned;
[0027] If the verification is correct, the system key generation center uses the system user private key ds S and the system key generation center signature master public key P pubs1 Sign the master public key P of the user key generation center pubs2 Sign, and send the signature to the user after obtaining the signature.
[0028] further,
[0029] The published user parameters include:
[0030] The user ID is publicly released by the system key generation center A and the user key generation center signature master public key P pubs2 , and mark the user ID A and the user key generation center signature master public key P pubs2 The status is valid.
[0031] further,
[0032] The user generates a user signature private key ds according to the user parameters u include:
[0033] The user uses the user key to generate the central signature master private key ks2 and the user identification ID through the password device A Generate the user signature private key ds u ,ds u satisfy
[0034] ds u =ks2×(H1(ID A ||hid,N)+ks2) -1 (3).
[0035] further,
[0036] Following the signature, also include:
[0037] Cancel the user key generation center signature master public key P pubs2 .
[0038] further,
[0039] The cancellation of the user key generation center signature master public key P pubs2 include:
[0040] The user ID is the A User A applies to cancel the corresponding user key generation center signature master public key P through user A's password device pubs2 ;
[0041] Verify the user identity and the user ID through the system key generation center A ;
[0042] The user ID is publicly released by the system key generation center A and the user key generation center signature master public key P pubs2 , and modify the user ID A and the user key generation center signature master public key P pubs2 The status is cancelled.
[0043] The present invention also provides a private key generation system for implementing the aforementioned private key generation method. The private key generation system includes: a system key generation center and a user's cryptographic device.
[0044] The present invention also provides a digital signature generation method, which uses the above-mentioned private key generation method to digitally sign a message.
[0045] The present invention also provides a digital signature verification method, which uses the above-mentioned private key generation method to perform digital signature verification on a message.
[0046] Furthermore, the digital signature verification method includes:
[0047] Sign the master public key P of the user key generation center pubs2 and the system key generation center to P pubs2 The signature sig2 is digitally verified and passed;
[0048] Perform digital signature verification on the message M and the digital signature sig of the message M and pass;
[0049] Query the system key generation center for the user ID A and P pubs2 Is the status valid? If the user ID A and P pubs2The status is valid, and if the message M has not been tampered with, the digital signature verification passes, otherwise the digital signature verification fails.
[0050] The present invention also provides a digital signature generation system, which is used to implement the above-mentioned digital signature generation method. The digital signature generation system includes: the above-mentioned private key generation system.
[0051] The present invention also provides a digital signature verification system, which is used to implement the above-mentioned digital signature verification method. The digital signature verification system includes: the above-mentioned private key generation system.
[0052] The present invention further provides a computer device, comprising a memory, a first processor, and a first computer program stored in the memory and executable on the first processor, wherein the first computer program, when executed by the first processor, implements one or more of the following methods:
[0053] The private key generation method described above;
[0054] The digital signature generation method described above;
[0055] The digital signature verification method mentioned above.
[0056] The present invention further provides a computer-readable storage medium for storing a second computer program, wherein the second computer program is executable by at least one second processor to cause the at least one second processor to perform one or more of the following methods:
[0057] The private key generation method described above;
[0058] The digital signature generation method described above;
[0059] The digital signature verification method mentioned above.
[0060] In the private key generation method of the present invention, the user signature private key is generated by the user, so that the user has complete autonomy over the user signature private key, which effectively solves the security problem of the user being unable to control the generation of the user signature private key due to the system key generation center KGC owning all user private keys under a single system key generation center KGC.
[0061] Other features and advantages of the present invention will be described in the following description, and in part will become apparent from the description, or will be understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained by the structures pointed out in the description, claims and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0062] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0063] Figure 1 A flow chart of a method for generating a private key for an SM9 user signature private key according to an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0064] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts shall fall within the scope of protection of the present invention.
[0065] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this application belongs; the terms used herein in the specification of the application are for the purpose of describing specific embodiments only and are not intended to limit this application; the terms "including" and "having" and any variations thereof in the specification and claims of this application and the above-mentioned drawings are intended to cover non-exclusive inclusions. The terms "first", "second", "third", etc. in the specification and claims of this application or the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order or a primary and secondary relationship. "Multiple" appearing in this application refers to two or more (including two).
[0066] References herein to "embodiments" mean that a particular feature, structure, or characteristic described in connection with the embodiments may be included in at least one embodiment of the present application. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor does it constitute an independent or alternative embodiment that is mutually exclusive of other embodiments. It is understood, both explicitly and implicitly, by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0067] Figure 1 Flowchart of the method for generating the private key of the SM9 user signature private key provided by the present invention. Figure 1 , the private key generation method of the present invention includes the following steps.
[0068] A. Generate system parameters, including:
[0069] A1. Generate the system KGC signature master private key ks1 and the system KGC signature master public key P through the system KGC. pubs1 The system KGC signature master private key ks1 is a random integer, and ks1∈[1,N-1], where N is a prime number. Assume that group G2 is an additive cyclic group of order N, then the system KGC signature master public key P pubs1 is an element in group G2 and satisfies
[0070] P pubs1 =[ks1]P2 (1),
[0071] In formula (1), P2 is a generator of the group G2, square brackets [] represent a point doubling operation on an elliptic curve, and the numbers in square brackets [] are integers. For details, see Section 3 of the standard GM / T 0044-2016 "SM9 Identity Cryptography Algorithm". The meaning of the square brackets [] in each equation in the present invention is the same as the meaning of the square brackets [] above.
[0072] A2. Select the system ID through the system KGC S (That is, the identity identification of the system KGC, which is a user signature key generated by the system KGC for its own identity and used for system KGC signature), and uses the system KGC signature master private key ks1 and system identification ID S Generate the corresponding system user private key ds S ,ds S satisfy
[0073] ds S =ks1×(H1(ID S ||hid,N)+ks1) -1 (2),
[0074] In formula (2), H1(ID S ||hid, N) is the cryptographic function defined in GM / T0044.2-2016 "SM9 Identification Cryptography Algorithm Part 2 Digital Signature Algorithm" Section 5.4.2.2, which is used to convert any system identification ID S H1 is mapped to a 256-bit integer; || indicates merging the byte strings of the data; hid is a function identifier represented by one byte, which is a fixed value selected and disclosed by the system KGC.
[0075] A3, through the system KGC, the system KGC signature master public key P pubs1 and system identification ID S Public release.
[0076] B. Generate the user's KGC signature master key, including:
[0077] Since the user KGC signature master key includes the user KGC signature master private key ks2 and the user KGC signature master public key P pubs2 Therefore, this step includes generating the user's KGC signature master private key ks2 and the user's KGC signature master public key P through the user's own cryptographic device. pubs2 .
[0078] The user's cryptographic device can be a smart cryptographic key or a cryptographic module. The user's KGC signature master private key ks2 is a random integer, and ks2∈[1,N-1], where N is a prime number. Assume that group G2 is an additive cyclic group of order N, then the user's KGC signature master public key P pubs2 is an element in group G2 and satisfies
[0079] P pubs2 =[ks2]P2 (2),
[0080] In formula (2), P2 is the generator of group G2.
[0081] C. Use the system KGC to sign the user KGC master public key P. pubs2 Sign and publish user parameters, including:
[0082] C1. The user uses the user's password device to sign the user's KGC master public key P pubs2 and user ID A Submit to the system KGC, which will check the user identity and user ID A Verify, where the user ID A It can be digital information such as ID card, mobile phone number, etc. User ID A and the user's KGC signature master public key P pubs2 , theoretically there is no connection, but it is publicly released through the KGC system, and verifiers can query to determine the user ID A The unique corresponding user KGC signature master public key.
[0083] C2. If the verification fails in step C1, an error is returned.
[0084] C3. If the verification in step C1 is correct, use the system user private key ds through the system KGC S and the system KGC signature master public key P pubs1 Sign the user's KGC master public key P pubs2 Sign, get signature sig2 and send the signature to the user.
[0085] C4. Publicly publish user ID through the KGC system A and the user's KGC signature master public key P pubs2 , and mark the user IDA and the user's KGC signature master public key P pubs2 The status is valid.
[0086] D. Cancel the user's KGC signature master public key P pubs2 ,include:
[0087] D1. User ID A The user applies to cancel his / her KGC signature master public key P through his / her password device pubs2 .
[0088] D2. Verify user identity and user ID through the system KGC A ;
[0089] D3. The user ID is publicly released by the system KGC A and the user's KGC signature master public key P pubs2 , and modify the user ID A and the user's KGC signature master public key P pubs2 The status is cancelled.
[0090] E. The user uses the user's KGC signature master private key ks2 and user identification ID through the user's password device A Generate user signature private key ds u ,ds u satisfy
[0091] ds u =ks2×(H1(ID A ||hid,N)+ks2) -1 (3),
[0092] In formula (3), hid is the aforementioned function identifier.
[0093] The present invention also provides a private key generation system for implementing the above private key generation method. The private key generation system includes a system KGC and a user's password device.
[0094] The private key generation method provided by the present invention can be used in a digital signature generation method to generate a digital signature; and can also be used in a digital signature verification method to verify a digital signature.
[0095] Similarly, the private key generation system provided by the present invention can be used in a digital signature generation system to generate a digital signature; it can also be used in a digital signature verification system to verify a digital signature.
[0096] Therefore, the present invention also provides an application of the above private key generation method, which uses the above private key generation method to generate a digital signature sig, that is, the present invention also provides a digital signature generation method, which uses the user KGC signature master public key P generated by the above private key generation method pubs2 , user signature private key ds u , identifier hid and message M are input parameters, and the message M is digitally signed according to the algorithm and process in Chapter 6 of GM / T0044.2-2016 "SM9 Identification Cryptography Algorithm Part 2 Digital Signature Algorithm", thereby obtaining the digital signature sig. The signer will use the ID A , P pubs2 , the system KGC to P pubs2 The signature sig2,M,sig is sent to the signature verifier.
[0097] In addition, the present invention also provides an application of the above private key generation method, which uses the above private key generation method to verify digital signatures, that is, the present invention also provides a digital signature verification method, which uses the user KGC signature master public key P generated by the above private key generation method. pubs2 、System KGC to P pubs2 Signature sig2, function identifier hid, user ID A , message M and digital signature sig as input parameters, according to the algorithm and process of Chapter 7 of GM / T0044.2-2016 "SM9 Identification Cryptography Algorithm Part 2 Digital Signature Algorithm" pubs2 Perform digital signature verification on message M and sig and pass it, and query the system KGC for ID A and P pubs2 Is the status valid? If ID A and P pubs2 The status is valid, which means that if the message M has not been tampered with, the digital signature can be verified, otherwise the digital signature verification fails. That is, in the digital signature verification method of the present invention, the system KGC first verifies the P pubs2 The signature sig2 and the digital signature sig of message M are verified, and then the system KGC is queried for P pubs2 The reason is that the password device may be lost. In this case, the user will log out of P pubs2 , to prevent stolen cryptographic devices from being used for signing.
[0098] The present invention also provides an application of a private key generation system, and the private key generation system is used for a digital signature generation system, that is, the present invention also provides a digital signature generation system including the private key generation system, and the digital signature generation system is used to implement the above-mentioned digital signature generation method.
[0099] The present invention also provides an application of a private key generation system, and the private key generation system is used in a digital signature verification system, that is, the present invention also provides a digital signature verification system including the private key generation system, and the digital signature verification system is used to implement the above-mentioned digital signature verification method.
[0100] The present invention also provides a computer device, comprising a memory, a first processor, and a first computer program stored in the memory and executable on the first processor. When the first computer program is executed by the first processor, one or more of the above-mentioned private key generation method, digital signature generation method, and digital signature verification method are implemented.
[0101] The present invention also provides a computer-readable storage medium for storing a second computer program, which can be executed by at least one second processor to enable the at least one second processor to execute one or more of the above-mentioned private key generation method, digital signature generation method and digital signature verification method.
[0102] The private key generation method of the present invention effectively solves the security issue of users being unable to control the generation of signature private keys due to the system key generation center possessing all user private keys under a single system key generation center. The digital signature generation method and digital signature verification method of the present invention use the private key generated by the above private key generation method to generate and verify the SM9 digital signature. The digital signature generation method and digital signature verification method of the present invention are compatible with existing cryptographic device interfaces and do not require changes to the implementation code.
[0103] Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for generating a private key, characterized in that: include: Generate system parameters; Generate the user key generation center signature master public key P through the user key generation center pubs2 and the user key generation center signature master private key k s2 ; The system key generation center signs the master public key P of the user key generation center pubs2 Sign and publish user parameters; The user generates a user signature private key ds based on the user parameters u ; in, The generation of the system parameters is achieved by the system key generation center, including: The system key generation center generates the system key generation center signature master private key ks1 and the system key generation center signature master public key P through the system key generation center pubs1 , the system key generation center signature master private key ks1 is a random integer, and ks1∈[1,N-1], where N is a prime number, and group G2 is an additive cyclic group of order N, then the system key generation center signature master public key P pubs1 is an element in group G2 and satisfies P pubs1 =[pcs1]P2 (1), In formula (1), P2 is the generator of group G2, the square brackets [] represent the doubling operation on the elliptic curve, and the numbers in the square brackets [] are integers; The system key generation center selects the system identification ID S and use the system key to generate the central signature master private key ks1 and system identification ID S Generate the corresponding system user private key ds S ,ds S satisfy ds S =ks1×(H1(ID S ||hid,N)+ks1) -1 (2), In formula (2), H1(ID S ||hid, N) is a cryptographic function, || represents the merging of byte strings of data, and hid is a one-byte function identifier selected and disclosed by the system key generation center; The user generates a user signature private key ds according to the user parameters u include: The user uses the user key to generate the central signature master private key ks2 and user identification ID through the password device A Generate the user signature private key ds u ,ds u satisfy ds u =ks2×(H1(ID A ||hid,N)+ks2) -1 (3)。 2. The method for generating a private key according to claim 1, wherein: The generation system parameters also include: The system key generation center signs the master public key P pubs1 and system identification ID S Public release.
3. The method for generating a private key according to claim 2, wherein: The generated user key generation center signature master public key P pubs2 This is achieved through the user's cryptographic device, and at the same time, the user key generation center signature master private key ks2 is generated by the cryptographic device.
4. The method for generating a private key according to claim 3, wherein: The system key generation center signs the master public key P of the user key generation center pubs2 Sign and publish user parameters including: The user generates the signature master public key P of the user key generation center through the cryptographic device pubs2 and user ID A Submit to the system key generation center, which will check the user identity and the user ID A To verify, If the verification fails, an error is returned; If the verification is correct, the system key generation center uses the system user private key ds S and the system key generation center signature master public key P pubs1 Sign the master public key P of the user key generation center pubs2 Sign, and send the signature to the user after obtaining the signature.
5. The method for generating a private key according to claim 4, wherein: The published user parameters include: The user ID is publicly released by the system key generation center A and the user key generation center signature master public key P pubs2 , and mark the user ID A and the user key generation center signature master public key P pubs2 The status is valid.
6. The method for generating a private key according to any one of claims 4 to 5, wherein: Following the signature, also include: Cancel the user key generation center signature master public key P pubs2 .
7. The method for generating a private key according to claim 6, wherein: The cancellation of the user key generation center signature master public key P pubs2 include: The user ID is the A User A applies to cancel the corresponding user key generation center signature master public key P through user A's password device pubs2 ; Verify the user identity and the user ID through the system key generation center A ; The user ID is publicly released by the system key generation center A and the user key generation center signature master public key P pubs2 , and modify the user ID A and the user key generation center signature master public key P pubs2 The status is cancelled.
8. A private key generation system, configured to implement the private key generation method according to any one of claims 1 to 7, characterized in that: include: System key generation center and user's cryptographic device.
9. A digital signature generation method, characterized in that: The message is digitally signed using the private key generation method described in any one of claims 1 to 7.
10. A digital signature verification method, characterized in that: The private key generation method according to any one of claims 1 to 7 is used to verify the digital signature of the message.
11. The digital signature verification method according to claim 10, wherein: include: Sign the master public key P of the user key generation center pubs2 and the system key generation center to P pubs2 The signature sig2 is digitally verified and passed; Perform digital signature verification on the message M and the digital signature sig of the message M and pass; Query the system key generation center for the user ID A and P pubs2 Is the status valid? If the user ID A and P pubs2 The status is valid, and if the message M has not been tampered with, the digital signature verification passes, otherwise the digital signature verification fails.
12. A digital signature generation system, used to implement the digital signature generation method according to claim 9, characterized in that: include: The private key generation system according to claim 8.
13. A digital signature verification system, configured to implement the digital signature verification method according to any one of claims 10 to 11, characterized in that: include: The private key generation system according to claim 8.
14. Computer device, characterized in that The system comprises a memory, a first processor, and a first computer program stored in the memory and executable on the first processor, wherein when the first computer program is executed by the first processor, one or more of the following methods are implemented: The private key generation method according to any one of claims 1 to 7; The digital signature generation method according to claim 9; The digital signature verification method according to any one of claims 10-11.
15. A computer-readable storage medium, characterized in that The computer-readable storage medium is used to store a second computer program, and the second computer program can be executed by at least one second processor to enable the at least one second processor to perform one or more of the following methods: The private key generation method according to any one of claims 1 to 7; The digital signature generation method according to claim 9; The digital signature verification method according to any one of claims 10-11.
Citation Information
Patent Citations
Digital signature method and system based on SM2-based identity base
CN108809658A