A security authentication method, system and electronic device

By employing a hybrid key exchange and combined algorithm approach for authentication, the problems of low efficiency and poor security in authentication under quantum computer attacks are solved, thereby improving the anti-attack capability against quantum computers and enhancing the security of authentication.

CN119995964BActive Publication Date: 2026-02-17ORIGIN QUANTUM COMPUTING TECH (HEFEI) CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510102194.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-22
Publication Date
2026-02-17
Estimated Expiration
2045-01-22

AI Technical Summary

Technical Problem

In existing technologies, transport layer security protocols, which use classical public-key cryptography, cannot defend against attacks by quantum computers, resulting in reduced authentication efficiency and increased risks associated with plaintext information transmission.

Method used

By employing hybrid key exchange parameters and combination algorithms, and through hybrid signature algorithms and quantum-resistant key encapsulation algorithms, a handshake key is generated and the certificate chain is encrypted and verified, thereby reducing plaintext data transmission and improving security and efficiency.

Benefits of technology

This achieves resistance to attacks on quantum computers, reduces the risk of information leakage, and improves the security and efficiency of identity authentication.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119995964B_ABST
    Figure CN119995964B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of communication security, and in particular to a security authentication method, system and electronic device, comprising: sending an algorithm support list, a hybrid key exchange parameter and a first random number, a first certificate request to a second terminal, so that the second terminal generates a second handshake key and a ciphertext; determining a first handshake key and verifying a target first certificate chain sent by the second terminal using the first handshake key to obtain an authentication result, the present application performs authentication based on the hybrid key exchange parameter, so that the terminal has security against quantum attacks, reduces the leakage of plaintext parameters in the initial handshake message in the whole identity authentication process, uses different encryption processing for subsequent messages, reduces the risk of identity authentication key leakage, and improves the security of identity authentication. Meanwhile, the algorithm selection list is sent in the form of a combination algorithm, which can effectively reduce the algorithm selection matching time of the second terminal and improve the identity authentication efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of communication security technology, and in particular to a secure authentication method and system and electronic device. BACKGROUND

[0002] Due to the rapid development of quantum computers, the current cryptographic system needs to be quickly transitioned to post-quantum security, for example, in mobile banking, which involves the safety of people's property. Currently, mobile banking has the advantages of convenience and speed, and when performing financial services such as money transfer, mobile banking needs to perform identity authentication with the bank server to ensure the secure transmission of transaction data. In the process of identity authentication, the communication parties use the transport layer security protocol, but the transport layer security protocol in the prior art uses the encryption means of the classical public key cryptographic system, which is threatened by quantum computers and cannot defend against attacks by quantum computers. Directly replacing the classical public key cryptographic system with a post-quantum algorithm will cause the problem of reduced identity authentication efficiency. SUMMARY

[0003] The present application provides a secure authentication method, system and electronic device to solve the problem that the prior art cannot defend against attacks by quantum computers, and that in the prior art, there is more plaintext information transmission when performing identity authentication, which increases the possibility of information leakage and reduces the efficiency of identity authentication when directly replacing the classical public key cryptographic system with a post-quantum algorithm.

[0004] The embodiments of the present application provide a secure authentication method applied to a first terminal, the method comprising:

[0005] sending an algorithm support list, a hybrid key exchange parameter and a first random number, and a first certificate request to a second terminal, so that the second terminal generates a second handshake key and a ciphertext according to a target algorithm selected from the algorithm support list and matching the hybrid key exchange parameter, the hybrid key exchange parameter and the first random number;

[0006] after the second terminal generates the second handshake key, determining a first handshake key by using a third public key provided by the second terminal and sent by the second terminal, the target algorithm selected by the second terminal, and the ciphertext;

[0007] verifying a target first certificate chain sent by the second terminal by using the first handshake key to obtain an authentication result, wherein the target first certificate chain is a first certificate chain encrypted by the second handshake key and obtained by the second terminal from the second terminal according to the first certificate request.

[0008] Optionally, the hybrid key exchange parameter comprises a first public key generated by using a first national cryptographic algorithm and a second public key generated by using a first anti-quantum key encapsulation algorithm.

[0009] The second terminal generates a second handshake key and ciphertext according to a target algorithm matching the hybrid key exchange parameter selected from the algorithm support list, the hybrid key exchange parameter and a first random number, including:

[0010] The second terminal generates a classical pre-secret key by using the first public key, a third private key provided by the second terminal and a target national secret algorithm selected by the second terminal from the algorithm support list and matches the first public key, and generates an anti-quantum pre-secret key and ciphertext by using the second public key and a target anti-quantum key encapsulation algorithm selected by the second terminal from the algorithm support list and matches the second public key.

[0011] The second terminal generates a second handshake key according to the first random number, the classical pre-secret key, the anti-quantum pre-secret key and a target key derivation algorithm selected by the second terminal from the algorithm support list.

[0012] Optionally, the first handshake key is determined by using the third public key sent by the second terminal, the target algorithm selected by the second terminal and the ciphertext, including:

[0013] The first terminal generates the classical pre-secret key by using the third public key, a first private key generated by a first national secret algorithm and performing calculation in combination with the target national secret algorithm, and generates the anti-quantum pre-secret key by using a second private key generated by a first anti-quantum key encapsulation algorithm and performing decryption on the ciphertext in combination with the target anti-quantum key encapsulation algorithm.

[0014] The first terminal generates a first handshake key according to the first random number, the classical pre-secret key, the anti-quantum pre-secret key and the target key derivation algorithm.

[0015] Optionally, the target first certificate chain sent by the second terminal is verified by using the first handshake key to obtain an authentication result, including:

[0016] The first terminal decrypts the target first certificate chain by using the first handshake key to obtain a first certificate chain.

[0017] The first terminal verifies the first certificate chain by using a root certificate in a CA institution to obtain an authentication result.

[0018] Optionally, each certificate in the first certificate chain uses a self-defined object identifier field to represent a signature algorithm of the certificate, and the signature algorithm includes a hybrid signature algorithm.

[0019] Optionally, the first terminal verifies the first certificate chain by using a root certificate in a CA institution to obtain an authentication result, including:

[0020] The first terminal collects an object identifier of a current certificate to be verified in the first certificate chain;

[0021] The first terminal parses the current certificate to be verified by using the object identifier to obtain a first hybrid signature algorithm; the first hybrid signature algorithm comprises a second national secret algorithm and a first anti-quantum key signature algorithm;

[0022] The first terminal separates a hybrid signature in the current certificate to be verified according to the second national secret algorithm and the first anti-quantum key signature algorithm to obtain a first national secret signature and a first anti-quantum key signature;

[0023] The first terminal determines a public key of the second national secret algorithm and a public key of the first anti-quantum key signature algorithm in a public key of a root certificate or a higher-level certificate of the CA institution according to the second national secret algorithm and the first anti-quantum key signature algorithm;

[0024] The first terminal verifies the first national secret signature by using the public key of the second national secret algorithm in combination with the second national secret algorithm, and verifies the first anti-quantum key signature by using the public key of the first anti-quantum key signature algorithm in combination with the first anti-quantum key signature algorithm, to obtain a signature authentication result of the current certificate to be verified;

[0025] After the signature authentication of the current certificate to be verified passes, the first terminal collects an object identifier of a next node certificate of the current certificate to be verified in the first certificate chain, and returns to execute the step of parsing the current certificate to be verified by using the object identifier to obtain the first hybrid signature algorithm, until all the certificates in the first certificate chain pass the verification, the first certificate chain is legal, and the second terminal is trusted.

[0026] Optionally, after the target first certificate chain sent by the second terminal is verified by using the first handshake key to obtain an authentication result, the method further comprises:

[0027] The first terminal obtains a second certificate request encrypted by the second handshake key from the second terminal;

[0028] The first terminal decrypts the encrypted second certificate request provided by the second terminal by using the first handshake key to obtain the second certificate request;

[0029] The first terminal determines a second certificate chain of the first terminal according to the second certificate request;

[0030] The first terminal encrypts the second certificate chain by using the first handshake key to obtain a target second certificate chain, and sends the target second certificate chain to the second terminal; and the second terminal verifies the target second certificate chain by using the second handshake key to obtain an authentication result.

[0031] Optionally, the second terminal verifies the target second certificate chain by using the second handshake key to obtain an authentication result, and the method comprises:

[0032] The second terminal decrypts the target second certificate chain by using the second handshake key to obtain a second certificate chain.

[0033] The second terminal verifies the second certificate chain by using a root certificate in a CA institution to obtain an authentication result.

[0034] Optionally, each certificate in the second certificate chain uses a self-defined object identifier field to represent a signature algorithm of the certificate, and the signature algorithm comprises a hybrid signature algorithm.

[0035] Optionally, the second terminal verifies the target second certificate chain by using the second handshake key to obtain an authentication result, and the method comprises:

[0036] The second terminal collects an object identifier of a current certificate to be verified in the second certificate chain.

[0037] The second terminal parses the current certificate to be verified by using the object identifier to obtain a second hybrid signature algorithm; the second hybrid signature algorithm comprises a third national secret algorithm and a second anti-quantum key signature algorithm.

[0038] The second terminal separates a hybrid signature in the current certificate to be verified according to the third national secret algorithm and the second anti-quantum key signature algorithm to obtain a second national secret signature and a second anti-quantum key signature.

[0039] The second terminal determines a public key of the third national secret algorithm and a public key of the second anti-quantum key signature algorithm in a public key of a root certificate or a higher-level certificate of the CA institution according to the third national secret algorithm and the second anti-quantum key signature algorithm.

[0040] The second terminal verifies the second national secret signature by using the public key of the third national secret algorithm in combination with the third national secret algorithm, and verifies the second anti-quantum key signature by using the public key of the second anti-quantum key signature algorithm in combination with the second anti-quantum key signature algorithm, to obtain a signature authentication result of the current certificate to be verified.

[0041] After the signature authentication of the current certificate to be verified is passed, the second terminal collects an object identifier of a next node certificate of the current certificate to be verified in the second certificate chain, and returns to perform the step of parsing the current certificate to be verified by the second terminal using the object identifier to obtain a second hybrid signature algorithm, until all certificates in the second certificate chain are verified, the second certificate chain is legal, and the first terminal is trusted.

[0042] Optionally, the method further comprises:

[0043] The second terminal obtains the first handshake message sent by the first terminal, and performs a hash operation on the received algorithm support list, the hybrid key exchange parameter, the first certificate request, and the first random number to obtain a second handshake message; the first handshake message is a handshake message obtained by performing a hash operation on the algorithm support list, the hybrid key exchange parameter, the first certificate request, and the first random number provided by the first terminal;

[0044] The second terminal compares the first handshake message and the second handshake message;

[0045] When the first handshake message is the same as the second handshake message, the second terminal performs a hash operation on the second certificate request, the target first certificate chain provided by the second terminal, the third public key provided by the second terminal, the target algorithm selected by the second terminal in the algorithm support list, the first encrypted random number provided by the second terminal, the second encrypted random number provided by the second terminal, and the ciphertext to obtain a third handshake message;

[0046] The second terminal signs the second handshake message and the third handshake message using the third private key to obtain a signed handshake message;

[0047] The second terminal encrypts the signed handshake message using the second handshake key, and sends the encrypted signed handshake message to the first terminal; the first terminal decrypts the encrypted signed handshake message using the first handshake key, and verifies the signature of the decrypted signed handshake message using the third public key provided by the second terminal.

[0048] Optionally, the method further comprises:

[0049] The second terminal generates a first session key according to the second handshake key, the second random number provided by the second terminal, and the target key derivation algorithm selected by the second terminal in the algorithm support list;

[0050] The second terminal generates a second session key according to the second handshake key, the third random number provided by the second terminal, and the target key derivation algorithm.

[0051] Optionally, after the second terminal generates the second session key according to the second handshake key, the third random number provided by the second terminal, and the target key derivation algorithm, the method further includes:

[0052] The first terminal obtains a first encrypted random number and a second encrypted random number provided by the second terminal, wherein the first encrypted random number is generated by the second terminal by encrypting a second random number provided by the second terminal according to the classical pre-key and the target national encryption algorithm, and the second encrypted random number is generated by the second terminal by encrypting a third random number provided by the second terminal according to the anti-quantum pre-key and the target anti-quantum key encapsulation algorithm;

[0053] The first terminal decrypts the first encrypted random number by using the classical pre-key and the target national encryption algorithm to obtain the second random number;

[0054] The first terminal decrypts the second encrypted random number by using the anti-quantum pre-key and the target anti-quantum key encapsulation algorithm to obtain the third random number;

[0055] The first terminal generates the first session key according to the first handshake key, the second random number, and the target key derivation algorithm;

[0056] The first terminal generates the second session key according to the first handshake key, the third random number, and the target key derivation algorithm.

[0057] The embodiments of the present specification also provide a secure authentication method, applied to a second terminal, the method comprising:

[0058] Receiving an algorithm support list, a key exchange parameter, a first random number, and a first certificate request sent by a first terminal, and generating a second handshake key and a ciphertext according to a target algorithm selected from the algorithm support list and matching the key exchange parameter in combination with the hybrid key exchange parameter and the first random number;

[0059] Sending a third public key provided by the second terminal, a target algorithm selected by the second terminal, and the ciphertext to the first terminal, so that the first terminal generates a first handshake key;

[0060] Sending a target first certificate chain to the first terminal to enable the first terminal to verify the target first certificate chain based on the first handshake key, wherein the target first certificate chain is a first certificate chain encrypted by the second handshake key and obtained by the second terminal from the second terminal according to the first certificate request.

[0061] The embodiments of the present specification also provide a secure authentication system, applied to a first terminal and a second terminal, the system comprising:

[0062] The first terminal sends an algorithm support list, a hybrid key exchange parameter, a first random number and a first certificate request to the second terminal;

[0063] The second terminal receives the algorithm support list, the hybrid key exchange parameter and the first random number, and the first certificate request sent by the first terminal, and generates a second handshake key and a cipher text according to a target algorithm selected from the algorithm support list and matching the hybrid key exchange parameter and the first random number;

[0064] The second terminal sends a third public key provided by the second terminal, the target algorithm selected by the second terminal and the cipher text to the first terminal;

[0065] The first terminal obtains a first handshake key by using the third public key provided by the second terminal, the target algorithm selected by the second terminal and the cipher text sent by the second terminal;

[0066] The first terminal verifies a target first certificate chain sent by the second terminal by using the first handshake key, wherein the target first certificate chain is a first certificate chain encrypted by the second handshake key and obtained by the second terminal from the second terminal according to the first certificate request.

[0067] An electronic device, comprising a memory and a processor, the memory storing computer instructions, and the processor being configured to execute the computer instructions to perform the method described above.

[0068] A storage medium, the storage medium storing computer instructions, the computer instructions being configured to perform the method described above when executed.

[0069] The beneficial effects thereof are that:

[0070] The authentication based on the hybrid key exchange parameter for identity authentication makes the terminal have the security against quantum attacks, reduces the leakage of plaintext parameters in the initial handshake message in the entire identity authentication process, and reduces the risk of identity authentication key leakage and improves the security of identity authentication. Meanwhile, the algorithm selection list is sent in the combined algorithm mode, which can effectively reduce the algorithm selection matching time of the second terminal and improve the identity authentication efficiency. BRIEF DESCRIPTION OF DRAWINGS

[0071] The accompanying drawings, which are included to provide a further understanding of the application and constitute a part of this application, illustrate certain illustrative embodiments of the application and together with the description serve to explain the application. In the drawings:

[0072] The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiments of the present application and together with the description serve to explain the present application. In the drawings:

[0073] Figure 1 A flowchart of a security authentication method applied to a first terminal is provided for the embodiments of the present application;

[0074] Figure 2 A schematic diagram of a certificate verification interaction between a first terminal and a second terminal for a target second certificate chain is provided for the embodiments of the present application;

[0075] Figure 3 A schematic diagram of a handshake message verification interaction between a first terminal and a second terminal is provided for the embodiments of the present application;

[0076] Figure 4 A schematic diagram of a session key generation between a first terminal and a second terminal is provided for the embodiments of the present application;

[0077] Figure 5 A flowchart of a security authentication method applied to a second terminal is provided for the embodiments of the present application;

[0078] Figure 6 A schematic diagram of a security authentication system structure is provided for the embodiments of the present application;

[0079] Figure 7 A schematic diagram of an electronic device structure is provided for the embodiments of the present application;

[0080] Figure 8 A schematic diagram of a computer readable medium is provided for the embodiments of the present application. DETAILED DESCRIPTION

[0081] The embodiments described below are exemplary only, and are not to be construed as limiting the scope of the present application.

[0082] The embodiments described below are exemplary only, and are not to be construed as limiting the scope of the present application.

[0083] It should be noted that the relative arrangement of the components and steps, numerical expressions, and numerical values set forth in these embodiments are not limitations on the scope of the present application unless otherwise specifically indicated.

[0084] The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way limiting on the scope of the application or its applications or uses.

[0085] Techniques, methods, and apparatus known to those of ordinary skill in the relevant art(s) can not be discussed in detail herein. However, where appropriate, such techniques, methods, and apparatus can be considered as part of the present description.

[0086] In all of the compositions and methods shown and discussed herein, any specific value should be interpreted as merely exemplary and not as a limitation. Thus, other examples of the exemplary embodiments can have different values.

[0087] It should be borne in mind, that, as the use of night letters and numerals are merely for conveying information more conveniently, the legends on the drawings are intended to be illustrative only and therefore any contents thereof should not be taken to limit the scope of the disclosure.

[0088] Reference Figure 1 A security authentication method flow chart for a first terminal is provided for the embodiments of the present description, applied to the first terminal, comprising: S101: sending an algorithm support list, a hybrid key exchange parameter and a first random number, a first certificate request to a second terminal, so that the second terminal generates a second handshake key and a ciphertext according to a target algorithm matching the hybrid key exchange parameter selected from the algorithm support list, the hybrid key exchange parameter and the first random number; S102: after the second terminal generates the second handshake key, determining a first handshake key by using the third public key provided by the second terminal sent by the second terminal, the target algorithm selected by the second terminal and the ciphertext.

[0089] In an optional embodiment, taking the first terminal as a mobile banking app and the second terminal as a bank server as an example, first, the mobile banking app sends an algorithm support list, a hybrid key exchange parameter, and a first random number 1, a first certificate request to the bank server, wherein the hybrid key exchange parameter includes a first public key pkc0 generated by using a first national secret algorithm and a second public key pke1 generated by using a first anti-quantum key encapsulation algorithm; then, the bank server selects a target algorithm matching the hybrid key exchange parameter from the algorithm support list according to the algorithm support list, for example, the first national secret algorithm is an SM2 algorithm, and the first anti-quantum key encapsulation algorithm is a kyber algorithm, then the bank server will select a target national secret algorithm that the bank server wants to use from the algorithm support list according to the SM2 algorithm for generating the first public key pkc0 in the hybrid key exchange parameter, and select a target anti-quantum key encapsulation algorithm from the algorithm support list according to the kyber algorithm for generating the second public key pke1 in the hybrid key exchange parameter, the target anti-quantum key encapsulation algorithm is a kyber algorithm; then, a second handshake key key2 and a ciphertext ct1 are generated according to the target algorithm, the hybrid key exchange parameter, and the first random number 1; specifically, the bank server generates a classical pre-secret key key10 by using the first public key pkc0, a third private key sks0 provided by the bank server, and a target national secret algorithm matching the first public key pkc0 selected by the bank server in the algorithm support list, and generates an anti-quantum pre-secret key key11 and a ciphertext ct1 by using the second public key pke1 and a target anti-quantum key encapsulation algorithm matching the second public key pke1 selected by the bank server in the algorithm support list, the bank server generates the second handshake key key2 according to the first random number 1, the classical pre-secret key key10, the anti-quantum pre-secret key key11, and a target key derivation algorithm selected by the bank server in the algorithm support list. Wherein, the target national secret algorithm is taken as an SM2 algorithm, the target anti-quantum key encapsulation algorithm is taken as a kyber algorithm, and the target key derivation algorithm is taken as an HKDF (HMAC-based Extract-and-Expand Key Derivation Function) algorithm, which will not be described in detail.

[0090] After the bank server generates the second handshake key key2, the bank server sends the third public key pks0 provided by the bank server, the target algorithm selected by the bank server, and the ciphertext ct1 to the mobile bank app. The mobile bank app uses the third public key pks0, the first private key skc0 generated by the SM2 algorithm, and the SM2 algorithm to calculate the classical pre-secret key key10, and uses the second private key ske1 generated by the kyber algorithm and the kyber algorithm to decrypt the ciphertext ct1 to obtain the quantum-resistant pre-secret key key11; then, the mobile bank app generates the first handshake key key1 according to the first random number 1, the classical pre-secret key key10, the quantum-resistant pre-secret key key11, and the HKDF algorithm. The target algorithm is the SM2 algorithm, the kyber algorithm, and the HKDF algorithm. The bank server and the mobile bank app both use the elliptic curve encryption algorithm, so that the bank server and the mobile bank app can both generate the same classical pre-secret key key10 and quantum-resistant pre-secret key key11 according to the transmitted public key and their own private keys. Through the above generation of the handshake key using the hybrid key exchange parameters, the bank server has the security of resisting quantum attacks, which improves the security of subsequent identity authentication. At the same time, the algorithm support list can be used to send two or more algorithms in a combined manner, which avoids the need for multiple algorithm selections when the bank server selects a hybrid algorithm, and improves the efficiency of identity authentication.

[0091] S103: verifying a target first certificate chain sent by the second terminal using the first handshake key to obtain an authentication result, wherein the target first certificate chain is a first certificate chain encrypted by the second handshake key and obtained by the second terminal from the second terminal according to the first certificate request. Specifically, the first terminal decrypts the target first certificate chain using the first handshake key to obtain a first certificate chain; and the first terminal verifies the first certificate chain using a root certificate in a certificate authority (CA) to obtain an authentication result.

[0092] In an optional embodiment, still taking the first terminal as a mobile banking app and the second terminal as a bank server as an example, the mobile banking app decrypts the target first certificate chain by using the first handshake key key1 to obtain the first certificate chain, and then verifies the certificates in the first certificate chain in sequence by using the root certificate in the CA institution, when each certificate in the first certificate chain is verified, it indicates that the first certificate chain is supported and recognized by the CA institution, that is, the identity authentication of the mobile banking app to the bank server is successful. Through the above-mentioned manner, the identity authentication of the first terminal to the second terminal is realized, and in the whole identity authentication process, by encrypting most of the information in the authentication process, the transmission of plaintext data is greatly reduced, the possibility of information leakage is reduced, and the security of identity authentication is improved.

[0093] Optionally, each certificate in the first certificate chain uses a self-defined object identifier field to represent the signature algorithm of the certificate, each certificate in the second certificate chain uses a self-defined object identifier field to represent the signature algorithm of the certificate, and the signature algorithm includes a hybrid signature algorithm.

[0094] In an optional embodiment, in order to make the first terminal and the second terminal have the security against quantum attacks, therefore, the signature algorithm used by each certificate in the first certificate chain and each certificate in the second certificate chain is generally a hybrid signature algorithm, for example, a hybrid signature algorithm combining SM2 algorithm and Dilithium algorithm, and in order to realize the verification of the certificate chain subsequently, each certificate in the first certificate chain and each certificate in the second certificate chain uses a self-defined object identifier field to represent the signature algorithm of the certificate, and the signature algorithm is quickly analyzed through the self-defined object identifier, so as to facilitate the verification of the certificate chain.

[0095] Optionally, the first terminal verifies the first certificate chain by using a root certificate in the CA mechanism to obtain an authentication result, comprising: the first terminal collecting an object identifier of a current to-be-verified certificate in the first certificate chain; the first terminal parsing the current to-be-verified certificate by using the object identifier to obtain a first hybrid signature algorithm; the first hybrid signature algorithm comprises a second national secret algorithm and a first anti-quantum key signature algorithm; the first terminal separates a hybrid signature in the current to-be-verified certificate according to the second national secret algorithm and the first anti-quantum key signature algorithm to obtain a first national secret signature and a first anti-quantum key signature; the first terminal determines a public key of the second national secret algorithm and a public key of the first anti-quantum key signature algorithm in a public key of a root certificate or a higher-level certificate of the CA mechanism according to the second national secret algorithm and the first anti-quantum key signature algorithm; the first terminal verifies the first national secret signature by using the public key of the second national secret algorithm in combination with the second national secret algorithm, and verifies the first anti-quantum key signature by using the public key of the first anti-quantum key signature algorithm in combination with the first anti-quantum key signature algorithm, to obtain a signature authentication result of the current to-be-verified certificate; after the signature authentication of the current to-be-verified certificate passes, the first terminal collects an object identifier of a next node certificate of the current to-be-verified certificate in the first certificate chain, and returns to execute the step of the first terminal parsing the current to-be-verified certificate by using the object identifier to obtain the first hybrid signature algorithm, until all the certificates in the first certificate chain pass the verification, the first certificate chain is legal, and the second terminal is trusted.

[0096] In an optional embodiment, still taking the first terminal as a mobile banking app and the second terminal as a bank server as an example, the mobile banking app collects the object identifier of the to-be-verified certificate located at the first position of the first certificate chain; then, the mobile banking app uses the object identifier to parse the to-be-verified certificate at the first position to obtain a first hybrid signature algorithm, wherein the first hybrid signature algorithm includes a second national secret algorithm and a first anti-quantum key signature algorithm, and here the first hybrid signature algorithm takes a hybrid signature algorithm combining the SM2 algorithm and the Dilithium algorithm as an example; after that, the mobile banking app separates the hybrid signature sig1 in the to-be-verified certificate at the first position according to the SM2 algorithm and the Dilithium algorithm to obtain a first national secret signature sig10 and a first anti-quantum key signature sig11; then, the mobile banking app determines the public key of the SM2 algorithm and the public key of the Dilithium algorithm in the public key of the root certificate of the CA institution according to the SM2 algorithm and the Dilithium algorithm; the mobile banking app uses the public key of the SM2 algorithm to combine the SM2 algorithm to verify the first national secret signature sig10, and uses the public key of the Dilithium algorithm to combine the Dilithium algorithm to verify the first anti-quantum key signature sig11, when the two signature verifications are successful, it means that the first certificate in the first certificate chain is verified successfully; finally, the to-be-verified certificate at the second position of the first certificate chain is verified, at this time the mobile banking app first collects the object identifier of the next node certificate of the to-be-verified certificate at the first position of the first certificate chain, and loops the above verification process of the to-be-verified certificate at the first position, it should be noted that at this time the mobile banking app determines the public key of the SM2 algorithm and the public key of the Dilithium algorithm used by the current node certificate in the public key of the previous certificate according to the SM2 algorithm and the Dilithium algorithm used by the current node certificate, and until all the certificates in the first certificate chain are verified, at this time it means that the first certificate chain is legal, that is, the bank server is trusted. By using the object identifier to quickly realize the parsing of the signature algorithm, it is avoided to make a large change to the national secret signature of the original certificate in the certificate chain, and only the cascading anti-quantum key signature is needed to realize the anti-quantum security, which is suitable for the combination of classical national secret algorithm security authentication and post-quantum security authentication.

[0097] As Figure 2As shown, the first terminal obtains a second certificate request encrypted by a second handshake key from the second terminal; the first terminal decrypts the encrypted second certificate request provided by the second terminal using the first handshake key to obtain a second certificate request; the first terminal determines a second certificate chain of the first terminal according to the second certificate request; the first terminal encrypts the second certificate chain using the first handshake key to obtain a target second certificate chain, and sends the target second certificate chain to the second terminal; and the second terminal verifies the target second certificate chain using the second handshake key to obtain an authentication result. Specifically, the second terminal decrypts the target second certificate chain using the second handshake key to obtain a second certificate chain; and the second terminal verifies the second certificate chain using a root certificate in a CA institution to obtain an authentication result.

[0098] In an optional embodiment, still taking the first terminal as a mobile bank app and the second terminal as a bank server as an example, the mobile bank app decrypts the encrypted second certificate request provided by the bank server using the first handshake key kye1 to obtain a second certificate request; the mobile bank app determines a second certificate chain of the mobile bank app according to the second certificate request, and then encrypts the second certificate chain using the first handshake key kye1 to obtain a target second certificate chain, and sends the target second certificate chain to the bank server. The bank server decrypts the target second certificate chain using the second handshake key key2 to obtain a second certificate chain, and then verifies the certificates in the second certificate chain using a root certificate in a CA institution in sequence. When each certificate in the second certificate chain is verified, it indicates that the second certificate chain is supported and approved by the CA institution, that is, the bank server successfully authenticates the identity of the mobile bank app. Through the above manner, the identity authentication of the second terminal to the first terminal is realized. In the entire identity authentication process, most of the information in the authentication process is encrypted, which greatly reduces the transmission of plaintext data, reduces the possibility of information leakage, improves the security of identity authentication, and finally completes the mutual authentication between the first terminal and the second terminal, ensures the trust between terminals, and provides security guarantee for the subsequent transmission of important information between terminals.

[0099] Optionally, the second terminal verifies the second certificate chain by using a root certificate in the CA mechanism to obtain an authentication result, comprising: the second terminal collecting an object identifier of a current certificate to be verified in the second certificate chain; the second terminal parsing the current certificate to be verified by using the object identifier to obtain a second hybrid signature algorithm; the second hybrid signature algorithm comprises a third national secret algorithm and a second anti-quantum key signature algorithm; the second terminal separates a hybrid signature in the current certificate to be verified according to the third national secret algorithm and the second anti-quantum key signature algorithm to obtain a second national secret signature and a second anti-quantum key signature; the second terminal determines a public key of the third national secret algorithm and a public key of the second anti-quantum key signature algorithm in the public key of the root certificate or the upper-level certificate of the CA mechanism according to the third national secret algorithm and the second anti-quantum key signature algorithm; the second terminal verifies the second national secret signature by using the public key of the third national secret algorithm in combination with the third national secret algorithm, and verifies the second anti-quantum key signature by using the public key of the second anti-quantum key signature algorithm in combination with the second anti-quantum key signature algorithm, to obtain a signature authentication result of the current certificate to be verified; after the signature authentication of the current certificate to be verified passes, the second terminal collects an object identifier of a next node certificate of the current certificate to be verified in the second certificate chain, and returns to execute the step of the second terminal parsing the current certificate to be verified by using the object identifier to obtain the second hybrid signature algorithm, until all the certificates in the second certificate chain pass the verification, the second certificate chain is legal, and the first terminal is trusted.

[0100] In an optional embodiment, still taking the first terminal as a mobile banking app and the second terminal as a bank server as an example, the bank server collects the object identifier of the to-be-verified certificate located at the first position of the second certificate chain; then, the bank server uses the object identifier to parse the to-be-verified certificate at the first position to obtain a second hybrid signature algorithm, wherein the second hybrid signature algorithm includes a third national secret algorithm and a second anti-quantum key signature algorithm, and here the second hybrid signature algorithm takes a hybrid signature algorithm combining the SM2 algorithm and the Dilithium algorithm as an example; then, the bank server separates the hybrid signature sig2 in the to-be-verified certificate at the first position according to the SM2 algorithm and the Dilithium algorithm to obtain a second national secret signature sig20 and a second anti-quantum key signature sig21; then, the bank server determines the public key of the SM2 algorithm and the public key of the Dilithium algorithm in the public key of the root certificate of the CA institution according to the SM2 algorithm and the Dilithium algorithm; the bank server uses the public key of the SM2 algorithm to combine the SM2 algorithm to verify the second national secret signature sig20, and uses the public key of the Dilithium algorithm to combine the Dilithium algorithm to verify the second anti-quantum key signature sig21, when the two signature verifications are successful, it means that the first certificate in the second certificate chain is verified successfully; finally, the to-be-verified certificate at the second position of the second certificate chain is verified, at this time the bank server first collects the object identifier of the next node certificate of the to-be-verified certificate at the first position of the first certificate chain, and loops the above verification process of the to-be-verified certificate at the first position, it should be noted that at this time the bank server determines the public key of the SM2 algorithm and the public key of the Dilithium algorithm used by the current node certificate in the public key of the previous certificate according to the SM2 algorithm and the Dilithium algorithm used by the current node certificate, until all the certificates in the second certificate chain are verified, at this time it means that the second certificate chain is legal, that is, the bank mobile app is trusted. By using the object identifier to quickly realize the parsing of the signature algorithm, it is avoided to make a large change to the national secret signature of the original certificate in the certificate chain, and only the cascaded anti-quantum key signature can realize the anti-quantum security, which is suitable for the combination of classical national secret algorithm security authentication and post-quantum security authentication, at the same time, the identity verification between terminals provides better security guarantee for the transmission of important information between terminals.

[0101] As Figure 3As shown, the second terminal acquires the first handshake message sent by the first terminal, and performs a hash operation on the received algorithm support list, the hybrid key exchange parameter, the first certificate request and the first random number to obtain a second handshake message; the first handshake message is a handshake message obtained by performing a hash operation on the algorithm support list, the hybrid key exchange parameter, the first certificate request and the first random number provided by the first terminal; the second terminal compares the first handshake message with the second handshake message; when the first handshake message is the same as the second handshake message, the second terminal performs a hash operation on a second certificate request, a target first certificate chain provided by the second terminal, a third public key provided by the second terminal, a target algorithm selected by the second terminal in the algorithm support list, a first encrypted random number provided by the second terminal, a second encrypted random number provided by the second terminal, and the ciphertext to obtain a third handshake message; the second terminal signs the second handshake message and the third handshake message by using the third private key to obtain a signed handshake message; the second terminal encrypts the signed handshake message by using the second handshake key, and sends the encrypted signed handshake message to the first terminal; the first terminal decrypts the encrypted signed handshake message by using the first handshake key, and verifies the signature of the decrypted signed handshake message by using the third public key provided by the second terminal.

[0102] In an alternative embodiment, still taking the first terminal as a mobile banking app and the second terminal as a bank server as an example, the bank server first obtains the first handshake message sent by the mobile banking app, wherein the first handshake message is obtained by performing a hash operation on the algorithm support list, the hybrid key exchange parameter, the first certificate request and the first random number provided by the mobile banking app; then, the bank server performs a hash operation on the received algorithm support list, the hybrid key exchange parameter, the first certificate request and the first random number 1 to obtain the second handshake message; then, the bank server compares the first handshake message with the second handshake message; when the first handshake message is the same as the second handshake message, it indicates that the algorithm support list, the hybrid key exchange parameter, the first certificate request and the first random number 1 and other information sent by the mobile banking app to the bank server are not tampered with, and the information received by the bank server can be used for subsequent generation of a handshake key and identity authentication, thereby avoiding the risk of information tampering in advance. Thereafter, the bank server performs a hash operation on the second certificate request provided by the bank server, the target first certificate chain provided by the bank server, the third public key pks0 provided by the bank server, the target algorithm selected by the bank server in the algorithm support list, the first encryption random number provided by the bank server, the second encryption random number provided by the bank server and the ciphertext ct1 to obtain a third handshake message, and performs a signature on the second handshake message and the third handshake message using a third private key sks0 to obtain a signature handshake message sig3; finally, the bank server encrypts the signature handshake message using the second handshake key key2, and sends the encrypted signature handshake message to the mobile banking app, which decrypts the encrypted signature handshake message using the first handshake key key1, and performs a signature verification on the decrypted signature handshake message using the third public key pks0 provided by the bank server. It should be noted that when the second terminal verifies the identity of the first terminal, the first terminal performs a hash operation on the second target certificate chain provided by the first terminal and sent to the second terminal to obtain a fourth handshake message, and performs a signature on the second handshake message, the third handshake message and the fourth handshake message using a first private key skc0 to obtain a signature handshake message sig4, and encrypts the signature handshake message sig4 using the first handshake key key1 and transmits it to the second terminal; the second terminal decrypts the signature handshake message sig4 using the second handshake key key2, and performs a signature verification on the decrypted signature handshake message sig4 using the first public key pkc0. Through the above method, the integrity of the handshake process is ensured, and information tampering during transmission is prevented.

[0103] In an optional embodiment, since each certificate in the first certificate chain and the second certificate chain can be signed by using only one signature algorithm, when certificate chain verification is performed on the first certificate chain or the second certificate chain, for the certificate in the certificate chain that is signed by using only one signature algorithm, a signature separation operation is not needed, and the signature value in the certificate signature field can be directly verified, thereby improving the verification flexibility of the certificate chain.

[0104] As shown in Figure 4 The second terminal derives a first session key according to the second handshake key, a second random number provided by the second terminal, and a target key derivation algorithm selected by the second terminal in the algorithm support list; the second terminal derives a second session key according to the second handshake key, a third random number provided by the second terminal, and the target key derivation algorithm; the first terminal obtains a first encrypted random number and a second encrypted random number provided by the second terminal; the first encrypted random number is generated by the second terminal according to the classical pre-key, the target national secret algorithm, and the second random number provided by the second terminal; the second encrypted random number is generated by the second terminal according to the anti-quantum pre-key, the target anti-quantum key encapsulation algorithm, and the third random number provided by the second terminal; the first terminal decrypts the first encrypted random number by using the classical pre-key and the target national secret algorithm to obtain the second random number; the first terminal decrypts the second encrypted random number by using the anti-quantum pre-key and the target anti-quantum key encapsulation algorithm to obtain the third random number; the first terminal derives the first session key according to the first handshake key, the second random number, and the target key derivation algorithm; and the first terminal derives the second session key according to the first handshake key, the third random number, and the target key derivation algorithm.

[0105] In an optional embodiment, still taking the first terminal as the mobile banking app and the second terminal as the bank server as an example, in order to enable encrypted transmission and decryption of data between the mobile banking app and the bank server after identity authentication, the mobile banking app needs to generate a session key for encrypting data sent by the mobile banking app to the bank server, and the bank server also needs to generate the same session key for decrypting data sent by the mobile banking app to the bank server; similarly, the bank server needs to generate a session key for encrypting data sent by the bank server to the mobile banking app, and the mobile banking app also needs to generate the same session key for decrypting data sent by the mobile banking app to the bank server, that is, the mobile banking app and the bank server realize secure transmission of data between the two parties based on the above two session keys. Specifically, for the bank server, the bank server generates a first session key key3 according to the second handshake key key2, the second random number 2 provided by the bank server, and the HKDF algorithm selected by the bank server in the algorithm support list, and generates a second session key key4 according to the second handshake key key2, the third random number 3 provided by the bank server, and the HKDF algorithm; the generation of the two session keys of the bank server is realized through the above-mentioned manner, which provides security guarantee for subsequent data interaction between the mobile banking app and the bank server. And for the mobile banking app, in order to ensure that the session key generated in the mobile banking app is consistent with the session key generated in the bank server, the mobile banking app first acquires the first encrypted random number and the second encrypted random number provided by the bank server; wherein the first encrypted random number is generated by the bank server by encrypting the second random number 2 provided by the bank server according to the classical pre-key key10 and the SM2 algorithm, and the second encrypted random number is generated by the bank server by encrypting the third random number 3 provided by the bank server according to the quantum-resistant pre-key key11 and the kyber algorithm; then, the mobile banking app decrypts the first encrypted random number using the classical pre-key key10 and the SM2 algorithm to obtain the second random number 2; the mobile banking app decrypts the second encrypted random number using the quantum-resistant pre-key key11 and the kyber algorithm to obtain the third random number 3; the mobile banking app generates the first session key key3 according to the first handshake key key1, the second random number 2 and the HKDF algorithm, and generates the second session key key4 according to the first handshake key key1, the third random number 3 and the HKDF algorithm; the above-mentioned manner ensures that the session key generated in the mobile banking app is consistent with the session key generated in the bank server, thereby realizing secure communication of data between the mobile banking app and the bank server, and preventing data from being tampered with during communication between the two parties.

[0106] Referring toFigure 5 A flow chart of a security authentication method applied to a second terminal is provided for an embodiment of the present specification, and the method comprises: S201: receiving an algorithm support list, a key exchange parameter and a first random number, a first certificate request sent by a first terminal, and generating a second handshake key and a ciphertext in combination with the mixed key exchange parameter and the first random number according to a target algorithm selected from the algorithm support list and matching the key exchange parameter; S202: sending a third public key provided by the second terminal, the target algorithm selected by the second terminal, and the ciphertext to the first terminal, so that the first terminal generates a first handshake key; S203: sending a target first certificate chain to the first terminal, so that the first terminal verifies the target first certificate chain based on the first handshake key, wherein the target first certificate chain is a first certificate chain encrypted by the second handshake key, which is obtained by the second terminal from a second terminal according to the first certificate request.

[0107] In an optional embodiment, taking the first terminal as a mobile banking app and the second terminal as a bank server as an example, first, the bank server receives the algorithm support list, the hybrid key exchange parameter and the first random number 1 and the first certificate request sent by the mobile banking app to the bank server, wherein the hybrid key exchange parameter includes the first public key pkc0 generated by using the first national secret algorithm and the second public key pke1 generated by using the first anti-quantum key encapsulation algorithm; then, the bank server selects a target algorithm matching the hybrid key exchange parameter from the algorithm support list according to the algorithm support list, for example, the first national secret algorithm is SM2 algorithm, and the first anti-quantum key encapsulation algorithm is kyber algorithm, then the bank server will select a target national secret algorithm that the bank server wants to use from the algorithm support list according to the SM2 algorithm for generating the first public key pkc0 in the hybrid key exchange parameter, and select a target anti-quantum key encapsulation algorithm from the algorithm support list according to the kyber algorithm for generating the second public key pke1 in the hybrid key exchange parameter, and the target anti-quantum key encapsulation algorithm is kyber algorithm; then, the second handshake key key2 and the ciphertext ct1 are generated according to the target algorithm, the hybrid key exchange parameter and the first random number 1; specifically, the bank server generates a classical pre-secret key key10 by using the first public key pkc0, the third private key sks0 provided by the bank server and the target national secret algorithm matching the first public key pkc0 selected by the bank server in the algorithm support list, and generates an anti-quantum pre-secret key key11 and a ciphertext ct1 by using the second public key pke1 and the target anti-quantum key encapsulation algorithm matching the second public key pke1 selected by the bank server in the algorithm support list, and the bank server generates the second handshake key key2 according to the first random number 1, the classical pre-secret key key10, the anti-quantum pre-secret key key11 and the target key derivation algorithm selected by the bank server in the algorithm support list. Wherein, the target national secret algorithm is taken as an example of SM2 algorithm, the target anti-quantum key encapsulation algorithm is taken as an example of kyber algorithm, and the target key derivation algorithm is taken as an example of HKDF (HMAC-based Extract-and-Expand Key Derivation Function) algorithm, which will not be described hereinafter.

[0108] After the bank server generates the second handshake key key2, the bank server sends the third public key pks0 provided by the bank server, the target algorithm selected by the bank server, and the ciphertext ct1 to the mobile bank app. The mobile bank app uses the third public key pks0, the first private key skc0 generated by the SM2 algorithm, and the SM2 algorithm to calculate the classical pre-secret key key10, and uses the second private key ske1 generated by the kyber algorithm and the kyber algorithm to decrypt the ciphertext ct1 to obtain the quantum-resistant pre-secret key key11; then, the mobile bank app generates the first handshake key key1 according to the first random number 1, the classical pre-secret key key10, the quantum-resistant pre-secret key key11, and the HKDF algorithm. The target algorithm is the SM2 algorithm, the kyber algorithm, and the HKDF algorithm. The bank server and the mobile bank app both use the elliptic curve encryption algorithm, so that the bank server and the mobile bank app can both generate the same classical pre-secret key key10 and quantum-resistant pre-secret key key11 according to the transmitted public key and their own private keys. Through the above generation of the handshake key using the hybrid key exchange parameters, the bank server has the security of resisting quantum attacks, which improves the security of subsequent identity authentication. At the same time, the algorithm support list can be used to send two or more algorithms in a combined manner, avoiding the need for multiple algorithm selections when the bank server selects a hybrid algorithm, thereby improving the identity authentication efficiency.

[0109] Finally, the mobile bank app decrypts the target first certificate chain using the first handshake key key1 to obtain the first certificate chain. The mobile bank app verifies the certificates in the first certificate chain using the root certificate in the CA institution. When each certificate in the first certificate chain is verified, it means that the first certificate chain is supported and recognized by the CA institution, that is, the identity authentication of the mobile bank app to the bank server is successful. Through the above method, the identity authentication of the mobile bank app to the bank server is realized. By encrypting the communication messages other than the initial handshake message using different keys, the leakage of plaintext data is reduced, the risk of key leakage is reduced, and the security of identity authentication is ensured.

[0110] Regarding the security authentication method applied to the second terminal in the above embodiments, the process of performing operations in each step is basically the same as that of the security authentication method applied to the first terminal, which will not be described in detail here.

[0111] Reference Figure 6A security authentication system provided by the embodiments of the present specification, applied to a first terminal and a second terminal, the system comprising: the first terminal sending an algorithm support list, a hybrid key exchange parameter, a first random number and a first certificate request to the second terminal; the second terminal receiving the algorithm support list, the key exchange parameter and the first random number, and the first certificate request sent by the first terminal, and generating a second handshake key and a ciphertext according to the target algorithm selected from the algorithm support list and matching the key exchange parameter in combination with the hybrid key exchange parameter and the first random number; the second terminal sending a third public key provided by the second terminal, the target algorithm selected by the second terminal, and the ciphertext to the first terminal; the first terminal obtaining a first handshake key by using the third public key provided by the second terminal, the target algorithm selected by the second terminal, and the ciphertext sent by the second terminal; and the first terminal verifying a target first certificate chain sent by the second terminal by using the first handshake key, wherein the target first certificate chain is a first certificate chain encrypted by the second handshake key and obtained by the second terminal from the second terminal according to the first certificate request.

[0112] In an optional embodiment, taking a mobile phone bank app as the first terminal and a bank server as the second terminal as an example, first, the mobile phone bank app sends an algorithm support list, a hybrid key exchange parameter, a first random number 1 and a first certificate request to the bank server, wherein the hybrid key exchange parameter comprises a first public key pkc0 generated by using a first national secret algorithm and a second public key pke1 generated by using a first anti-quantum key packaging algorithm; then, the bank server selects a target algorithm from the algorithm support list according to the hybrid key exchange parameter, and then generates a second handshake key key2 and a ciphertext ct1 according to the target algorithm, the hybrid key exchange parameter and the first random number 1; specifically, the bank server generates a classical pre-secret key key10 by using the first public key pkc0, a third private key sks0 provided by the bank server, and a target national secret algorithm selected by the bank server in the algorithm support list and matching the first public key pkc0, and generates an anti-quantum pre-secret key key11 and a ciphertext ct1 by using the second public key pke1 and a target anti-quantum key packaging algorithm selected by the bank server in the algorithm support list and matching the second public key pke1, and the bank server generates the second handshake key key2 according to the first random number 1, the classical pre-secret key key10, the anti-quantum pre-secret key key11 and the target key derivation algorithm selected by the bank server in the algorithm support list.

[0113] After the bank server generates the second handshake key key2, the bank server sends the third public key pks0 provided by the bank server, the target algorithm selected by the bank server, and the ciphertext ct1 to the mobile bank app, the mobile bank app calculates the classical pre-secret key key10 by using the third public key pks0, the first private key skc0 generated by the SM2 algorithm, and the SM2 algorithm, and decrypts the ciphertext ct1 by using the second private key ske1 generated by the kyber algorithm and the kyber algorithm to obtain the quantum-resistant pre-secret key key11; then, the mobile bank app generates the first handshake key key1 by using the first random number 1, the classical pre-secret key key10, the quantum-resistant pre-secret key key11, and the HKDF algorithm. Through the above generation of the handshake key by using the mixed key exchange parameters, the bank server has the security of resisting quantum attacks, and higher security is improved for subsequent identity authentication, and meanwhile, the algorithm support list is used to send two or more algorithms in a combined manner, so that the bank server does not need to select the algorithm for multiple times when the mixed algorithm is selected, and the identity authentication efficiency is improved. Finally, the mobile bank app decrypts the target first certificate chain by using the first handshake key key1 to obtain the first certificate chain, and the mobile bank app verifies the certificates in the first certificate chain one by one by using the root certificate in the CA institution, when each certificate in the first certificate chain is verified, it is indicated that the first certificate chain is supported and approved by the CA institution, that is, the identity authentication of the mobile bank app to the bank server is successful. In the whole identity authentication process, the communication messages except the initial handshake message are encrypted by using different keys, the leakage of plaintext data is reduced, the risk of key leakage is reduced, and the security of the identity authentication is ensured; meanwhile, the algorithm selection list is sent by using the combined algorithm, so that the algorithm selection matching time of the second terminal is effectively reduced, and the identity authentication efficiency is improved.

[0114] As to the system in the above-mentioned embodiments, the process that each step performs operations has been described in detail in the embodiments related to the method, and will not be described in detail here.

[0115] Based on the same inventive concept, the embodiments of the present specification also provide an electronic device.

[0116] The electronic device embodiments of the present application are described below, which can be regarded as specific physical implementations of the above-mentioned method and device embodiments of the present application. For the details described in the electronic device embodiments of the present application, they should be regarded as a supplement to the above-mentioned method or device embodiments; for the details not disclosed in the electronic device embodiments of the present application, they can be realized by referring to the above-mentioned method or device embodiments.

[0117] Reference Figure 7A structural schematic of an electronic device according to an embodiment of the present application is provided. The electronic device 300 according to this embodiment of the present application will be described below with reference to Figure 7 FIG. 1. Figure 7 The electronic device 300 shown is merely an example and should not limit the function and usage range of the embodiments of the present application.

[0118] As shown in Figure 7 FIG. 1, the electronic device 300 is in the form of a general computing device. The components of the electronic device 300 can include, but are not limited to, at least one processing unit 310, at least one storage unit 320, a bus 330 connecting different device components (including the storage unit 320 and the processing unit 310), a display unit 340, and the like.

[0119] The storage unit stores program codes that can be executed by the processing unit 310, so that the processing unit 310 performs the steps according to various exemplary embodiments of the present application described in the processing method part of the present specification. For example, the processing unit 310 can perform the steps as shown in Figure 1 and / or Figure 5 FIG. 2.

[0120] The storage unit 320 can include a readable medium in the form of a volatile storage unit, such as a random access memory (RAM) 3201 and / or a cache memory unit 3202, and can further include a read-only memory (ROM) 3203.

[0121] The storage unit 320 can further include program / utilities 3204 having a set of (at least one) program modules 3205, such as operation devices, one or more application programs, other program modules, and program data, each of which or some combination of which can include implementation of a network environment.

[0122] The bus 330 can be one or more of several types of bus structures, including a storage unit bus or storage unit controller, a peripheral bus, a graphics acceleration port, a processing unit, or a local bus using any of a variety of bus structures.

[0123] The electronic device 300 can also communicate with one or more external devices 400 such as a keyboard or pointing device, a Bluetooth device, or a device that enables a user to interact with the electronic device 300. Additionally, the electronic device 300 can further communicate with one or more devices that enable the electronic device 300 to Figure 7 communicate with other computing devices. Such communication can occur via an input / output (I / O) interface 350. Still yet, the electronic device 300 can communicate with one or more networks, such as a local area network (LAN), a wide area network (WAN), and / or the Internet, through a network adapter 360. The network adapter 360 can be any of a plurality of different types of adapters suitable for interfacing the electronic device 300 to various types of networks and / or remote computing devices. It should be appreciated that although not shown in FIG. 3, other hardware and / or software modules could be used in connection with the electronic device 300. These include, but are not limited to, microcode, device drivers, redundant processing units, external disk drive arrays, RAID devices, tape drives, and data archival storage devices, etc.

[0124] From the foregoing description, it will be apparent to those skilled in the art that a variety of modifications and changes can be made to the implementations described without departing from the scope of the present disclosure. Thus, it is intended that the present disclosure cover all such modifications and changes that fall within the scope of the present disclosure, as defined by the following claims, and their equivalents. It should be understood that the detailed description and specific examples, while indicating preferred Figure 1 embodiments, are given by way of illustration only and not limitation. Numerous alternative embodiments from the disclosed embodiments within the scope of the present disclosure will become apparent to those skilled in the art from this detailed description. Figure 5

[0125] Referring to Figure 8 FIG. 10, there is shown a schematic diagram of a computer readable medium embodying a program of instructions executable by a data processing apparatus to perform a method in accordance with the present disclosure.

[0126] implementing the method of FIG. 10. Figure 1 Figure 5 ​​The computer instructions of the illustrated method can be stored on one or more computer-readable media. The computer-readable media can be a readable signal medium or a readable storage medium. A readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include an electrical connection having one or more wires, a portable disc, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0127] The computer-readable storage medium can include a data signal traveling in baseband or propagated as a carrier wave in a propagated signal, wherein the propagated signal takes any suitable form including but not limited to radio frequency, light, or other suitable combinations of the foregoing. The computer-readable storage medium can also be any medium that can be used to store the desired program code means independently of a propagated signal. The program code means embodied on the computer-readable storage medium can be executed by one or more processing units, such as one or more processors of a digital signal processor core.

[0128] The program code can be executed by one or more programmable processing units, such as one or more microprocessors, digital signal processors (DSPs), graphics processing units (GPUs), central processing units (CPUs), ASICs, FPGAs, or some combination thereof. The processing units can be configured as a single processing unit, or as one or more processing cores in a multi-core design. The processing units can be configured to execute a program of instructions to perform particular tasks.

[0129] In light of the above, the present application can be implemented in hardware, or implemented in software modules running on one or more processors, or implemented in a combination of the two. Those skilled in the art should understand that some or all of the functions of some or all of the components according to the embodiments of the present application can be implemented in practice using a general-purpose data processing device such as a microprocessor or a digital signal processor (DSP). The present application can also be implemented as a device or apparatus program (for example, a computer program and a computer program product) for performing part or all of the methods described herein. Such a program implementing the present application can be stored on a computer readable medium or can be in the form of one or more signals. Such signals can be downloaded from an Internet website, or provided on a carrier signal, or provided in any other form.

[0130] The above-described specific embodiments further illustrate the purposes, technical solutions and beneficial effects of the present application. It should be understood that the present application is not inherently related to any specific computer, virtual device or electronic device, and various general-purpose devices can implement the present application. The above-described specific embodiments are merely examples of the present application and are not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

[0131] Each of the embodiments in the specification is described in a progressive manner, and the same or similar parts between the embodiments can be mutually referred to. Each of the embodiments mainly describes the differences from other embodiments.

[0132] The above-described specific embodiments are merely examples of the present application and are not intended to limit the present application. Those skilled in the art can make various changes and modifications to the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A security authentication method characterized by, Applied to a first terminal, the method comprises: sending an algorithm support list, a hybrid key exchange parameter and a first random number, and a first certificate request to a second terminal, so that the second terminal generates a second handshake key and a ciphertext according to a target algorithm selected from the algorithm support list and matching the hybrid key exchange parameter, and the hybrid key exchange parameter and the first random number; the hybrid key exchange parameter comprises a first public key generated by using a first national secret algorithm and a second public key generated by using a first anti-quantum key encapsulation algorithm; after the second terminal generates the second handshake key, determining a first handshake key by using a third public key provided by the second terminal sent by the second terminal, the target algorithm selected by the second terminal, and the ciphertext; verifying a target first certificate chain sent by the second terminal by using the first handshake key to obtain an authentication result, wherein the target first certificate chain is a first certificate chain encrypted by the second handshake key and obtained by the second terminal from the second terminal according to the first certificate request; the second terminal generates a second handshake key and a ciphertext according to a target algorithm selected from the algorithm support list and matching the hybrid key exchange parameter, and the hybrid key exchange parameter and the first random number, comprising: the second terminal generates a classical pre-secret key by using the first public key, a third private key provided by the second terminal, and a target national secret algorithm selected by the second terminal in the algorithm support list and matching the first public key, and generates an anti-quantum pre-secret key and a ciphertext by using the second public key and a target anti-quantum key encapsulation algorithm selected by the second terminal in the algorithm support list and matching the second public key; the second terminal generates a second handshake key according to the first random number, the classical pre-secret key, the anti-quantum pre-secret key, and a target key derivation algorithm selected by the second terminal in the algorithm support list.

2. The method of claim 1, wherein, the first terminal determines a first handshake key by using the third public key, a first private key generated by using the first national secret algorithm, and the target national secret algorithm for calculation to obtain the classical pre-secret key, and a second private key generated by using the first anti-quantum key encapsulation algorithm and the target anti-quantum key encapsulation algorithm for decryption to obtain the anti-quantum pre-secret key; the first terminal generates a first handshake key according to the first random number, the classical pre-secret key, the anti-quantum pre-secret key, and the target key derivation algorithm. the first terminal verifies a target first certificate chain sent by the second terminal by using the first handshake key to obtain an authentication result, comprising:

3. The method of claim 2, wherein, the first terminal decrypts the target first certificate chain by using the first handshake key to obtain a first certificate chain; the first terminal verifies the first certificate chain by using a root certificate in a CA institution to obtain an authentication result. each certificate in the first certificate chain represents a signature algorithm of the certificate by using a self-defined object identifier field, and the signature algorithm comprises a hybrid signature algorithm.

4. The method of claim 3, wherein, ​ 5. The method of claim 4, wherein, The first terminal verifies the first certificate chain by using a root certificate in the CA mechanism to obtain an authentication result, including: The first terminal collects an object identifier of a current certificate to be verified in the first certificate chain; The first terminal parses the current certificate to be verified by using the object identifier to obtain a first hybrid signature algorithm; the first hybrid signature algorithm includes a second national secret algorithm and a first anti-quantum key signature algorithm; The first terminal separates the hybrid signature in the current certificate to be verified according to the second national secret algorithm and the first anti-quantum key signature algorithm to obtain a first national secret signature and a first anti-quantum key signature; The first terminal determines the public key of the second national secret algorithm and the public key of the first anti-quantum key signature algorithm in the public key of the root certificate or the upper-level certificate of the CA mechanism according to the second national secret algorithm and the first anti-quantum key signature algorithm; The first terminal verifies the first national secret signature by using the public key of the second national secret algorithm in combination with the second national secret algorithm, and verifies the first anti-quantum key signature by using the public key of the first anti-quantum key signature algorithm in combination with the first anti-quantum key signature algorithm, to obtain a signature authentication result of the current certificate to be verified; After the signature authentication of the current certificate to be verified passes, the first terminal collects an object identifier of a next node certificate of the current certificate to be verified in the first certificate chain, and returns to execute the step of parsing the current certificate to be verified by using the object identifier to obtain the first hybrid signature algorithm, until all the certificates in the first certificate chain pass the verification, the first certificate chain is legal, and the second terminal is trusted.

6. The method according to any one of claims 1 to 5, wherein, After verifying the target first certificate chain sent by the second terminal by using the first handshake key to obtain an authentication result, the method further includes: The first terminal obtains a second certificate request encrypted by the second handshake key from the second terminal; The first terminal decrypts the encrypted second certificate request provided by the second terminal by using the first handshake key to obtain the second certificate request; The first terminal determines a second certificate chain of the first terminal according to the second certificate request; The first terminal encrypts the second certificate chain by using the first handshake key to obtain a target second certificate chain, and sends the target second certificate chain to the second terminal; The second terminal verifies the target second certificate chain by using the second handshake key to obtain an authentication result.

7. The method of claim 6, wherein, The second terminal verifies the target second certificate chain by using the second handshake key to obtain an authentication result, including: The second terminal decrypts the target second certificate chain by using the second handshake key to obtain a second certificate chain; The second terminal verifies the second certificate chain by using a root certificate in the CA mechanism to obtain an authentication result.

8. The method of claim 7, wherein, Each certificate in the second certificate chain uses a self-defined object identifier field to represent a signature algorithm of the certificate, and the signature algorithm includes a hybrid signature algorithm.

9. The method of claim 8, wherein, The second terminal verifies the second certificate chain by using a root certificate in the CA mechanism to obtain an authentication result, including: The second terminal collects an object identifier of a current certificate to be verified in the second certificate chain; The second terminal parses the current certificate to be verified by using the object identifier to obtain a second hybrid signature algorithm; the second hybrid signature algorithm comprises a third national secret algorithm and a second anti-quantum key signature algorithm; The second terminal separates a hybrid signature in the current certificate to be verified according to the third national secret algorithm and the second anti-quantum key signature algorithm to obtain a second national secret signature and a second anti-quantum key signature; The second terminal determines a public key of the third national secret algorithm and a public key of the second anti-quantum key signature algorithm in a public key of a root certificate or a higher-level certificate of a CA institution according to the third national secret algorithm and the second anti-quantum key signature algorithm; The second terminal verifies the second national secret signature by using the public key of the third national secret algorithm in combination with the third national secret algorithm, and verifies the second anti-quantum key signature by using the public key of the second anti-quantum key signature algorithm in combination with the second anti-quantum key signature algorithm, to obtain a signature authentication result of the current certificate to be verified; After the signature authentication of the current certificate to be verified passes, the second terminal collects an object identifier of a next node certificate of the current certificate to be verified in the second certificate chain, and returns to execute the step of parsing the current certificate to be verified by using the object identifier to obtain the second hybrid signature algorithm, until all the certificates in the second certificate chain pass the verification, the second certificate chain is legal, and the first terminal is trusted.

10. The method of claim 6, wherein, The method further comprises: The second terminal obtains a first handshake message sent by the first terminal, and performs a hash operation on the received algorithm support list, the hybrid key exchange parameter, the first certificate request and the first random number to obtain a second handshake message; the first handshake message is a handshake message obtained by performing a hash operation on the algorithm support list, the hybrid key exchange parameter, the first certificate request and the first random number provided by the first terminal; The second terminal compares the first handshake message with the second handshake message; When the first handshake message is the same as the second handshake message, the second terminal performs a hash operation on a second certificate request, a target first certificate chain provided by the second terminal, a third public key provided by the second terminal, a target algorithm selected by the second terminal in the algorithm support list, a first encrypted random number provided by the second terminal, a second encrypted random number provided by the second terminal and the ciphertext to obtain a third handshake message; The second terminal signs the second handshake message and the third handshake message by using the third private key to obtain a signed handshake message; The second terminal encrypts the signed handshake message by using the second handshake key, and sends the encrypted signed handshake message to the first terminal; the first terminal decrypts the encrypted signed handshake message by using the first handshake secret key, and verifies the decrypted signed handshake message by using the third public key provided by the second terminal.

11. The method of claim 10, wherein, The method further comprises: The second terminal generates a first session key according to a second handshake key, a second random number provided by the second terminal, and a target key derivation algorithm selected by the second terminal in the algorithm support list; The second terminal generates a second session key according to the second handshake key, a third random number provided by the second terminal, and the target key derivation algorithm.

12. The method of claim 11, wherein, After the second terminal generates the second session key according to the second handshake key, the third random number provided by the second terminal, and the target key derivation algorithm, the method further comprises: The first terminal acquires a first encrypted random number and a second encrypted random number provided by the second terminal; wherein the first encrypted random number is generated by the second terminal by encrypting the second random number provided by the second terminal according to the classical pre-key and the target national secret algorithm, and the second encrypted random number is generated by the second terminal by encrypting the third random number provided by the second terminal according to the anti-quantum pre-key and the target anti-quantum key packaging algorithm; The first terminal decrypts the first encrypted random number by using the classical pre-key and the target national secret algorithm to obtain the second random number; The first terminal decrypts the second encrypted random number by using the anti-quantum pre-key and the target anti-quantum key packaging algorithm to obtain the third random number; The first terminal generates the first session key according to the first handshake key, the second random number, and the target key derivation algorithm; The first terminal generates the second session key according to the first handshake key, the third random number, and the target key derivation algorithm.

13. A security authentication method characterized by, Applied to the second terminal, the method comprises: Receiving an algorithm support list, a hybrid key exchange parameter and a first random number, and a first certificate request sent by the first terminal, and generating a second handshake key and a ciphertext according to a target algorithm selected from the algorithm support list and matching the hybrid key exchange parameter and the first random number; the hybrid key exchange parameter comprises a first public key generated by using a first national secret algorithm and a second public key generated by using a first anti-quantum key packaging algorithm; Sending a third public key provided by the second terminal, a target algorithm selected by the second terminal, and the ciphertext to the first terminal, so that the first terminal generates a first handshake key; Sending a target first certificate chain to the first terminal to make the first terminal verify the target first certificate chain based on the first handshake key, wherein the target first certificate chain is a first certificate chain encrypted by the second handshake key, which is acquired by the second terminal from the second terminal according to the first certificate request; The second handshake key and the ciphertext are generated according to the target algorithm selected from the algorithm support list and matching the hybrid key exchange parameter and the first random number, comprising: The first public key, the third private key provided by the second terminal, and a target national secret algorithm matching the first public key selected by the second terminal from the algorithm support list are combined to generate a classical pre-secret key, and the second public key, the third private key provided by the second terminal, and a target anti-quantum key encapsulation algorithm matching the second public key selected by the second terminal from the algorithm support list are combined to generate an anti-quantum pre-secret key and ciphertext; The second handshake key is generated according to the first random number, the classical pre-secret key, the anti-quantum pre-secret key, and a target key derivation algorithm selected by the second terminal from the algorithm support list.

14. A secure authentication system characterized by, The system is applied to the first terminal and the second terminal, and the system comprises: The first terminal sends an algorithm support list, a hybrid key exchange parameter, a first random number, and a first certificate request to the second terminal; the hybrid key exchange parameter comprises a first public key generated by using a first national secret algorithm and a second public key generated by using a first anti-quantum key encapsulation algorithm; The second terminal receives the algorithm support list, the hybrid key exchange parameter, and the first random number sent by the first terminal, and generates a second handshake key and ciphertext according to a target algorithm matching the hybrid key exchange parameter selected from the algorithm support list and the hybrid key exchange parameter and the first random number; The second terminal sends a third public key provided by the second terminal, the target algorithm selected by the second terminal, and the ciphertext to the first terminal; The first terminal obtains a first handshake key by using the third public key provided by the second terminal, the target algorithm selected by the second terminal, and the ciphertext sent by the second terminal; The first terminal verifies a target first certificate chain sent by the second terminal by using the first handshake key, wherein the target first certificate chain is a first certificate chain encrypted by the second handshake key and obtained by the second terminal from the second terminal according to the first certificate request; The second terminal receives the algorithm support list, the hybrid key exchange parameter, and the first random number sent by the first terminal, and generates a second handshake key and ciphertext according to a target algorithm matching the hybrid key exchange parameter selected from the algorithm support list and the hybrid key exchange parameter and the first random number; The first public key, the third private key provided by the second terminal, and a target national secret algorithm matching the first public key selected by the second terminal from the algorithm support list are combined to generate a classical pre-secret key, and the second public key, the third private key provided by the second terminal, and a target anti-quantum key encapsulation algorithm matching the second public key selected by the second terminal from the algorithm support list are combined to generate an anti-quantum pre-secret key and ciphertext; The second handshake key is generated according to the first random number, the classical pre-secret key, the anti-quantum pre-secret key, and a target key derivation algorithm selected by the second terminal from the algorithm support list.

15. An electronic device, comprising: The memory and the processor are included, the memory stores computer instructions, and the processor is configured to run the computer instructions to execute the method in any one of claims 1 to 13.

16. A storage medium, characterized by The storage medium stores computer instructions, and the computer instructions are configured to execute the method in any one of claims 1 to 13 when running.

Citation Information

Patent Citations

  • Post-quantum and national secret hybrid dual-certificate SSL handshake method and device

    CN119071075A