Certificate-based encryption method, system, and electronic device using SM9 encryption architecture
Through the certificate encryption method constructed by SM9 encryption, combined with traditional public key cryptography and identity cryptography, traditional encryption algorithms cannot meet the application needs of new technologies, especially the high cost of key hosting and certificate chain verification, and realizes an efficient encryption solution.
Patent Information
- Application Number
- CN202211322919.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-27
- Publication Date
- 2025-08-15
- Estimated Expiration
- 2042-10-27
AI Technical Summary
Traditional encryption algorithms cannot meet the application needs of new technologies, especially the high cost problems of key hosting and certificate chain verification.
The certificate-based encryption method based on SM9 encryption is adopted, combined with traditional public key cryptography and identity-based cryptography, and the master private key and public key are generated through the certificate authority CA, the user certificate is generated and the private key is calculated, and the elliptic curve bilinear pair mapping is used to generate the key, so as to realize the need for expensive certificate chain verification and key removal hosting.
Implements security issues without the need for expensive certificate chain verification and key custody, combining the advantages of traditional public key cryptography and identity cryptography to provide an efficient encryption solution.
Smart Images

Figure CN115834034B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of information security technology and relates to an encryption method, system and electronic equipment, and in particular to a certificate-based encryption method, system and electronic equipment using SM9 encryption structure. Background Art
[0002] With the development of an information-based and digital society, data security is becoming increasingly important, and encryption for data storage and transmission is becoming increasingly crucial. Data encryption inevitably involves encryption algorithms, but traditional encryption algorithms cannot meet the application requirements of emerging technologies. Certificate-based encryption (CBE) combines public-key encryption (PKE) and identity-based encryption (IBE), while retaining most of the advantages of both. Similar to PKE, each user generates their own public / private key pair and requests a certificate from a certificate authority (CA). The main difference is that the CA uses the IBE scheme to generate certificates, which have all the features of traditional public key infrastructure (PKI) certificates. CBE eliminates third-party inquiries about certificate status and eliminates key escrow (because the CA does not know the user's private key) and key distribution issues (because the CA's certificates do not need to be kept confidential).
[0003] The SM9 algorithm is an identification cryptographic algorithm based on elliptic curve bilinear pairings. It was issued by the State Cryptography Administration on March 28, 2016 (Standard No.: GM / T 0044-2016SM9 Identification Cryptographic Algorithm). This standard meets the needs of applications such as electronic authentication service systems, filling a gap in domestic identification cryptographic systems. It primarily consists of three components: a digital signature algorithm, a public key encryption algorithm, and a key exchange protocol. The parameters and standards of the digital signature algorithm are used here. However, SM9 is a national cryptographic standard with limited functionality. Summary of the Invention
[0004] To address the aforementioned technical issues, the present invention provides a certificate-based encryption method and system utilizing the SM9 encryption architecture. Based on the SM9 encryption structure, this system combines the advantages of traditional public-key cryptography and identity-based cryptography, eliminating the need for expensive certificate chain verification and removing key escrow security issues.
[0005] The technical solution adopted by the method of the present invention is: a certificate-based encryption method using SM9 encryption structure, comprising the following steps:
[0006] Step 1: The certificate authority (CA) generates a random number As the master private key, and calculate the master public key P pub =[d]P1; where represents the set of integers consisting of 1, 2, ..., q-1; P1 is the generator of the group G1; G1 is an additive cyclic group of order q; q is a large prime number; [d]P1 represents the d-times point P1 on the elliptic curve;
[0007] Step 2: User A randomly selects And calculate its public key PK A =[s]P2; where s represents the secret value of user A, P2 is the generator of group G2; G2 is an additive cyclic group of order q; [s]P2 represents the s-times point P2 on the elliptic curve;
[0008] Step 3: User A provides personal information AliceInfo to the certificate authority CA, including the public key PK A and other specified additional identifying information;
[0009] Step 4: Certificate Authority (CA) verification information;
[0010] If the verification is successful, the certificate authority CA calculates t1 = H1 (P pub ,PK A ,AliceInfo)+d, Among them, H1() is a cryptographic function derived from the cryptographic hash function, which is
[0011] Step 5: The certificate authority CA generates a certificate Cert for user A A =[t2]P2, and sent to user A; where [t2]P2 represents the t2 times point P2 on the elliptic curve;
[0012] Step 6: User A calculates his private key SK based on the certificate system A =[s]Cert A ;[s]Cert A Represents the point Cert on the elliptic curve A s times of point;
[0013] Step 7: Calculate t=H1(P pub ,PK A ,AliceInfo);
[0014] Step 8: Calculate Q = [t]P1 + P pub ; Where [t]P1 represents the t-times point P1 on the elliptic curve
[0015] Step 9: Random Selection And calculate C1=[r]Q; where [r]Q represents the r-times point Q on the elliptic curve;
[0016] Step 10: Calculate GT The element g=e(P pub ,PK A ); where G T It is a multiplicative cyclic group of order q; e() is from G1×G2 to G T Bilinear pairing mapping of ;
[0017] Step 11: Calculate w = g r ; Among them, g r is the multiplicative group G T The element g in the equation is raised to the power r;
[0018] Step 12: Calculate K = (K1, K2) = KDF(C1||w||P pub ||PK A ||AliceInfo); where K, K1, and K2 are keys generated by the key derivation function, K = K1||K2, and K1||K2 represents the concatenation of K1 and K2; KDF() is the key derivation function; and C1 represents a portion of the ciphertext.
[0019] Step 13: Calculate C2; C2 represents a part of the ciphertext;
[0020] If the method for encrypting the plaintext is a stream cipher algorithm based on a key derivation function, then calculate Where M is the message to be signed; Indicates bitwise exclusive OR operation;
[0021] If the method for encrypting the plaintext is a block cipher algorithm combined with a key derivation function, then calculate C2 = Enc(K1,M); where Enc() represents the block cipher algorithm, the same as the SM9 national encryption standard;
[0022] Step 14: Calculate C3 = MAC(K2, C2); where MAC() is a message authentication code function;
[0023] Step 15: Output the ciphertext C=C1||C3||C2 corresponding to the message M.
[0024] The technical solution adopted by the system of the present invention is: a certificate-based encryption system using SM9 encryption structure, including the following modules:
[0025] Module 1, used by the certificate authority CA to generate random numbers As the master private key, and calculate the master public key P pub =[d]P1; where represents the set of integers consisting of 1, 2, ..., q-1; P1 is the generator of the group G1; G1 is an additive cyclic group of order q; q is a large prime number; [d]P1 represents the d-times point P1 on the elliptic curve;
[0026] Module 2, for user A to randomly select And calculate its public key PK A =[s]P2; where s represents the secret value of user A, P2 is the generator of group G2; G2 is an additive cyclic group of order q; [s]P2 represents the s-times point P2 on the elliptic curve;
[0027] Module 3 is used by user A to provide personal information AliceInfo to the certificate authority CA, including the public key PK A and other specified additional identifying information;
[0028] Module 4, used for CA verification information;
[0029] If the verification is successful, the certificate authority CA calculates t1 = H1 (P pub ,PK A ,AliceInfo)+d, Among them, H1() is a cryptographic function derived from the cryptographic hash function, which is
[0030] Module 5, used by the certificate authority CA to generate the certificate Cert for user A A =[t2]P2, and sent to user A; where [t2]P2 represents the t2 times point P2 on the elliptic curve;
[0031] Module 6 is used by user A to calculate his private key SK based on the certificate system A =[s]Cert A ;[s]Cert A Represents the point Cert on the elliptic curve A s times of point;
[0032] Module 7, used to calculate t = H1 (P pub ,PK A ,AliceInfo);
[0033] Module 8, used to calculate Q = [t] P1 + P pub ; Where [t]P1 represents the t-times point P1 on the elliptic curve;
[0034] Module 9, for random selection And calculate C1=[r]Q; where [r]Q represents the r-times point Q on the elliptic curve;
[0035] Module 10, for calculating G T The element g=e(P pub ,PK A ); where GT It is a multiplicative cyclic group of order q; e() is from G1×G2 to G T Bilinear pairing mapping of ;
[0036] Module 11, for calculating w=g r ; Among them, g r is the multiplicative group G T The element g in the equation is raised to the power r;
[0037] Module 12, for calculating K = (K1, K2) = KDF (C1 || w || P pub ||PK A ||AliceInfo); where K, K1, and K2 are keys generated by the key derivation function, K = K1||K2, and K1||K2 represents the concatenation of K1 and K2; KDF() is the key derivation function; and C1 represents a portion of the ciphertext.
[0038] Module 13 is used to calculate C2; C2 represents a part of the ciphertext;
[0039] If the method for encrypting the plaintext is a stream cipher algorithm based on a key derivation function, then calculate Where M is the message to be signed; Indicates a bitwise exclusive OR operation.
[0040] If the method for encrypting the plaintext is a block cipher algorithm combined with a key derivation function, then calculate C2 = Enc(K1,M); where Enc() represents the block cipher algorithm, the same as the SM9 national encryption standard;
[0041] Module 14, for calculating C3=MAC(K2, C2); wherein MAC() is a message authentication code function;
[0042] Module 15 is used to output the ciphertext C=C1||C3||C2 corresponding to the message M.
[0043] The technical solution adopted by the device of the present invention is: an electronic device comprising:
[0044] one or more processors;
[0045] A storage device for storing one or more programs, which, when executed by the one or more processors, enables the one or more processors to implement the certificate-based encryption method constructed using SM9 encryption.
[0046] Compared with the prior art, the present invention has the following advantages and beneficial effects: the present invention creatively proposes an SM9 and certificate encryption scheme for the first time; it combines the advantages of traditional public key cryptography and identity-based cryptography, eliminates the need for expensive certificate chain verification processes and removes key escrow security issues. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] Figure 1 4 is a flow chart of a method according to an embodiment of the present invention, wherein user B is the encryptor and user A is the decryptor. DETAILED DESCRIPTION
[0048] In order to facilitate ordinary technicians in this field to understand and implement the present invention, the present invention is further described in detail below with reference to the accompanying drawings and examples. It should be understood that the implementation examples described herein are only used to illustrate and explain the present invention and are not used to limit the present invention.
[0049] The SM9 algorithm is an identification cryptographic algorithm based on elliptic curve bilinear pairings. It was issued by the State Cryptography Administration on March 28, 2016 (Standard No.: GM / T 0044-2016SM9 Identification Cryptographic Algorithm). This standard meets the needs of applications such as electronic authentication service systems, filling a gap in domestic identification cryptographic systems. It primarily consists of three components: a digital signature algorithm, a public key encryption algorithm, and a key exchange protocol. This example uses the parameters and standards of the digital signature algorithm.
[0050] Please see Figure 1 The present invention provides a certificate-based encryption method using SM9 encryption structure, comprising the following steps:
[0051] Step 1: The certificate authority (CA) generates a random number As the master private key, and calculate the master public key P pub =[d]P1; where represents the set of integers consisting of 1, 2, ..., q-1; P1 is the generator of the group G1; G1 is an additive cyclic group of order q; q is a large prime number; [d]P1 represents the d-times point P1 on the elliptic curve;
[0052] Step 2: User A randomly selects And calculate its public key PK A =[s]P2; where s represents the secret value of user A, P2 is the generator of group G2; G2 is an additive cyclic group of order q; [s]P2 represents the s-times point P2 on the elliptic curve;
[0053] Step 3: User A provides personal information AliceInfo to the certificate authority CA, including the public key PK A and other specified additional identifying information;
[0054] Step 4: Certificate Authority (CA) verification information;
[0055] If the verification is successful, the certificate authority CA calculates t1 = H1 (P pub ,PK A ,AliceInfo)+d, Among them, H1() is a cryptographic function derived from the cryptographic hash function, which is
[0056] Step 5: The certificate authority CA generates a certificate Cert for user A A =[t2]P2, and sent to user A; where [t2]P2 represents the t2 times point P2 on the elliptic curve;
[0057] Step 6: User A calculates his private key SK based on the certificate system A =[s]Cert A ;[s]Cert A Represents the point Cert on the elliptic curve A s times of point;
[0058] Step 7: Calculate t = H1 (P pub ,PK A ,AliceInfo);
[0059] Step 8: Calculate Q = [t]P1 + P pub ; Where [t]P1 represents the t-times point P1 on the elliptic curve;
[0060] Step 9: Random Selection And calculate C1=[r]Q; where [r]Q represents the r-times point Q on the elliptic curve;
[0061] Step 10: Calculate G T The element g=e(P pub ,PK A ); where G T It is a multiplicative cyclic group of order q; e() is from G1×G2 to G T Bilinear pairing mapping of ;
[0062] Step 11: Calculate w = g r ; Among them, g r is the multiplicative group G T The element g in the equation is raised to the power r;
[0063] Step 12: Calculate K = (K1, K2) = KDF(C1||w||P pub ||PK A||AliceInfo); where K, K1, and K2 are keys generated by a key derivation function, K = K1||K2, where K1||K2 represents the concatenation of K1 and K2; KDF() is a key derivation function; and C1 represents a portion of the ciphertext.
[0064] Step 13: Calculate C2; C2 represents a part of the ciphertext.
[0065] If the method for encrypting the plaintext is a stream cipher algorithm based on a key derivation function, then calculate Where M is the message to be signed; Indicates a bitwise exclusive OR operation.
[0066] If the method for encrypting plaintext is a block cipher algorithm combined with a key derivation function, then C2 = Enc(K1,M) is calculated; where Enc() represents a block cipher algorithm, the same as the SM9 national encryption standard.
[0067] Step 14: Calculate C3 = MAC(K2, C2); where MAC() is a message authentication code function;
[0068] Step 15: Output the ciphertext C=C1||C3||C2 corresponding to the message M.
[0069] In this embodiment, the decryption process of ciphertext C includes the following steps:
[0070] Step 16: Calculate w′=e(C1,SK A );
[0071] Step 17: Calculate K′ = (K′1, K′2) = KDF(C1||w′||P pub ||PK A ||AliceInfo);
[0072] Step 18: Decrypt to obtain message M′;
[0073] If the method for encrypting the plaintext is a stream cipher algorithm based on a key derivation function, then calculate
[0074] If the method for encrypting the plaintext is a block cipher algorithm combined with a key derivation function, then M′=Dec(K′1, C2) is calculated; where Dec() represents a block decryption algorithm, which is the same as the SM9 national encryption standard.
[0075] Step 19: Verify that C3? = MAC(K'2, C2); if so, output the decrypted message M'; if not, output a stop symbol ⊥. Where ? = indicates whether both sides of the equation are equal.
[0076] The present invention discloses an SM9-based and certificate-based encryption method and system. Based on the SM9 public key encryption structure, it combines the advantages of traditional public key cryptography and identity-based cryptography, eliminating the need for expensive certificate chain verification processes and removing key escrow security issues.
[0077] It should be understood that the above description of the preferred embodiment is relatively detailed and cannot be regarded as limiting the scope of protection of the patent of the present invention. Under the guidance of the present invention, ordinary technicians in this field can also make substitutions or modifications without departing from the scope of protection of the claims of the present invention, which all fall within the scope of protection of the present invention. The scope of protection requested by the present invention shall be based on the attached claims.
Claims
1. A certificate-based encryption method using SM9 encryption, characterized in that: The following steps are involved: Step 1: The certificate authority (CA) generates a random number As the master private key, and calculate the master public key P pub =[d]P1; where represents the set of integers consisting of 1, 2, ..., q-1; P1; q is a large prime number; [d]P1 represents the d-times point P1 on the elliptic curve; Step 2: User A randomly selects And calculate its public key PK A =[s]P2; where s represents the secret value of user A, P2 is the generator of group G2; G2 is an additive cyclic group of order q; [s]P2 represents the s-times point P2 on the elliptic curve; Step 3: User A provides personal information AliceInfo to the certificate authority CA, including the public key PK A and other specified additional identifying information; Step 4: Certificate Authority (CA) verification information; If the verification is successful, the certificate authority CA calculates t1 = H1 (P pub , PK A , AliceInfo)+d, Among them, H1() is a cryptographic function derived from the cryptographic hash function, which is Step 5: The certificate authority CA generates a certificate Cert for user A A =[t2]P2, and sent to user A; where [t2]P2 represents the t2 times point P2 on the elliptic curve; Step 6: User A calculates his private key SK based on the certificate system A =[s]Cert A ;[s]Cert A Represents the point Cert on the elliptic curve A s times of point; Step 7: Calculate t=H1(P pub , PK A , AliceInfo); Step 8: Calculate Q = [t]P1 + P pub ; Where [t]P1 represents the t-times point P1 on the elliptic curve; Step 9: Random Selection And calculate C1=[r]Q; where [r]Q represents the r-times point Q on the elliptic curve; Step 10: Calculate G T The element g=e(P pub , PK A ); where G T It is a multiplicative cyclic group of order q; e() is from G1×G2 to G T Bilinear pairing mapping of ; Step 11: Calculate w = g r ; Among them, g r is the multiplicative group G T The element g in the equation is raised to the power r; Step 12: Calculate K = (K1, K2) = KDF(C1||w||P pub ||PK A ||AliceInfo); where K, K1, and K2 are keys generated by a key derivation function, K = K1||K2, where K1||K2 represents the concatenation of K1 and K2; KDF() is a key derivation function; and C1 represents a portion of the ciphertext. Step 13: Calculate C2; C2 represents a part of the ciphertext; If the method for encrypting the plaintext is a stream cipher algorithm based on a key derivation function, then calculate Where M is the message to be signed; Indicates bitwise exclusive OR operation; If the method for encrypting the plaintext is a block cipher algorithm combined with a key derivation function, then calculate C2=Enc(K1,M); where Enc() represents a block cipher algorithm, the same as the SM9 national encryption standard; Step 14: Calculate C3 = MAC(K2, C2); where MAC() is a message authentication code function; Step 15: Output the ciphertext C=C1||C3||C2 corresponding to the message M.
2. The certificate-based encryption method using SM9 encryption structure according to claim 1, characterized in that: The decryption process of the ciphertext C includes the following steps: Step 16: Calculate w′=e(C1, SK A ); Step 17: Calculate K′=(K′1, K′2)=KDF(C1||w′||P pub ||PK A ||AliceInfo); Step 18: Decrypt to obtain message M′; If the method for encrypting the plaintext is a stream cipher algorithm based on a key derivation function, then calculate If the method for encrypting the plaintext is a block cipher algorithm combined with a key derivation function, then calculate M′=Dec(K′1, C2); where Dec() represents the block decryption algorithm, which is the same as the SM9 national encryption standard; Step 19: Verify that C3? = MAC(K'2, C2); if so, output the decrypted message M'; if not, output a stop symbol ⊥; where ? = indicates whether both sides of the equation are equal.
3. A certificate-based encryption system using SM9 encryption, characterized in that: Includes the following modules: Module 1, used by the certificate authority CA to generate random numbers As the master private key, and calculate the master public key P pub =[d]P1; where represents the set of integers consisting of 1, 2, ..., q-1; P1 is the generator of the group G1; G1 is an additive cyclic group of order q; q is a large prime number; [d]P1 represents the d-times point P1 on the elliptic curve; Module 2, for user A to randomly select And calculate its public key PK A =[s]P2; where s represents the secret value of user A, P2 is the generator of group G2; G2 is an additive cyclic group of order q; [s]P2 represents the s-times point P2 on the elliptic curve; Module 3 is used by user A to provide personal information AliceInfo to the certificate authority CA, including the public key PK A and other specified additional identifying information; Module 4, used for CA verification information; If the verification is successful, the certificate authority CA calculates t1 = H1 (P pub , PK A , AliceInfo)+d, Among them, H1() is a cryptographic function derived from the cryptographic hash function, which is Module 5, used by the certificate authority CA to generate the certificate Cert for user A A =[t2]P2, and sent to user A; where [t2]P2 represents the t2 times point P2 on the elliptic curve; Module 6 is used by user A to calculate his private key SK based on the certificate system A =[s]Cert A ;[s]Cert A Represents the point Cert on the elliptic curve A s times of point; Module 7, used to calculate t = H1 (P pub , PK A , AliceInfo); Module 8, used to calculate Q = [t] P1 + P pub ; Where [t]P1 represents the t-times point P1 on the elliptic curve; Module 9, for random selection And calculate C1=[r]Q; where [r]Q represents the r-times point Q on the elliptic curve; Module 10, for calculating G T The element g=e(P pub , PK A ); where G T It is a multiplicative cyclic group of order q; e() is from G1×G2 to G T Bilinear pairing mapping of ; Module 11, for calculating w=g r ; Among them, g r is the multiplicative group G T The element g in the equation is raised to the power r; Module 12, for calculating K = (K1, K2) = KDF (C1 | | w | | P pub ||PK A ||AliceInfo); where K, K1, and K2 are keys generated by a key derivation function, K = K1||K2, where K1||K2 represents the concatenation of K1 and K2; KDF() is a key derivation function; and C1 represents a portion of the ciphertext. Module 13 is used to calculate C2; C2 represents a part of the ciphertext; If the method for encrypting the plaintext is a stream cipher algorithm based on a key derivation function, then calculate Where M is the message to be signed; Indicates bitwise exclusive OR operation; If the method for encrypting the plaintext is a block cipher algorithm combined with a key derivation function, then calculate C2=Enc(K1,M); where Enc() represents a block cipher algorithm, the same as the SM9 national encryption standard; Module 14, for calculating C3=MAC(K2, C2); wherein MAC() is a message authentication code function; Module 15 is used to output the ciphertext C=C1||C3||C2 corresponding to the message M.
4. The certificate-based encryption system using SM9 encryption architecture according to claim 3, wherein: The decryption system for ciphertext C includes the following modules: Module 16, for calculating w′=e(C1, SK A ); Module 17, for calculating K′=(K′1, K′2)=KDF(C1||w′||P pub ||PK A ||AliceInfo); Module 18, used for decrypting to obtain message M′; If the method for encrypting the plaintext is a stream cipher algorithm based on a key derivation function, then calculate If the method for encrypting the plaintext is a block cipher algorithm combined with a key derivation function, then calculate M′=Dec(K′1, C2); where Dec() represents the block decryption algorithm, which is the same as the SM9 national encryption standard; Module 19 is used to verify that C3? = MAC(K'2, C2); if so, output the decrypted message M'; if not, output a stop symbol ⊥; where ? = indicates whether both sides of the equation are equal.
5. An electronic device, characterized in that: include: one or more processors; A storage device for storing one or more programs, which, when executed by the one or more processors, enables the one or more processors to implement the certificate-based encryption method constructed using SM9 encryption as described in claim 1 or 2.
Citation Information
Patent Citations
Implicit certificate key generation method based on SM2 digital signature
CN112367175A
Certificate-based signature generation method and device based on SM9 signature
CN115174055A