An IPSec hybrid anti-quantum computing security method and electronic device

By adopting quantum cryptographic algorithms and multiple encryption technologies in IPsec communication, the problem of key cracking in quantum computing is solved, and high security communication is achieved, avoiding the high cost of QKD technology.

CN119652525BActive Publication Date: 2025-05-02HANGZHOU HIKVISION DIGITAL TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510183115.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-02-19
Publication Date
2025-05-02
Estimated Expiration
2045-02-19

AI Technical Summary

Technical Problem

The prior art is difficult to effectively resist the cracking of keys by quantum computing, especially in IPsec communications, where QKD technology is immature and costly.

Method used

The IPSec hybrid anti-quantum computing security method is adopted to ensure that the key is quantum-resistant by negotiating keys between the responder and the initiator, using the key generated by the anti-quantum cryptography algorithm, and combining multiple encryption to protect the keys to ensure that the keys are quantum-resistant.

Benefits of technology

Effectively resist the cracking of keys by quantum computing, improves communication security, avoids the high cost of using QKD technology, and realizes anti-quantum computing protection under the IPsec framework.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119652525B_ABST
    Figure CN119652525B_ABST
Patent Text Reader

Abstract

The embodiment of the present application provides an IPSec hybrid anti-quantum computing security method and electronic device, which relates to the field of communication security technology. The method includes: when receiving a key negotiation request sent by an initiator, sending a first key negotiation message to the initiator; receiving a second key negotiation message sent by the initiator; using the private key corresponding to the encryption certificate of the responder to decrypt the received first encrypted information, and decrypting the received second encrypted information to obtain a first anti-quantum encryption public key; using the first anti-quantum encryption public key to encapsulate the second random key, and using the third random key to encrypt to obtain the third encrypted information; using the public key in the encryption certificate of the initiator to encrypt the third random key to obtain the fourth encrypted information; sending a third key negotiation message containing the third encrypted information and the fourth encrypted information to the initiator. This solution can resist the cracking of the key by quantum computing.
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 an IPSec hybrid anti-quantum computing security method and electronic device. Background Art

[0002] IPsec (Internet Protocol Security) is a security and confidentiality architecture proposed by IETF (Internet Engineering Task Force) that uses cryptography to protect IP layer communications. Before formal communication, the two parties in IPsec communication will negotiate keys and then use the keys to encrypt the transmitted information to protect communication security. However, with the emergence of quantum computing, the keys used in the communication process can be easily cracked by quantum computing, which has an adverse impact on communication security.

[0003] At present, in order to prevent keys from being cracked by quantum computing, related technologies usually use QKD (quantum key distribution) technology to protect the information transmitted during the communication process. However, the current QKD technology is still immature and the cost is huge, making it difficult to put into use.

[0004] Therefore, how to resist the cracking of keys by quantum computing remains an urgent problem to be solved. Summary of the invention

[0005] The purpose of the embodiment of the present application is to provide an IPSec hybrid anti-quantum computing security method and electronic device to achieve the purpose of resisting the cracking of keys by quantum computing. The specific technical solution is as follows:

[0006] The embodiment of the present application first provides an IPSec hybrid anti-quantum computing security method, which is applied to a responder and includes:

[0007] When receiving a key negotiation request sent by the initiator, sending a first key negotiation message to the initiator; wherein the first key negotiation message includes the encryption certificate of the responder;

[0008] Receive a second key negotiation message sent by the initiator; wherein the second key negotiation message includes: first encrypted information obtained by encrypting a first random key using a public key in the encryption certificate of the responder, the encryption certificate of the initiator, and second encrypted information; the second encrypted information is obtained by encrypting a first quantum-resistant encryption public key generated by the initiator based on a quantum-resistant cryptographic algorithm using the first random key;

[0009] Decrypting the received first encrypted information using the private key corresponding to the encryption certificate of the responder to obtain the first random key;

[0010] Decrypting the received second encrypted information using the first random key to obtain the first quantum-resistant encryption public key;

[0011] Encapsulating the second random key using the first quantum-resistant encryption public key to obtain a first key encapsulation;

[0012] Encrypting the first key package using a third random key to obtain third encrypted information; and encrypting the third random key using a public key in the encryption certificate of the initiator to obtain fourth encrypted information;

[0013] Sending a third key agreement message including the third encrypted information and the fourth encrypted information to the initiator, so that the initiator decrypts the received fourth encrypted information based on the private key corresponding to the encryption certificate of the initiator to obtain the third random key, decrypts the received third encrypted information using the third random key to obtain the first key encapsulation, and decapsulates the decrypted first key encapsulation based on the first quantum resistant encryption private key corresponding to the first quantum resistant encryption public key to obtain the second random key.

[0014] The embodiment of the present application also provides an IPSec hybrid anti-quantum computing security method, which is applied to an initiator and includes:

[0015] Send a key negotiation request to the responder;

[0016] Receiving a first key negotiation message sent by the responder; wherein the first key negotiation message includes an encryption certificate of the responder;

[0017] Encrypting the first random key using the public key in the encryption certificate of the responder to obtain first encrypted information;

[0018] Generate a first quantum-resistant encryption private key corresponding to the first quantum-resistant encryption public key based on a quantum-resistant cryptographic algorithm;

[0019] Encrypting the first quantum-resistant encryption public key using the first random key to obtain second encrypted information;

[0020] Sending a second key negotiation message including the first encryption information, the second encryption information, and the encryption certificate of the initiator to the responder;

[0021] Receive a third key agreement message sent by the responder; wherein the third key agreement message includes: a first key encapsulation, third encryption information, and fourth encryption information; the first key encapsulation is obtained by encapsulating the second random key with the first quantum-resistant encryption public key; the third encryption information is obtained by encrypting the first key encapsulation with the third random key; the fourth encryption information is obtained by encrypting the third random key with the public key in the encryption certificate of the initiator;

[0022] Decrypting the received fourth encrypted information based on the private key corresponding to the encryption certificate of the initiator to obtain the third random key;

[0023] Decrypting the received third encrypted information using the third random key to obtain the first key encapsulation;

[0024] The first key encapsulation obtained by decryption is decapsulated based on the first quantum-resistant encryption private key to obtain the second random key.

[0025] The embodiment of the present application also provides an IPSec hybrid anti-quantum computing security system, the system comprising: an initiator and a responder; wherein,

[0026] The responder is used to execute any of the above IPSec hybrid anti-quantum computing security methods applied to the responder;

[0027] The initiator is used to execute any of the above-mentioned IPSec hybrid anti-quantum computing security methods applied to the initiator.

[0028] The embodiment of the present application also provides an IPSec hybrid anti-quantum computing security device, which is applied to a responder, and includes:

[0029] A first key negotiation message sending module, configured to send a first key negotiation message to the initiator upon receiving a key negotiation request sent by the initiator; wherein the first key negotiation message includes an encryption certificate of the responder;

[0030] A second key negotiation message receiving module is used to receive a second key negotiation message sent by the initiator; wherein the second key negotiation message includes: first encrypted information obtained by encrypting a first random key using a public key in the encryption certificate of the responder, the encryption certificate of the initiator, and second encrypted information; the second encrypted information is obtained by encrypting a first quantum-resistant encryption public key generated by the initiator based on a quantum-resistant cryptographic algorithm using the first random key;

[0031] A first encrypted information decryption module, configured to decrypt the received first encrypted information using a private key corresponding to the encryption certificate of the responder to obtain the first random key;

[0032] A second encrypted information decryption module, configured to decrypt the received second encrypted information using the first random key to obtain the first quantum-resistant encryption public key;

[0033] A first key encapsulation generation module, used to encapsulate the second random key using the first quantum-resistant encryption public key to obtain a first key encapsulation;

[0034] A third encryption information generation module is used to encrypt the first key package with a third random key to obtain third encryption information; and encrypt the third random key with a public key in the encryption certificate of the initiator to obtain fourth encryption information;

[0035] A third key agreement message sending module is used to send a third key agreement message including the third encrypted information and the fourth encrypted information to the initiator, so that the initiator decrypts the received fourth encrypted information based on the private key corresponding to the encryption certificate of the initiator to obtain the third random key, decrypts the received third encrypted information using the third random key to obtain a first key encapsulation, and decapsulates the decrypted first key encapsulation based on the first quantum-resistant encryption private key corresponding to the first quantum-resistant encryption public key to obtain the second random key.

[0036] The embodiment of the present application also provides an IPSec hybrid anti-quantum computing security device, which is applied to an initiator, and includes:

[0037] A key negotiation request sending module, used for sending a key negotiation request to a responder;

[0038] A first key negotiation message receiving module, configured to receive a first key negotiation message sent by the responder; wherein the first key negotiation message includes an encryption certificate of the responder;

[0039] A first encrypted information generating module, configured to encrypt a first random key using a public key in the encryption certificate of the responder to obtain first encrypted information;

[0040] A first quantum-resistant encryption public key generation module, used to generate a first quantum-resistant encryption public key based on a quantum-resistant cryptographic algorithm;

[0041] Encrypting the first quantum-resistant encryption public key using the first random key to obtain second encrypted information;

[0042] A second key negotiation message sending module, configured to send a second key negotiation message including the first encryption information, the second encryption information, and the encryption certificate of the initiator to the responder;

[0043] A third key negotiation message receiving module is used to receive a third key negotiation message sent by the responder; wherein the third key negotiation message includes: a first key encapsulation, third encryption information, and fourth encryption information; the first key encapsulation is obtained by encapsulating the second random key with the first quantum-resistant encryption public key; the third encryption information is obtained by encrypting the first key encapsulation with the third random key; the fourth encryption information is obtained by encrypting the third random key with the public key in the encryption certificate of the initiator;

[0044] a fourth encrypted information decryption module, configured to decrypt the received fourth encrypted information based on the private key corresponding to the encryption certificate of the initiator to obtain the third random key;

[0045] A third encrypted information decryption module, used to decrypt the received third encrypted information using the third random key to obtain a first key package;

[0046] The first key decapsulation module is used to decapsulate the decrypted first key encapsulation based on the first quantum-resistant encryption private key corresponding to the first quantum-resistant encryption public key to obtain the second random key.

[0047] The present application also provides an electronic device, including:

[0048] Memory, used to store computer programs;

[0049] The processor is used to implement any of the above-mentioned IPSec hybrid anti-quantum computing security methods when executing the program stored in the memory.

[0050] An embodiment of the present application also provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, any of the above-mentioned IPSec hybrid anti-quantum computing security methods is implemented.

[0051] An embodiment of the present application also provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute any of the above-described IPSec hybrid anti-quantum computing security methods.

[0052] Beneficial effects of the embodiments of the present application: The IPSec hybrid anti-quantum computing security method provided by the embodiments of the present application has a certain degree of quantum resistance because the key generated by the quantum-resistant cryptographic algorithm has a certain degree of quantum resistance, and the second random key sent by the responding direction initiator has been encapsulated by the first quantum-resistant encryption public key generated based on the quantum-resistant cryptographic algorithm, so that the second random key is also quantum-resistant; and the first quantum-resistant encryption public key is also encrypted by the first random key during the sending process, and the first random key is also encrypted using the public key in the encryption certificate. It can be seen that this scheme mixes quantum resistance under the IPSec framework, and combines multiple encryptions to protect the key, which can make the negotiated random key in the communication process have strong quantum resistance, that is, it can effectively resist the cracking of quantum computing, thereby improving the security of communication.

[0053] Of course, implementing any product or method of the present application does not necessarily require achieving all of the advantages described above at the same time. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other embodiments can also be obtained based on these drawings.

[0055] Figure 1 A first interactive schematic diagram of the IPSec hybrid anti-quantum computing security system provided in an embodiment of the present application;

[0056] Figure 2 A second interactive schematic diagram of the IPSec hybrid anti-quantum computing security system provided in an embodiment of the present application;

[0057] Figure 3 A third interactive schematic diagram of the IPSec hybrid anti-quantum computing security system provided in an embodiment of the present application;

[0058] Figure 4 A fourth interactive schematic diagram of the IPSec hybrid anti-quantum computing security system provided in an embodiment of the present application;

[0059] Figure 5 A schematic diagram of a structure involved in the IPSec hybrid anti-quantum computing security system provided in an embodiment of the present application;

[0060] Figure 6 A fifth interactive schematic diagram of the IPSec hybrid anti-quantum computing security system provided in an embodiment of the present application;

[0061] Figure 7A schematic diagram of a flow chart of an IPSec hybrid anti-quantum computing security method provided in an embodiment of the present application;

[0062] Figure 8 A flowchart of another IPSec hybrid anti-quantum computing security method provided in an embodiment of the present application;

[0063] Fig. 9 A schematic diagram of the structure of an IPSec hybrid anti-quantum computing security device provided in an embodiment of the present application;

[0064] Fig.10 A schematic diagram of the structure of another IPSec hybrid anti-quantum computing security device provided in an embodiment of the present application;

[0065] Fig.11 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0066] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field based on the present application belong to the scope of protection of the present application.

[0067] In order to resist the cracking of keys by quantum computing, the embodiment of the present application provides an IPSec hybrid anti-quantum computing security method and an electronic device. The embodiment of the present application first provides an IPSec hybrid anti-quantum computing security method applied to a responder, and the responder can be any electronic device that responds to a key negotiation request, such as a server, a computer, etc. The IPSec hybrid anti-quantum computing security method may include the following steps:

[0068] When receiving the key negotiation request sent by the initiator, sending a first key negotiation message to the initiator; wherein the first key negotiation message includes the encryption certificate of the responder;

[0069] Receive a second key negotiation message sent by the initiator; wherein the second key negotiation message includes: first encrypted information obtained by encrypting the first random key using the public key in the encryption certificate of the responder, the encryption certificate of the initiator, and second encrypted information; wherein the second encrypted information is obtained by encrypting the first quantum-resistant encryption public key generated by the initiator based on the quantum-resistant cryptographic algorithm using the first random key;

[0070] Decrypting the received first encrypted information using the private key corresponding to the encryption certificate of the responder to obtain a first random key;

[0071] Decrypting the received second encrypted information using the first random key to obtain a first quantum-resistant encryption public key;

[0072] Encapsulating the second random key using the first quantum-resistant encryption public key to obtain a first key encapsulation;

[0073] Encrypting the first key package using the third random key to obtain third encrypted information; and encrypting the third random key using the public key in the encryption certificate of the initiator to obtain fourth encrypted information;

[0074] A third key agreement message including the third encrypted information and the fourth encrypted information is sent to the initiator, so that the initiator decrypts the received fourth encrypted information based on the private key corresponding to the encryption certificate of the initiator to obtain the third random key, decrypts the received third encrypted information using the third random key to obtain the first key encapsulation, and decapsulates the decrypted first key encapsulation based on the first quantum resistant encryption private key corresponding to the first quantum resistant encryption public key to obtain the second random key.

[0075] In this embodiment, since the key generated by the quantum-resistant cryptographic algorithm has a certain degree of quantum resistance, the second random key sent by the responding direction to the initiator is encapsulated by the first quantum-resistant encryption public key generated based on the quantum-resistant cryptographic algorithm, so that the second random key is also quantum-resistant; and the first quantum-resistant encryption public key is also encrypted by the first random key during the sending process, and the first random key is also encrypted using the public key in the encryption certificate. It can be seen that this solution mixes quantum-resistant computing under the IPSec framework and protects the key in combination with multiple encryptions, so that the negotiated random key in the communication process can have strong quantum resistance, that is, it can effectively resist the cracking of quantum computing, thereby improving the security of communication.

[0076] For ease of understanding, the IPSec hybrid anti-quantum computing security system provided by the embodiment of the present application is first introduced in conjunction with the accompanying drawings. Figure 1 As shown, the system includes: an initiator 10 and a responder 20; the interaction process between the initiator 10 and the responder 20 may include the following steps:

[0077] S101, the initiator 10 sends a key negotiation request to the responder 20;

[0078] The initiator 10 is the party that initiates communication with the responder 20, which can be any device that performs network communication with the responder 20, such as a terminal device such as a computer, a smart phone, or a server. It is understandable that when two devices perform network communication, in order to ensure communication security, key negotiation needs to be performed first, and at this time, the initiator 10 can send a key negotiation request to the responder 20. The key negotiation request is actually a message, which can include a message header indicating that the message is a key negotiation request, for example, the message header can be HDR (IKE_INIT).

[0079] S102, when the responder 20 receives the key negotiation request sent by the initiator 10, the responder 20 sends a first key negotiation message to the initiator 10;

[0080] Among them, the first key negotiation message includes the encryption certificate of the responder 20. It is understandable that a device with network communication function can request a certificate authority (CA) to issue a digital certificate to obtain its own encryption certificate and signature certificate, and the encryption certificate and signature certificate can both contain a public key. The digital certificate can be an SM (national secret) 2 certificate, etc. The encryption certificate and signature certificate can also include information such as the device's identification and digital signature. When the device sends a message to a peer (which can be another electronic device), it can attach its own encryption certificate and signature certificate to the message so that the peer can confirm the identity of the device.

[0081] When the device obtains an encryption certificate and a signature certificate, it can also simultaneously generate a private key corresponding to the encryption certificate and a private key corresponding to the signature certificate; wherein the public key in the encryption certificate and the private key corresponding to the encryption certificate are a pair of asymmetric cryptographic keys; the public key in the signature certificate and the private key corresponding to the signature certificate are a pair of asymmetric cryptographic keys.

[0082] Since the encryption certificate and the signature certificate both contain their respective public keys, during the actual execution process, the first key negotiation message generated by the responder 20 may include the encryption certificate and the signature certificate of the responder 20, and then by sending the first key negotiation message to the initiator 10, the initiator 10 can obtain the public key in the encryption certificate and the public key in the signature certificate of the responder 20.

[0083] S103, the initiator 10 receives the first key negotiation message sent by the responder 20; uses the public key in the encryption certificate of the responder 20 to encrypt the first random key to obtain first encrypted information; generates a first quantum-resistant encryption public key based on a quantum-resistant cryptographic algorithm; uses the first random key to encrypt the first quantum-resistant encryption public key to obtain second encrypted information;

[0084] Among them, quantum resistant cryptography (QRC), also known as post-quantum cryptography, refers to mathematical cryptographic algorithms that can resist attacks from quantum computers. Quantum resistant cryptographic algorithms can be divided into the following categories: code-based encryption (C type), multivariable polynomial-based encryption (M type), secure hash function-based encryption (S type), lattice-based encryption (L type), etc.

[0085] After receiving the first key negotiation message, the initiator 10 can generate a string of random numbers based on a random number generation algorithm as a first random key, and then use an asymmetric encryption algorithm to encrypt the first random key using the public key in the encryption certificate of the received responder 20 to obtain first encrypted information; at the same time, a first quantum-resistant encryption public key is generated based on a quantum-resistant cryptographic algorithm; and then a symmetric encryption algorithm is used to encrypt the first quantum-resistant encryption public key using the first random key to obtain second encrypted information.

[0086] S104, the initiator 10 sends a second key negotiation message including the first encryption information, the second encryption information, and the encryption certificate of the initiator 10 to the responder 20;

[0087] The initiator 10 may generate a second key negotiation message including the first encryption information, the second encryption information, and the encryption certificate of the initiator 10 , and send the second key negotiation message to the responder 20 .

[0088] S105, the responder 20 receives the second key negotiation message sent by the initiator 10; uses the private key corresponding to the encryption certificate of the responder 20 to decrypt the received first encrypted information to obtain a first random key; uses the first random key to decrypt the received second encrypted information to obtain a first quantum-resistant encryption public key;

[0089] Since the public key in the encryption certificate of the responder 20 and the private key corresponding to the encryption certificate are a pair of asymmetric codes, the first encrypted information is obtained by asymmetric encryption using the public key in the encryption certificate of the responder 20. Therefore, the responder 20 can use the private key corresponding to the encryption certificate of the responder 20 to decrypt the received first encrypted information to obtain the first random key. The second encrypted information is obtained by the initiator 10 encrypting the first quantum-resistant encryption public key using the first random key. Therefore, after obtaining the first random key, the responder 20 can use the first random key to decrypt the second encrypted information to obtain the first quantum-resistant encryption public key.

[0090] S106, the responder 20 encapsulates the second random key using the first quantum-resistant encryption public key to obtain a first key encapsulation; encrypts the first key encapsulation using the third random key to obtain third encrypted information; and encrypts the third random key using the public key in the encryption certificate of the initiator 10 to obtain fourth encrypted information;

[0091] In this step, the responder 20 can encapsulate the second random key with the first quantum-resistant encryption public key based on the KEM (Key Encapsulation Mechanism) algorithm to generate a first key encapsulation. Since the first quantum-resistant encryption public key is generated based on a quantum-resistant cryptographic algorithm and is quantum-resistant, encapsulating the second random key with the first quantum-resistant encryption public key can make the second random key resistant to quantum computing cracking during transmission. The second random key can be a string of random numbers generated by the responder 20.

[0092] In order to further ensure the security of the second random key, the responder 20 can also generate a third random key, and then use the third random key to encrypt the first key package, and then use an asymmetric encryption algorithm to encrypt the third random key using the public key in the encryption certificate of the initiator 10.

[0093] S107, the responder 20 sends a third key negotiation message including the third encryption information and the fourth encryption information to the initiator 10;

[0094] The responder 20 may generate a third key agreement message including the third encryption information and the fourth encryption information, and send the message to the initiator 10 .

[0095] S108, the initiator 10 receives the third key negotiation message sent by the responder 20; decrypts the received fourth encrypted information based on the private key corresponding to the encryption certificate of the initiator 10 to obtain a third random key; uses the third random key to decrypt the received third encrypted information to obtain a first key encapsulation; based on the first quantum-resistant encryption private key corresponding to the first quantum-resistant encryption public key, decapsulates the decrypted first key encapsulation to obtain a second random key.

[0096] Since the public key in the encryption certificate of the initiator 10 and the private key corresponding to the encryption certificate are a pair of asymmetric keys, the initiator 10 can first decrypt the received fourth encrypted information based on the private key corresponding to the encryption certificate of the initiator 10 to obtain the third random key, and then use the third random key to decrypt the received third encrypted information to obtain the first key package, and finally, based on the first quantum-resistant encryption private key corresponding to the first quantum-resistant encryption public key, decapsulate the decrypted first key package to obtain the second random key. In this way, both the initiator 10 and the responder 20 can know the first random key and the second random key, thereby completing the key negotiation. The random key obtained in this stage can be used for key derivation to obtain the protection key of the subsequent sub-tunnel negotiation stage.

[0097] In this embodiment, since the key generated by the quantum-resistant cryptographic algorithm has a certain degree of quantum resistance, the second random key sent by the responding direction to the initiator is encapsulated by the first quantum-resistant encryption public key generated based on the quantum-resistant cryptographic algorithm, so that the second random key is also quantum-resistant; and the first quantum-resistant encryption public key is also encrypted by the first random key during the sending process, and the first random key is also encrypted using the public key in the encryption certificate. It can be seen that this solution mixes quantum-resistant computing under the IPSec framework and protects the key in combination with multiple encryptions, so that the negotiated random key in the communication process can have strong quantum resistance, that is, it can effectively resist the cracking of quantum computing, thereby improving the security of communication.

[0098] In an embodiment of the present application, the initiator 10 encrypts the first quantum-resistant encryption public key using the first random key to obtain the second encrypted information, which may include:

[0099] The first random key is used to encrypt the first quantum-resistant encryption public key and the first quantum-resistant signature public key generated by the initiator 10 based on the quantum-resistant cryptographic algorithm to obtain second encrypted information.

[0100] Before sending the second key agreement message including the first encrypted information, the second encrypted information, and the encryption certificate of the initiator 10 to the responder 20, the initiator 10 may also use one of the private key corresponding to the signature certificate of the initiator 10 and the first quantum-resistant signature private key corresponding to the first quantum-resistant signature public key to perform a first re-signature on the first encrypted information and the second encrypted information to obtain the first signature information, and use the other of the private key corresponding to the signature certificate of the initiator 10 and the first quantum-resistant signature private key to perform a second re-signature on the first signature information to obtain the second signature information, that is, the initiator 10 may use the private key corresponding to the signature certificate of the initiator 10 to sign the first encrypted information and the second encrypted information to obtain the first signature information, and use the first quantum-resistant signature private key corresponding to the first quantum-resistant signature public key to sign the first signature information to obtain the second signature information; or, the initiator 10 may first use the first quantum-resistant signature private key corresponding to the first quantum-resistant signature public key to sign the first encrypted information and the second encrypted information to obtain the first signature information, and then use the private key corresponding to the signature certificate of the initiator 10 to sign the first signature information to obtain the second signature information.

[0101] The initiator 10 may also use the first random key to encrypt the first quantum-resistant encryption public key and the first quantum-resistant signature public key to obtain second encrypted information.

[0102] In this case, the initiator 10 sends a second key negotiation message including the first encryption information, the second encryption information, and the encryption certificate of the initiator 10 to the responder 20, including:

[0103] A second key negotiation message including the first encrypted information, the second encrypted information, the encryption certificate of the initiator 10, the signature certificate of the initiator 10, the first signature information, and the second signature information is sent to the responder 20.

[0104] In this way, after receiving the second key agreement message, the responder 20 can use the first random key to decrypt the received second encrypted information to obtain the first quantum-resistant encryption public key and the first quantum-resistant signature public key; and before encapsulating the third random key with the first quantum-resistant encryption public key to obtain the first key encapsulation, perform signature verification on the received first signature information using the public key corresponding to the private key used for the first re-signature, and perform signature verification on the received second signature information using the public key corresponding to the private key used for the second re-signature.

[0105] Specifically, if the first signature information is obtained by signing the first encrypted information and the second encrypted information using the private key corresponding to the signature certificate of the initiator 10, and the second signature information is obtained by signing the first signature information using the first quantum-resistant signature private key corresponding to the first quantum-resistant signature public key; the responder 20 can use the asymmetric signature algorithm to calculate the received first encrypted information and the second encrypted information based on the public key in the signature certificate of the initiator 10 to obtain the data to be verified, and then compare whether the obtained data to be verified is the same as the first signature information. If they are the same, the signature verification passes, otherwise the signature verification fails; similarly, the responder 20 can use the asymmetric signature algorithm to calculate the received first signature information based on the first quantum-resistant signature public key to obtain the data to be verified, and then compare whether the obtained data to be verified is the same as the second signature information. If they are the same, the signature verification passes, otherwise the signature verification fails, and the responder 20 can end the communication process with the initiator 10, that is, terminate the current SPI (security parameter index) session with the initiator 10.

[0106] When the signature verification passes, it indicates that the data of the initiator 10 has not been tampered with, and the received data is safe and complete. At this time, the step of encapsulating the second random key with the first quantum-resistant encryption public key to obtain the first key encapsulation can be performed.

[0107] In this embodiment, it is possible to resist the cracking of the key by quantum computing. Furthermore, the second key negotiation message includes the first signature information and the second signature information obtained by signing the encrypted information with the private key corresponding to the signature certificate and the quantum-resistant signature private key, so that the responder can perform signature verification on the first signature information and the second signature information after receiving the second key negotiation message to ensure the security of the data. This solution also does not need to adopt QKD technology, so there is no additional cost in deployment, the implementation cost is small, the cost is low, and it is easy to promote.

[0108] Moreover, the quantum-resistant signature key in this scheme can resist cracking by quantum computing, and because of the dual-signature mechanism, even if the quantum-resistant signature key is cracked, the key in the signature certificate can provide an additional layer of protection to better ensure information integrity.

[0109] In an embodiment of the present application, the responder 20 uses the third random key to encrypt the first key package to obtain the third encrypted information, which may include:

[0110] Using the third random key, encrypt the second quantum-resistant encryption public key and the first key package generated by the responder 20 to obtain third encrypted information, so that the initiator 10 encapsulates the current fourth random key based on the second quantum-resistant encryption public key to obtain the second key package;

[0111] That is to say, the third encrypted information may also include a second quantum-resistant encryption public key generated by the responder 20, so that the initiator 10 can obtain the second quantum-resistant encryption public key, and thus the initiator 10 may also generate a second key package by using steps similar to those for generating the first key package.

[0112] Specifically, after the initiator 10 decapsulates the decrypted first key encapsulation to obtain the second random key based on the first quantum resistant encryption private key corresponding to the first quantum resistant encryption public key, it can also use the second quantum resistant encryption public key to encapsulate the current fourth random key to obtain the current second key encapsulation; and send a fourth key negotiation message containing the current second key encapsulation to the responder 20.

[0113] In order to further perform key exchange, the initiator 10 can also generate a random key again, that is, the current fourth random key; use the first quantum-resistant encryption public key generated previously to encapsulate the current fifth random key to obtain the current third key encapsulation; and then send the fourth key negotiation message containing the second key encapsulation to the responder 20.

[0114] In this way, after the responder 20 sends the third key agreement message including the third encryption information and the fourth encryption information to the initiator 10, the responder 20 may further perform the following steps:

[0115] Step A1, receiving a fourth key negotiation message currently sent by the initiator 10; wherein the fourth key negotiation message includes: a second key encapsulation obtained by encapsulating the current fourth random key using the second quantum-resistant encryption public key;

[0116] Step A2, using the second quantum-resistant encryption private key corresponding to the second quantum-resistant encryption public key, decapsulates the currently received second key encapsulation to obtain a current fourth random key;

[0117] Step A3, encapsulating the current fifth random key using the first quantum-resistant encryption public key to obtain the current third key encapsulation;

[0118] Step A4: Send a fifth key negotiation message containing the current third key encapsulation to the initiator 10.

[0119] In this embodiment, in order to further perform key exchange, the responder 20 can also generate a random key again, that is, the current fifth random key, and then use the first quantum-resistant encryption public key to encapsulate the current fifth random key to obtain the current third key encapsulation, and send the fifth key negotiation message containing the current third key encapsulation to the initiator 10.

[0120] The initiator 10 may then perform the following steps:

[0121] Step B1, receiving the fifth key negotiation message currently sent by the responder 20; wherein the fifth key negotiation message includes a third key encapsulation obtained by encapsulating the current fifth random key using the first quantum-resistant encryption public key;

[0122] Step B2: based on the first quantum-resistant encryption private key, decapsulate the received third key encapsulation to obtain the current fifth random key.

[0123] Furthermore, the responder 20 uses the third random key to encrypt the first key package to obtain third encrypted information, which may include:

[0124] The second quantum-resistant encryption public key generated by the responder 20, the second quantum-resistant signature public key generated by the responder 20, and the first key encapsulation are encrypted using the third random key to obtain third encrypted information.

[0125] Before sending the third key agreement message to the initiator 10, the responder 20 may use one of the private key corresponding to the signature certificate of the responder 20 and the second quantum-resistant signature private key generated by the responder 20 to perform a first re-signature on the third encrypted information and the fourth encrypted information to obtain third signature information, and use the other of the private key corresponding to the signature certificate of the responder 20 and the second quantum-resistant signature private key to perform a second re-signature on the third signature information to obtain fourth signature information. In this way, the third key agreement message may also include the third signature information and the fourth signature information.

[0126] After the initiator 10 uses the third random key to decrypt the received third encrypted information and obtains the first key encapsulation, it can first decrypt to obtain the third random key, and then use the third random key to decrypt the third encrypted information to obtain the second quantum-resistant signature public key, so that the public key corresponding to the private key used for the first re-signature can be used to perform signature verification on the received third signature information, and the public key corresponding to the private key used for the second re-signature can be used to perform signature verification on the received fourth signature information; and when the signature verification passes, the subsequent step of decapsulating the first key encapsulation can be performed.

[0127] In one implementation, after sending the fourth key negotiation message including the currently encapsulated third negotiated key to the initiator 10, the responder 20 may also return to execute the step of receiving the fourth key negotiation message currently sent by the initiator 10 until the number of third key encapsulations sent reaches a preset number.

[0128] That is, the initiator 10 can generate different second key encapsulations for multiple times, and send the fourth key negotiation message to the responder 20 for multiple times, each time the fourth key negotiation message contains a different second key encapsulation, that is, contains a different random key; correspondingly, the responder 20 can also generate different third key encapsulations for multiple times, and send the fifth key negotiation message containing different third key encapsulations to the initiator 10 for multiple times, so as to achieve the purpose of multiple exchanges of quantum-resistant keys. Among them, the preset number can be set according to the security requirements, that is, the higher the security requirements, the larger the preset number can be set.

[0129] In addition, each fourth key negotiation message may also include signature information, which may be obtained by the initiator 10 using its own quantum-resistant signature private key, that is, the first quantum-resistant signature private key corresponding to the first quantum-resistant signature public key, to sign the current second key encapsulation; so that after receiving the fourth key negotiation message, the responder 20 may perform signature verification on the signature information based on the first quantum-resistant signature public key, and after the signature verification passes, perform the subsequent step of decapsulating the current second key encapsulation. Correspondingly, each fifth key negotiation message may also include signature information, which may be obtained by the responder 20 using its own quantum-resistant signature private key, that is, the second quantum-resistant signature private key corresponding to the second quantum-resistant signature public key, to sign the current third key encapsulation; so that after receiving the fifth key negotiation message, the initiator 10 may perform signature verification on the signature information based on the second quantum-resistant signature public key, and after the signature verification passes, perform the subsequent step of decapsulating the current third key encapsulation.

[0130] In this embodiment, the key cracking by quantum computing can be resisted. Furthermore, the initiator and the responder can exchange random keys encapsulated with quantum-resistant keys multiple times, which can achieve multiple key security exchanges, further improve the security of the key, and provide a basis for message encryption in the subsequent communication stage.

[0131] In an embodiment of the present application, after the responder 20 sends the third key negotiation message including the third encryption information and the fourth encryption information to the initiator 10, Figure 2 As shown, the interaction between the initiator 10 and the responder 20 may also include the following steps:

[0132] S201, the initiator 10 uses the first protection key to encrypt the first sub-tunnel negotiation information of the initiator 10 to obtain fifth encrypted information, and uses the first verification key to perform non-repudiation calculation on the fifth encrypted information to obtain first non-repudiation information;

[0133] The first protection key and the first verification key are obtained by performing key derivation based on the obtained random key.

[0134] Understandable, such as Figure 3 As shown, IKE (Internet Key Exchange) usually includes two phases: the first phase completes key negotiation, and the second phase performs identity confirmation and ESP / AH (Encapsulating Security Payload / Authentication Header) phase key negotiation. The second phase can be protected by the key obtained in the first phase. In this application, the process of exchanging random keys between the initiator 10 and the responder 20 is the first phase mentioned above, and the random key generated in this phase can be used to verify the identity information later.

[0135] Specifically, the initiator 10 can first adopt a preset key derivation algorithm, use the various random keys obtained in the above-mentioned key negotiation phase to derive keys, obtain a first protection key and a first verification key, and then use the first protection key to encrypt the first sub-tunnel negotiation information to obtain the fifth encrypted information, and use the first verification key to perform anti-repudiation calculation on the fifth encrypted information. For example, the first anti-repudiation information can be obtained through an HMAC (Hash-based Message Authentication Code) algorithm.

[0136] The first sub-tunnel negotiation information may include at least one of the following types of information: an identifier of the initiator 10, an identifier of the responder 20, a generated random number, a tunnel selector of the initiator 10, and a tunnel selector of the responder 20. In addition, the first sub-tunnel negotiation information may also include the key encapsulation obtained by the initiator 10 in the above-mentioned key negotiation phase, that is, the key encapsulation generated by the initiator 10 and the key encapsulation generated by the responder 20 received.

[0137] S202, the initiator 10 sends a first sub-tunnel negotiation message including fifth encryption information and first non-repudiation information to the responder 20.

[0138] S203, the responder 20 receives the first sub-tunnel negotiation message sent by the initiator 10; decrypts the encrypted first sub-tunnel negotiation information using the first protection key to obtain the first sub-tunnel negotiation information; and performs non-repudiation verification on the received first non-repudiation information based on the first verification key and the received fifth encrypted information;

[0139] Correspondingly, the responder 20 can adopt the same key derivation algorithm and use the obtained random keys to derive keys to obtain the same first protection key and first verification key, and then decrypt the encrypted first sub-tunnel negotiation information to obtain the first sub-tunnel negotiation information, and then perform non-repudiation verification on the received first non-repudiation information based on the first verification key and the received fifth encrypted information, so as to realize the identity authentication of the initiator 10 by the responder 20.

[0140] Specifically, the responder 20 can calculate the received fifth encrypted information through the HMAC algorithm to obtain the information to be verified, and then compare the obtained information to be verified with the first non-repudiation information. If the obtained information to be verified is the same as the first non-repudiation information, the authentication is successful; otherwise, the authentication fails.

[0141] S204, after the non-repudiation verification is passed, the responder 20 uses the first protection key to encrypt the second sub-tunnel negotiation information of the responder 20 to obtain sixth encrypted information, and uses the first verification key to perform non-repudiation calculation on the sixth encrypted information to obtain second non-repudiation information;

[0142] Similarly, the second sub-tunnel negotiation information may include at least one of the following types of information: the identifier of the initiator 10, the identifier of the responder 20, the generated random number, the tunnel selector of the initiator 10, and the tunnel selector of the responder 20. In addition, the second sub-tunnel negotiation information may also include the key encapsulation obtained by the responder 20 in the above-mentioned key negotiation stage, that is, the key encapsulation generated by the responder 20 and the received key encapsulation generated by the initiator 10. The sub-tunnel negotiation information includes the key encapsulation exchanged in the above-mentioned key exchange process, which can further ensure the accuracy of identity authentication.

[0143] S205, the responder 20 sends a second sub-tunnel negotiation message including the sixth encryption information and the second anti-repudiation information to the initiator 10;

[0144] S206, the initiator 10 receives the second sub-tunnel negotiation message sent by the responder 20; uses the first protection key to decrypt the received sixth encrypted information to obtain the second sub-tunnel negotiation information; based on the first verification key and the received sixth encrypted information, performs non-repudiation verification on the received second non-repudiation information to complete identity confirmation.

[0145] After both parties confirm their identities, the responder 20 and the initiator 10 can derive a key based on the first sub-tunnel negotiation information and the second sub-tunnel negotiation information to obtain a key for use in the Encapsulating Security Payload / Authentication Header stage, so as to ensure the communication security in the Encapsulating Security Payload / Authentication Header stage.

[0146] In this embodiment, the key cracking by quantum computing can be resisted. Furthermore, since the exchanged random key has a certain quantum resistance, the exchanged random key is used to derive the key to obtain the first protection key and the first verification key, which can also have a certain quantum resistance, thereby ensuring the communication security in the identity confirmation stage.

[0147] In one embodiment of the present application, Figure 4 As shown, before the responder 20 sends the first key negotiation message to the initiator 10, the interaction process between the initiator 10 and the responder 20 may further include the following steps:

[0148] S401, the initiator 10 sends a key negotiation request to the responder 20;

[0149] S402, when the responder 20 receives the key negotiation request sent by the initiator 10, it sends a question message to the initiator 10;

[0150] The question message is used to instruct the initiator 10 to use a specified algorithm to calculate the source data sent by the responder 20 to generate reply data in a specified format;

[0151] It is understandable that DoS (Denial of Service) refers to preventing or denying legitimate users from accessing a network server. Attacks that cause DoS are called DoS attacks. The attacker can send a large number of abnormal request packets to the responder 20, with the aim of completely consuming the computing resources and network resources of the responder 20, causing the responder 20 to cause network congestion, exhaustion of system resources, or deadlock or paralysis of system applications, thereby preventing the responder 20 from responding to normal user service requests in a timely manner. In this embodiment, since performing quantum-resistant cryptographic calculations consumes a large amount of computing resources, if the initiator 10 sends a large number of negotiation requests, the responder 20 needs to perform a large number of quantum-resistant cryptographic calculations, which can easily lead to exhaustion of the responder 20's resources, i.e., it is easy to be attacked by DoS.

[0152] Therefore, in order to resist DoS attacks, the responder 20 in the embodiment of the present application may send a question message to the initiator 10 when receiving the key negotiation request sent by the initiator 10. The question message may include a question payload, which is used to instruct the initiator 10 to use a specified algorithm to calculate the source data sent by the responder 20 to generate reply data in a specified format. The question payload may include at least the following contents:

[0153] 1. Source data used for calculation; 2. Response data that the initiator 10 needs to provide in accordance with certain regulations (i.e., response data in a specified format); 3. What algorithm the other party needs to adopt (i.e., the specified algorithm).

[0154] In order to reduce the burden on the responder 20, the specified algorithm can be an algorithm other than an asymmetric encryption algorithm, such as an HMAC algorithm, a symmetric encryption algorithm, or other algorithms with a small verification calculation amount. The current HMAC algorithm or symmetric encryption algorithm only needs to double the key length to have a certain quantum resistance, and the HMAC algorithm or symmetric encryption algorithm will not significantly increase the amount of data transmitted, which can save bandwidth and has a low verification cost.

[0155] In this way, after receiving the question message, the initiator 10 needs to calculate the source data according to the instruction of the question message and the specified algorithm to generate the reply data, and make the reply data conform to the specified format.

[0156] S403, the initiator 10 receives the question message sent by the responder 20; uses a specified algorithm to calculate the source data and generates reply data that conforms to the specified format;

[0157] S404, the initiator 10 sends a reply message containing reply data to the responder 20;

[0158] S405, the responder 20 receives the reply message sent by the initiator 10; and verifies whether the received reply data is correct based on the specified algorithm and source data.

[0159] If the specified algorithm is an algorithm that requires the initiator 10 to generate a key for calculation, such as a symmetric encryption algorithm, an HMAC algorithm, etc., the reply message may also include the key used by the initiator 10 when calculating the source data. In this case, the specified format may indicate that the data of the specified byte of the reply data is the specified data, for example, the tenth byte of the reply data may be specified as 0x11. In this way, the initiator 10 needs to continuously generate random keys, use the generated random keys and the symmetric encryption algorithm to calculate the source data, and obtain the data to be used, until the data of the specified byte of the data to be used is the specified data, and then use the data to be used as the reply data, and send the random key and reply data used when the specified format is met to the responder 20.

[0160] In this case, the responder 20 can calculate the source data according to the received random key and the same symmetric encryption algorithm to obtain the verification data, and then determine whether the verification data is consistent with the received reply data, and determine whether the data of the specified bytes of the verification data is consistent with the specified data. If they are consistent, it indicates that the reply data is correct and the verification has passed, and the subsequent key negotiation process can be continued; otherwise, if the verification fails, the reply message can be discarded, ending the communication process with the initiator 10, that is, terminating the current SPI session with the initiator 10.

[0161] If the specified algorithm is an algorithm that does not require a key for calculation, the reply message does not need to contain the key used by the initiator 10 to calculate the source data. For example, the specified algorithm can be a key derivation algorithm. In this case, the specified format can represent: a specified data length, that is, the question message in this case is used to instruct the initiator 10 to use the key derivation algorithm to derive a key from the source data and generate reply data of a specified length. After receiving the reply message, the responder 20 can derive a key from the source data based on the same key derivation algorithm, generate data of a specified length as verification data, and then determine whether the verification data is consistent with the received reply data. If they are consistent, the verification passes; otherwise, the verification fails.

[0162] After receiving the question message, the initiator 10 may include an identification of supporting answer in the answer message to indicate that it supports the question-answer mode provided in this embodiment, and the identification may be pre-configured in the initiator 10. If the identification does not exist in the answer message received by the responder 20, it indicates that the initiator 10 does not support question-answer, the initiator 10 is an untrustworthy object, and the responder 20 may directly terminate the communication process with the initiator 10; if the identification exists in the answer message, it indicates that the initiator 10 supports question-answer, the initiator 10 may reply with the answer data, and thus the responder 20 may perform the subsequent verification process and the subsequent message interaction process.

[0163] The initiator 10 can perform real calculations to reply with correct reply data. However, if the initiator 10 is an attacker, it may reply with false reply data. Regardless of whether the reply data is correct or not, the responder 20 will verify the reply data. If the reply data is wrong, the communication process with the initiator 10 will be terminated. If the attacker wants to continue to consume server resources, he must repeatedly execute the process from the beginning. It can be seen that if the attacker wants to consume server resources, he must also pay a lot of resources to paralyze the responder 20. Therefore, this embodiment can increase the difficulty of DoS attacks in the key negotiation phase and achieve the purpose of preventing DoS attacks.

[0164] In this case, the responder 20 may send the first key negotiation message to the initiator 10 if the received reply data is verified to be correct.

[0165] In this embodiment, the key cracking by quantum computing can be resisted. Furthermore, the responder sends a question message to the initiator to instruct the initiator to use a specified algorithm to calculate the source data sent by the responder to generate reply data that conforms to the specified format; then the reply data sent by the initiator 10 is verified to be correct based on the specified algorithm and the source data, and the subsequent key negotiation process is performed if the verification is correct, thereby preventing DoS attacks.

[0166] In one embodiment of the present application, the responder 20 is provided with a first cryptographic algorithm hardware; each encryption process, each decryption process, each signature process, and / or each signature verification process of the responder 20 is implemented by the first cryptographic algorithm hardware calculation. Correspondingly, the initiator 10 may also be provided with a second cryptographic algorithm hardware; so that each encryption process, each decryption process, each signature process, and / or each signature verification process of the initiator 10 is implemented by the second cryptographic algorithm hardware calculation. Among them, the cryptographic algorithm hardware can be a PCIE (Peripheral Component Interconnect Express, a high-speed serial computer expansion bus standard) cryptographic card, a USB (Universal Serial Bus, Universal Serial Bus) cryptographic device, a cryptographic processor in a CPU (Central Processing Unit, Central Processing Unit) or a hardware cryptographic acceleration engine, etc. The cryptographic algorithm hardware can also be provided in the initiator 10.

[0167] like Figure 5 As shown, the security protocol negotiation (including key negotiation) process with the peer can be performed by the key negotiation software. In this embodiment, if the key negotiation software runs on the responder 20, the peer is the initiator 10, and if the key negotiation software runs on the initiator 10, the peer is the responder 20.

[0168] When the key negotiation software needs to perform cryptographic algorithms (including encryption, decryption, signing, and verification), the key negotiation software can call the cryptographic algorithm hardware to perform cryptographic calculations through the Provider tool in OpenSSL (Open Secure Sockets Layer Protocol) or Libcrypt (cryptographic library). That is, the key negotiation software sends the data that needs to be cryptographically calculated to the cryptographic algorithm hardware, and then receives the results of the cryptographic algorithm hardware calculations. The cryptographic algorithm hardware can be configured with commonly used asymmetric algorithms, symmetric algorithms, hash algorithms, etc., which are used to replace the calculations of the key negotiation software.

[0169] Since this embodiment involves a large number of asymmetric encryption algorithms, which have a certain algorithm complexity and a long key length, a large amount of CPU resources will be occupied when executing asymmetric encryption algorithm calculations. Therefore, by offloading the cryptographic calculation process to the cryptographic algorithm hardware, the CPU computing load can be reduced, thereby increasing the number of key negotiation connections processed simultaneously by the responder 20, as well as improving the overall processing rate and reducing communication delays.

[0170] In this embodiment, it is possible to resist the cracking of the key by quantum computing. Furthermore, the responder is provided with a first cryptographic algorithm hardware; each encryption process, each decryption process, each signature process, and / or each signature verification process of the responder is realized by the first cryptographic algorithm hardware calculation, which can reduce the computing load of the responder and improve the processing rate of the responder's key negotiation. Of course, when a similar solution is applied to the initiator, it can also achieve the same technical effect.

[0171] To facilitate understanding, the embodiments of the present application are exemplarily introduced below with reference to the accompanying drawings.

[0172] like Figure 6 As shown, first, in the initial stage, the initiator 10 sends a key negotiation request message to the responder 20, which may carry a message header HDR (IKE_INIT), indicating that the message is a key negotiation request, security association information (including an indefinite number of Proposals), a random number, and two anti-quantum identifiers (IKEv2_FRAG_SUPPORT and INTERMEDIATE_EXCHANGE_SUPPORT), indicating that the initiator 10 supports the quantum-resistant IKE protocol. The responder 20 can reply to the initiator 10 with a message (i.e., a question message), which also carries two anti-quantum identifiers to indicate that the responder 20 also supports the quantum-resistant IKE protocol, and the message also carries a question payload, which is used to instruct the initiator 10 to use a specified algorithm to calculate the source data sent by the responder 20 to generate reply data in a specified format. After that, the initiator 10 sends a reply message to the responder 20, which carries an identifier indicating support for the reply, as well as reply data.

[0173] After the responder 20 verifies that the reply data has passed, it enters the quantum-resistant key exchange phase. The responder 20 can send a first key negotiation message to the initiator 10, which carries a quantum-resistant key exchange header (IKE_INTERMEDIATE), security association information (including the selected Proposal suggestion), a national secret SM2 encryption certificate (including the public key in the encryption certificate) and a national secret SM2 signature certificate (including the public key in the signature certificate), as well as a random number.

[0174] After receiving the first key negotiation message, the initiator 10 can generate a random key (i.e., a first random key), as well as a first quantum-resistant encryption public key, a first quantum-resistant encryption private key, a first quantum-resistant signature public key, and a first quantum-resistant signature private key; then use the public key in the encryption certificate of the responder 20 to asymmetrically encrypt the first random key to obtain the first encrypted information, and use the first random key to symmetrically encrypt the first quantum-resistant encryption public key and the first quantum-resistant signature public key to obtain the second encrypted information. In addition, the initiator 10 uses the private key corresponding to its own signature certificate to asymmetrically sign the first encrypted information and the second encrypted information to obtain the first signature information, and uses the first quantum-resistant signature private key to sign the first signature information to obtain the second signature information. Finally, a second key negotiation message is sent to the responder 20, which carries the first encrypted information, the second encrypted information, the encryption certificate and signature certificate of the initiator 10, the first signature information, and the second signature information.

[0175] After receiving the second key negotiation message, the responder 20 can use the private key corresponding to its own encryption certificate to decrypt the first encrypted information to obtain the first random key, and then use the first random key to decrypt the second encrypted information to obtain the first quantum-resistant encryption public key and the first quantum-resistant signature public key, and use the public key in the signature certificate of the initiator 10 and the first quantum-resistant signature public key to perform signature verification on the first signature information and the second signature information; after the verification is passed, the first quantum-resistant encryption public key is used to generate the first key encapsulation based on the key encapsulation mechanism, and the first key encapsulation is the encapsulation of the second random key. After that, the responder 20 can generate a third random key, a second quantum-resistant encryption public key, a second quantum-resistant encryption private key, a second quantum-resistant signature public key, and a second quantum-resistant signature private key, and then use the third random key to encrypt the first key encapsulation, the second quantum-resistant encryption public key, and the second quantum-resistant signature public key to obtain the third encrypted information; and use the public key in the encryption certificate of the responder 20 to asymmetrically encrypt the first random key to obtain the fourth encrypted information.

[0176] The responder 20 can also use the private key corresponding to its own signature certificate to asymmetrically sign the third encrypted information and the fourth encrypted information to obtain the third signature information, and use the second quantum-resistant signature private key to sign the third signature information to obtain the fourth signature information. Finally, a third key negotiation message is sent to the initiator 10, which carries the third encrypted information, the fourth encrypted information, the third signature information, and the fourth signature information.

[0177] After receiving the third key negotiation message, the initiator 10 can verify the third signature information and the fourth signature information, and decrypt the third encrypted information and the fourth encrypted information to obtain the second quantum-resistant encryption public key, the second quantum-resistant encryption private key, and the first key encapsulation, and then use the first quantum-resistant encryption private key to decapsulate the first key encapsulation to obtain the second random key.

[0178] Afterwards, the initiator 10 and the responder 20 can also perform multiple rounds of quantum-resistant key exchange phases. In each round of key exchange phases, the initiator 10 can use the second quantum-resistant encryption public key generated by the responder 20 to generate a new key package (i.e., the second key package), and use its own first quantum-resistant signature private key to sign the currently generated key package, thereby sending a fourth key negotiation message to the responder 20, carrying the current second key package and the corresponding signature. Correspondingly, the responder 20 can use the received first quantum-resistant signature public key to perform signature verification, and use its own second quantum-resistant encryption private key to decapsulate the currently received second key package to obtain the current fourth random key. Afterwards, the responder 20 can also continue to use the first quantum-resistant encryption public key to generate a new key package (i.e., the third key package), and use its own second quantum-resistant signature private key to sign the currently generated key package, thereby sending a fifth key negotiation message to the initiator 10, carrying the current third key package and the corresponding signature. The initiator 10 can use the received second quantum-resistant signature public key to perform signature verification, and use the first quantum-resistant encryption private key to decapsulate the received third key encapsulation to obtain the current fifth random key.

[0179] After the key negotiation phase is over, the initiator 10 and the responder 20 may enter the sub-tunnel negotiation phase. In this phase, the initiator 10 and the responder 20 may perform key derivation based on the random key obtained in the key negotiation phase to obtain the first protection key and the first verification key in the sub-tunnel negotiation phase. The initiator 10 may send a first sub-tunnel negotiation message to the responder 20, carrying the first sub-tunnel negotiation information (i.e., the fifth encrypted information) encrypted with the first protection key and the first anti-repudiation information, wherein the first sub-tunnel negotiation information may include a sub-tunnel creation negotiation header HDR (IKE_CREATE_CHILD_SA), security association information (including an indefinite number of Proposal suggestions), a random number, tunnel selectors of both the initiator 10 and the responder 20, identifiers (IDs) of both the initiator 10 and the responder 20, and may also include the key encapsulation obtained in the key negotiation phase. The first anti-repudiation information may be obtained by performing anti-repudiation calculation on the first sub-tunnel negotiation information using the HMAC algorithm. After receiving the first sub-tunnel negotiation message, the responder 20 may use the first verification key to verify the fifth encrypted information. At the same time, the responder 20 can also generate the sixth encrypted information and the second non-repudiation information according to the same steps, and send a second sub-tunnel negotiation message to the initiator 10, carrying the sixth encrypted information and the second non-repudiation information, so that the initiator 10 uses the first protection key to verify the second non-repudiation information, thereby completing the identity confirmation of both parties.

[0180] The present application embodiment also provides an IPSec hybrid anti-quantum computing security method applied to the responder, such as Figure 7 As shown, the method may include the following steps:

[0181] S701, when receiving a key negotiation request sent by an initiator, sending a first key negotiation message to the initiator;

[0182] The first key negotiation message includes the encryption certificate of the responder;

[0183] S702, receiving a second key negotiation message sent by the initiator; wherein the second key negotiation message includes: first encrypted information obtained by encrypting the first random key using the public key in the encryption certificate of the responder, the encryption certificate of the initiator, and second encrypted information; the second encrypted information is obtained by encrypting the first quantum-resistant encryption public key generated by the initiator based on the quantum-resistant cryptographic algorithm using the first random key;

[0184] S703, decrypting the received first encrypted information using the private key corresponding to the encryption certificate of the responder to obtain a first random key;

[0185] S704, decrypting the received second encrypted information using the first random key to obtain a first quantum-resistant encryption public key;

[0186] S705, encapsulating the second random key using the first quantum-resistant encryption public key to obtain a first key encapsulation;

[0187] S706, encrypt the first key encapsulation using the third random key to obtain third encrypted information; and encrypt the third random key using the public key in the encryption certificate of the initiator to obtain fourth encrypted information;

[0188] S707, sending a third key agreement message including the third encrypted information and the fourth encrypted information to the initiator, so that the initiator decrypts the received fourth encrypted information based on the private key corresponding to the encryption certificate of the initiator to obtain the third random key, decrypts the received third encrypted information using the third random key to obtain the first key encapsulation, and decapsulates the decrypted first key encapsulation based on the first quantum resistant encryption private key corresponding to the first quantum resistant encryption public key to obtain the second random key.

[0189] The specific execution process of this embodiment can refer to the above-mentioned IPSec hybrid anti-quantum computing security system embodiment, which will not be repeated here.

[0190] Optionally, the second encrypted information is obtained by encrypting a first quantum-resistant encryption public key generated by the initiator based on a quantum-resistant cryptographic algorithm and a first quantum-resistant signature public key using the first random key;

[0191] The second key agreement message further includes: a signature certificate of the initiator, first signature information, and second signature information; wherein the first signature information is obtained by first re-signing the first encrypted information and the second encrypted information using one of the private key corresponding to the signature certificate of the initiator and the first quantum-resistant signature private key corresponding to the first quantum-resistant signature public key; the second signature information is obtained by second re-signing the first signature information using the private key corresponding to the signature certificate of the initiator and the other of the first quantum-resistant signature private key;

[0192] Decrypting the received second encrypted information using the first random key to obtain a first quantum-resistant encryption public key, including:

[0193] Decrypting the received second encrypted information using the first random key to obtain a first quantum-resistant encryption public key and a first quantum-resistant signature public key;

[0194] Before encapsulating the second random key with the first quantum-resistant encryption public key to obtain the first key encapsulation, the method further includes:

[0195] Performing signature verification on the received first signature information using the public key corresponding to the private key used for the first re-signature, and performing signature verification on the received second signature information using the public key corresponding to the private key used for the second re-signature;

[0196] Encapsulating the second random key using the first quantum-resistant encryption public key to obtain a first key encapsulation, including:

[0197] When the signature verification passes, the second random key is encapsulated using the first quantum-resistant encryption public key to obtain the first key encapsulation.

[0198] Optionally, encrypting the first key encapsulation by using a third random key to obtain third encrypted information includes:

[0199] Encrypting the second quantum-resistant encryption public key and the first key package generated by the responder using the third random key to obtain third encrypted information, so that the initiator can encapsulate the current fourth random key based on the second quantum-resistant encryption public key to obtain the second key package;

[0200] After sending the third key agreement message including the third encryption information and the fourth encryption information to the initiator, the method further includes:

[0201] Receive a fourth key negotiation message currently sent by the initiator; wherein the fourth key negotiation message includes: a second key encapsulation obtained by encapsulating the current fourth random key using the second quantum-resistant encryption public key;

[0202] Decapsulate the currently received second key encapsulation using the second quantum resistant encryption private key corresponding to the second quantum resistant encryption public key to obtain a current fourth random key;

[0203] Encapsulating the current fifth random key using the first quantum-resistant encryption public key to obtain a current third key encapsulation;

[0204] A fifth key agreement message including the current third key encapsulation is sent to the initiator, so that the initiator decapsulates the received third key encapsulation based on the first quantum-resistant encryption private key to obtain the current fifth random key.

[0205] Optionally, after sending the fifth key agreement message containing the current third key encapsulation to the initiator, the method further includes:

[0206] Return to the step of receiving the fourth key agreement message currently sent by the initiator until the number of the sent third key encapsulations reaches a preset number.

[0207] Optionally, after sending the third key agreement message including the third encryption information and the fourth encryption information to the initiator, the method further includes:

[0208] Receive a first sub-tunnel negotiation message sent by the initiator; wherein the first sub-tunnel negotiation message includes: fifth encrypted information obtained by encrypting the first sub-tunnel negotiation information of the initiator using the first protection key, and first non-repudiation information obtained by performing non-repudiation calculation on the fifth encrypted information using the first verification key; the first protection key and the first verification key are obtained by performing key derivation based on the obtained random key;

[0209] Decrypting the encrypted first sub-tunnel negotiation information using the first protection key to obtain the first sub-tunnel negotiation information; and performing non-repudiation verification on the received first non-repudiation information based on the first verification key and the received fifth encrypted information;

[0210] After the non-repudiation verification is passed, the second sub-tunnel negotiation information of the responder is encrypted using the first protection key to obtain sixth encrypted information, and the sixth encrypted information is non-repudiation calculated using the first verification key to obtain second non-repudiation information;

[0211] A second sub-tunnel negotiation message including the sixth encrypted information and the second non-repudiation information is sent to the initiator, so that the initiator uses the first protection key to decrypt the received sixth encrypted information to obtain the second sub-tunnel negotiation information, and performs non-repudiation verification on the received second non-repudiation information based on the first verification key and the received sixth encrypted information to complete identity confirmation.

[0212] Optionally, the first sub-tunnel negotiation information includes at least one of the following types of information: an identifier of the initiator, an identifier of the responder, a generated random number, a tunnel selector of the initiator, a tunnel selector of the responder, and an obtained key encapsulation;

[0213] The second sub-tunnel negotiation information includes at least one of the following types of information: an identifier of the initiator, an identifier of the responder, a generated random number, a tunnel selector of the initiator, a tunnel selector of the responder, and an obtained key encapsulation.

[0214] Optionally, the method further comprises:

[0215] A key is derived based on the first sub-tunnel negotiation information and the second sub-tunnel negotiation information to obtain a key used in the encapsulating security payload / authentication header stage.

[0216] Optionally, before sending the first key negotiation message to the initiator, the method further includes:

[0217] When receiving the key negotiation request sent by the initiator, a question message is sent to the initiator; wherein the question message is used to instruct the initiator to use the specified algorithm to calculate the source data sent by the responder to generate reply data that conforms to the specified format;

[0218] Receiving a reply message sent by the initiator; wherein the reply message includes reply data generated by the initiator based on the question message;

[0219] Verify whether the received reply data is correct based on the specified algorithm and source data;

[0220] Sending a first key negotiation message to the initiator, including:

[0221] When the received reply data is verified to be correct, a first key negotiation message is sent to the initiator.

[0222] Optionally, the specified algorithm is an algorithm other than asymmetric encryption.

[0223] Optionally, the responder is provided with a first cryptographic algorithm hardware; each encryption process, each decryption process, each signing process, and / or each signature verification process of the responder is implemented by calculation through the first cryptographic algorithm hardware.

[0224] The present application embodiment also provides an IPSec hybrid anti-quantum computing security method applied to the initiator, such as Figure 8 As shown, the method may include the following steps:

[0225] S801, a key negotiation request is sent to a responder;

[0226] S802, receiving a first key negotiation message sent by a responder;

[0227] The first key negotiation message includes the encryption certificate of the responder;

[0228] S803, encrypting the first random key using the public key in the encryption certificate of the responder to obtain first encrypted information;

[0229] S804, generating a first quantum-resistant encryption public key based on a quantum-resistant cryptographic algorithm;

[0230] S805, encrypting the first quantum-resistant encryption public key using the first random key to obtain second encrypted information;

[0231] S806, sending a second key negotiation message including the first encryption information, the second encryption information, and the encryption certificate of the initiator to the responder;

[0232] S807, receiving a third key negotiation message sent by the responder; wherein the third key negotiation message includes: a first key encapsulation, third encryption information, and fourth encryption information; the first key encapsulation is obtained by encapsulating the second random key with the first quantum-resistant encryption public key; the third encryption information is obtained by encrypting the first key encapsulation with the third random key; the fourth encryption information is obtained by encrypting the third random key with the public key in the encryption certificate of the initiator;

[0233] S808, decrypting the received fourth encrypted information based on the private key corresponding to the encryption certificate of the initiator to obtain a third random key;

[0234] S809, decrypt the received third encrypted information using the third random key to obtain the first key encapsulation;

[0235] S810, based on the first quantum-resistant encryption private key, decapsulate the first key encapsulation obtained by decryption to obtain a second random key.

[0236] The specific execution process of this embodiment can refer to the above-mentioned IPSec hybrid anti-quantum computing security system embodiment, which will not be repeated here.

[0237] Optionally, encrypting the first quantum-resistant encryption public key with the first random key to obtain second encrypted information includes:

[0238] Using the first random key, encrypt the first quantum-resistant encryption public key and the first quantum-resistant signature public key generated by the initiator based on the quantum-resistant cryptographic algorithm to obtain second encrypted information;

[0239] Before sending the second key agreement message including the first encryption information, the second encryption information, and the encryption certificate of the initiator to the responder, the method further includes:

[0240] Using one of the private key corresponding to the signature certificate of the initiator and the first quantum-resistant signature private key corresponding to the first quantum-resistant signature public key, the first encrypted information and the second encrypted information are first re-signed to obtain first signature information, and using the other of the private key corresponding to the signature certificate of the initiator and the first quantum-resistant signature private key, the first signature information is second re-signed to obtain second signature information;

[0241] Sending a second key negotiation message including the first encryption information, the second encryption information, and the encryption certificate of the initiator to the responder includes:

[0242] A second key negotiation message including the first encrypted information, the second encrypted information, the encryption certificate of the initiator, the signature certificate of the initiator, the first signature information, and the second signature information is sent to the responder.

[0243] Optionally, the third encrypted information is obtained by encrypting the second quantum-resistant encryption public key generated by the responder and the first key encapsulation using the second random key;

[0244] After decapsulating the first key encapsulation obtained by decryption based on the first quantum-resistant encryption private key corresponding to the first quantum-resistant encryption public key to obtain the second random key, the method further includes:

[0245] Encapsulating the current fourth random key using the second quantum-resistant encryption public key to obtain a current second key encapsulation;

[0246] Sending a fourth key negotiation message including the current second key encapsulation to the responder, so that the responder decapsulates the received second key encapsulation using the second quantum resistant encryption private key corresponding to the second quantum resistant encryption public key to obtain the current fourth random key;

[0247] Receive a fifth key negotiation message currently sent by the responder; wherein the fifth key negotiation message includes a third key encapsulation obtained by encapsulating the current fifth random key using the first quantum-resistant encryption public key;

[0248] Based on the first quantum-resistant encryption private key, the received third key encapsulation is decapsulated to obtain a current fifth random key.

[0249] Optionally, after decapsulating the received third key encapsulation based on the first quantum-resistant encryption private key to obtain the current fifth random key, the method further includes:

[0250] Return to the step of encapsulating the current fourth random key with the second quantum-resistant encryption public key to obtain the current second key encapsulation, until the number of sent second key encapsulations reaches a preset number.

[0251] Optionally, the third key agreement message further includes: third signature information and fourth signature information; the third encrypted information is obtained by encrypting the second quantum-resistant encryption public key generated by the responder, the second quantum-resistant signature public key generated by the responder, and the first key encapsulation using the third random key; wherein the third signature information is obtained by first re-signing the third encrypted information and the fourth encrypted information using one of the private key corresponding to the signature certificate of the responder and the second quantum-resistant signature private key generated by the responder, and the fourth signature information is obtained by second re-signing the third signature information using the other of the private key corresponding to the signature certificate of the responder and the second quantum-resistant signature private key generated by the responder;

[0252] After decrypting the received third encrypted information using the third random key to obtain the first key encapsulation, the method further includes:

[0253] The received third signature information is signature-verified using the public key corresponding to the private key used for the first signature, and the received fourth signature information is signature-verified using the public key corresponding to the private key used for the second signature.

[0254] Optionally, after decapsulating the decrypted first key encapsulation to obtain the second random key based on the first quantum resistant encryption private key corresponding to the first quantum resistant encryption public key, the method further includes:

[0255] The first sub-tunnel negotiation information of the initiator is encrypted using the first protection key to obtain fifth encrypted information, and the fifth encrypted information is non-repudiated using the first verification key to obtain first non-repudiation information; wherein the first protection key and the first verification key are obtained by performing key derivation based on the obtained random key;

[0256] Sending a first sub-tunnel negotiation message including the fifth encrypted information and the first non-repudiation information to the responder, so that the responder decrypts the encrypted first sub-tunnel negotiation information using the first protection key to obtain the first sub-tunnel negotiation information; and performing non-repudiation verification on the received first non-repudiation information based on the first verification key and the received fifth encrypted information;

[0257] Receive a second sub-tunnel negotiation message sent by the responder; wherein the second sub-tunnel negotiation message includes sixth encrypted information and second non-repudiation information; the sixth encrypted information is obtained by encrypting the second sub-tunnel negotiation information of the responder using the first protection key; the second non-repudiation information is obtained by performing non-repudiation calculation on the sixth encrypted information using the first verification key;

[0258] Decrypting the received sixth encrypted information using the first protection key to obtain second sub-tunnel negotiation information;

[0259] The received second non-repudiation information is subjected to non-repudiation verification based on the first verification key and the received sixth encrypted information to complete identity confirmation.

[0260] Optionally, the first sub-tunnel negotiation information includes at least one of the following types of information: an identifier of the initiator, an identifier of the responder, a generated random number, a tunnel selector of the initiator, a tunnel selector of the responder, and an obtained key encapsulation;

[0261] The second sub-tunnel negotiation information includes at least one of the following types of information: an identifier of the initiator, an identifier of the responder, a generated random number, a tunnel selector of the initiator, a tunnel selector of the responder, and an obtained key encapsulation.

[0262] Optionally, the method further comprises:

[0263] A key is derived based on the first sub-tunnel negotiation information and the second sub-tunnel negotiation information to obtain a key used in the encapsulating security payload / authentication header stage.

[0264] Optionally, after sending the key negotiation request to the responder and before receiving the first key negotiation message sent by the responder, the method further includes:

[0265] Receive a question message sent by the initiator; wherein the question message is used to instruct the initiator to use a specified algorithm to calculate the source data sent by the responder to generate reply data that complies with the specified format;

[0266] Use the specified algorithm to calculate the source data and generate the response data in the specified format;

[0267] A reply message containing reply data is sent to the responder so that the received reply data is verified to be correct based on the specified algorithm and source data, and if the verification is correct, a first key negotiation message is sent to the initiator.

[0268] Optionally, the initiator is provided with second cryptographic algorithm hardware; each encryption process, each decryption process, each signing process, and / or each signature verification process of the initiator is implemented by calculation through the second cryptographic algorithm hardware.

[0269] In this embodiment, since the key generated by the quantum-resistant cryptographic algorithm has a certain degree of quantum resistance, the second random key sent by the responding direction to the initiator is encapsulated by the first quantum-resistant encryption public key generated based on the quantum-resistant cryptographic algorithm, so that the second random key is also quantum-resistant; and the first quantum-resistant encryption public key is also encrypted by the first random key during the sending process, and the first random key is also encrypted using the public key in the encryption certificate. It can be seen that this scheme protects the key based on the quantum-resistant cryptographic algorithm and multiple encryptions, so that the negotiated random key in the communication process has strong quantum resistance, that is, it can effectively resist the cracking of quantum computing.

[0270] The present application also provides an IPSec hybrid anti-quantum computing security device, which is applied to a responder, such as Fig. 9 As shown, the device comprises:

[0271] A first key negotiation message sending module 901 is configured to send a first key negotiation message to the initiator upon receiving a key negotiation request sent by the initiator; wherein the first key negotiation message includes an encryption certificate of the responder;

[0272] The second key negotiation message receiving module 902 is used to receive the second key negotiation message sent by the initiator; wherein the second key negotiation message includes: first encryption information obtained by encrypting the first random key using the public key in the encryption certificate of the responder, the encryption certificate of the initiator, and second encryption information; the second encryption information is obtained by encrypting the first quantum-resistant encryption public key generated by the initiator based on the quantum-resistant cryptographic algorithm using the first random key;

[0273] A first encrypted information decryption module 903, configured to decrypt the received first encrypted information using the private key corresponding to the encryption certificate of the responder to obtain the first random key;

[0274] A second encrypted information decryption module 904 is used to decrypt the received second encrypted information using the first random key to obtain the first quantum-resistant encryption public key;

[0275] A first key encapsulation generation module 905 is used to encapsulate the second random key using the first quantum-resistant encryption public key to obtain a first key encapsulation;

[0276] A third encryption information generating module 906 is configured to encrypt the first key package using a third random key to obtain third encryption information; and to encrypt the third random key using a public key in the encryption certificate of the initiator to obtain fourth encryption information;

[0277] The third key agreement message sending module 907 is used to send a third key agreement message containing the third encrypted information and the fourth encrypted information to the initiator, so that the initiator decrypts the received fourth encrypted information based on the private key corresponding to the encryption certificate of the initiator to obtain the third random key, decrypts the received third encrypted information using the third random key to obtain the first key encapsulation, and decapsulates the decrypted first key encapsulation based on the first quantum-resistant encryption private key corresponding to the first quantum-resistant encryption public key to obtain the second random key.

[0278] Optionally, the second encrypted information is obtained by encrypting a first quantum-resistant encryption public key and a first quantum-resistant signature public key generated by the initiator based on a quantum-resistant cryptographic algorithm using the first random key;

[0279] The second key agreement message further includes: the signature certificate of the initiator, the first signature information, and the second signature information; wherein the first signature information is obtained by first re-signing the first encrypted information and the second encrypted information using one of the private key corresponding to the signature certificate of the initiator and the first quantum-resistant signature private key corresponding to the first quantum-resistant signature public key; the second signature information is obtained by second re-signing the first signature information using the other of the private key corresponding to the signature certificate of the initiator and the first quantum-resistant signature private key;

[0280] The second encrypted information decryption module 904 is specifically configured to: use the first random key to decrypt the received second encrypted information to obtain the first quantum-resistant encryption public key and the first quantum-resistant signature public key;

[0281] The device also includes: a first signature verification module, which is used to encapsulate the second random key using the first quantum-resistant encryption public key in the first key encapsulation generation module 905, and before obtaining the first key encapsulation, perform signature verification on the received first signature information using the public key corresponding to the private key used for the first re-signature, and perform signature verification on the received second signature information using the public key corresponding to the private key used for the second re-signature;

[0282] The first key encapsulation generation module 905 is specifically used to: when the signature verification passes, use the first anti-quantum encryption public key to encapsulate the second random key to obtain the first key encapsulation.

[0283] Optionally, the third encryption information generation module 906 is specifically used to: use a third random key to encrypt the second quantum-resistant encryption public key generated by the responder and the first key encapsulation to obtain third encryption information, so that the initiator encapsulates the current fourth random key based on the second quantum-resistant encryption public key to obtain a second key encapsulation;

[0284] The device further includes: a fourth key negotiation message receiving module, configured to receive a fourth key negotiation message currently sent by the initiator after the third key negotiation message sending module 907 sends the third key negotiation message including the third encryption information and the fourth encryption information to the initiator; wherein the fourth key negotiation message includes: a second key encapsulation obtained by encapsulating the current fourth random key using the second quantum-resistant encryption public key;

[0285] a fourth random key decapsulation module, configured to decapsulate the currently received second key encapsulation by using the second quantum-resistant encryption private key corresponding to the second quantum-resistant encryption public key to obtain a current fourth random key;

[0286] A third key encapsulation generation module, used to encapsulate the current fifth random key using the first quantum-resistant encryption public key to obtain a current third key encapsulation;

[0287] A fifth key agreement message sending module is used to send a fifth key agreement message containing the current third key encapsulation to the initiator, so that the initiator decapsulates the received third key encapsulation based on the first quantum-resistant encryption private key to obtain the current fifth random key.

[0288] Optionally, after the fifth key negotiation message sending module sends the fifth key negotiation message containing the current third key encapsulation to the initiator, it is also used to trigger the fourth key negotiation message receiving module to execute the step of receiving the fourth key negotiation message currently sent by the initiator, until the number of third key encapsulations sent reaches a preset number.

[0289] Optionally, the device further includes: a first sub-tunnel negotiation message receiving module, which is used to receive a first sub-tunnel negotiation message sent by the initiator after the fourth key negotiation message receiving module sends a third key negotiation message including the third encryption information and the fourth encryption information to the initiator; wherein the first sub-tunnel negotiation message includes: fifth encryption information obtained by encrypting the first sub-tunnel negotiation information of the initiator using the first protection key, and first non-repudiation information obtained by performing non-repudiation calculation on the fifth encryption information using the first verification key; the first protection key and the first verification key are obtained by performing key derivation based on the obtained random key;

[0290] A first non-repudiation verification module, configured to decrypt the encrypted first sub-tunnel negotiation information using the first protection key to obtain the first sub-tunnel negotiation information; and perform non-repudiation verification on the received first non-repudiation information based on the first verification key and the received fifth encrypted information;

[0291] A second sub-tunnel negotiation information encryption module, used to encrypt the second sub-tunnel negotiation information of the responder using the first protection key to obtain sixth encrypted information after the non-repudiation verification is passed, and perform non-repudiation calculation on the sixth encrypted information using the first verification key to obtain second non-repudiation information;

[0292] A second sub-tunnel negotiation message sending module is used to send a second sub-tunnel negotiation message including the sixth encrypted information and the second non-repudiation information to the initiator, so that the initiator uses the first protection key to decrypt the received sixth encrypted information to obtain the second sub-tunnel negotiation information, and performs non-repudiation verification on the received second non-repudiation information based on the first verification key and the received sixth encrypted information to complete identity confirmation.

[0293] Optionally, the first sub-tunnel negotiation information includes at least one of the following types of information: an identifier of the initiator, an identifier of the responder, a generated random number, a tunnel selector of the initiator, a tunnel selector of the responder, and an obtained key encapsulation;

[0294] The second sub-tunnel negotiation information includes at least one of the following types of information: the identifier of the initiator, the identifier of the responder, the generated random number, the tunnel selector of the initiator, the tunnel selector of the responder, and the obtained key encapsulation.

[0295] Optionally, the device further includes: a key derivation module, configured to perform key derivation based on the first sub-tunnel negotiation information and the second sub-tunnel negotiation information to obtain a key for use in an encapsulating security payload / authentication header stage.

[0296] Optionally, the device further includes: a question message sending module, configured to send a question message to the initiator when receiving a key negotiation request sent by the initiator before the first key negotiation message sending module 901 sends the first key negotiation message to the initiator; wherein the question message is used to instruct the initiator to use a specified algorithm to calculate the source data sent by the responder to generate reply data that conforms to a specified format;

[0297] A reply message receiving module, used to receive a reply message sent by the initiator; wherein the reply message includes reply data generated by the initiator based on the question message;

[0298] A reply verification module, used to verify whether the received reply data is correct based on the specified algorithm and the source data;

[0299] The first key negotiation message sending module 901 is specifically configured to send the first key negotiation message to the initiator when the received reply data is verified to be correct.

[0300] Optionally, the specified algorithm is an algorithm other than asymmetric encryption.

[0301] Optionally, the responder is provided with a first cryptographic algorithm hardware; each encryption process, each decryption process, each signing process, and / or each signature verification process of the responder is implemented by calculation through the first cryptographic algorithm hardware.

[0302] The present application also provides an IPSec hybrid anti-quantum computing security device, which is applied to the initiator, such as Fig.10 As shown, the device comprises:

[0303] A key negotiation request sending module 1001 is used to send a key negotiation request to a responder;

[0304] A first key negotiation message receiving module 1002 is configured to receive a first key negotiation message sent by the responder; wherein the first key negotiation message includes an encryption certificate of the responder;

[0305] A first encrypted information generating module 1003 is used to encrypt the first random key using the public key in the encryption certificate of the responder to obtain first encrypted information;

[0306] A first quantum-resistant encryption public key generation module 1004, configured to generate a first quantum-resistant encryption public key and a corresponding first quantum-resistant encryption private key based on a quantum-resistant cryptographic algorithm;

[0307] A second encrypted information generating module 1005 is used to encrypt the first quantum-resistant encryption public key using the first random key to obtain second encrypted information;

[0308] A second key negotiation message sending module 1006, configured to send a second key negotiation message including the first encryption information, the second encryption information, and the encryption certificate of the initiator to the responder;

[0309] The third key negotiation message receiving module 1007 is used to receive the third key negotiation message sent by the responder; wherein the third key negotiation message includes: a first key encapsulation, third encryption information, and fourth encryption information; the first key encapsulation is obtained by encapsulating the second random key with the first quantum-resistant encryption public key; the third encryption information is obtained by encrypting the first key encapsulation with the third random key; the fourth encryption information is obtained by encrypting the third random key with the public key in the encryption certificate of the initiator;

[0310] A fourth encrypted information decryption module 1008, configured to decrypt the received fourth encrypted information based on the private key corresponding to the encryption certificate of the initiator to obtain the third random key;

[0311] A third encrypted information decryption module 1009, configured to decrypt the received third encrypted information using the third random key to obtain a first key package;

[0312] The first key decapsulation module 1010 is used to decapsulate the decrypted first key based on the first quantum-resistant encryption private key to obtain the second random key.

[0313] Optionally, the second encrypted information generating module 1005 is specifically configured to: use the first random key to encrypt a first quantum-resistant encryption public key and a first quantum-resistant signature public key generated by the initiator based on a quantum-resistant cryptographic algorithm to obtain second encrypted information;

[0314] The device also includes: a first signature information generating module, which is used to use one of a private key corresponding to the signature certificate of the initiator and a first quantum-resistant signature private key corresponding to the first quantum-resistant signature public key to perform a first re-signature on the first encrypted information and the second encrypted information to obtain first signature information before the second key agreement message sending module 1006 sends the second key agreement message containing the first encrypted information, the second encrypted information, and the encryption certificate of the initiator to the responder, and use the other of the private key corresponding to the signature certificate of the initiator and the first quantum-resistant signature private key to perform a second re-signature on the first signature information to obtain second signature information;

[0315] The second key negotiation message sending module 1006 is specifically used to send a second key negotiation message including the first encryption information, the second encryption information, the encryption certificate of the initiator, the signature certificate of the initiator, the first signature information, and the second signature information to the responder.

[0316] Optionally, the third encrypted information is obtained by encrypting the second quantum-resistant encryption public key generated by the responder and the first key encapsulation using a second random key;

[0317] The device also includes: a second key encapsulation generation module, which is used to, after the first key decapsulation module 1010 decapsulates the first key encapsulation obtained by decryption based on the first quantum-resistant encryption private key corresponding to the first quantum-resistant encryption public key to obtain the second random key, encapsulates the current fourth random key using the second quantum-resistant encryption public key to obtain the current second key encapsulation;

[0318] a fourth key agreement message sending module, configured to send a fourth key agreement message containing the current second key encapsulation to the responder, so that the responder uses the second quantum resistant encryption private key corresponding to the second quantum resistant encryption public key to decapsulate the received second key encapsulation to obtain a current fourth random key;

[0319] a fifth key negotiation message receiving module, configured to receive a fifth key negotiation message currently sent by the responder; wherein the fifth key negotiation message includes a third key encapsulation obtained by encapsulating the current fifth random key using the first quantum-resistant encryption public key;

[0320] The fifth random key decapsulation module is used to decapsulate the received third key encapsulation based on the first quantum-resistant encryption private key to obtain a current fifth random key.

[0321] Optionally, the fifth random key decapsulation module is further used to, after decapsulating the received third key encapsulation based on the first quantum resistant encryption private key to obtain the current fifth random key, trigger the execution of the second key encapsulation generation module to execute the step of encapsulating the current fourth random key using the second quantum resistant encryption public key to obtain the current second key encapsulation, until the number of second key encapsulations sent reaches a preset number.

[0322] Optionally, the third key agreement message further includes: third signature information and fourth signature information; the third encrypted information is obtained by encrypting the second quantum-resistant encryption public key generated by the responder, the second quantum-resistant signature public key generated by the responder, and the first key encapsulation using a third random key; wherein the third signature information is obtained by first re-signing the third encrypted information and the fourth encrypted information using one of the private key corresponding to the signature certificate of the responder and the second quantum-resistant signature private key generated by the responder, and the fourth signature information is obtained by second re-signing the third signature information using the other of the private key corresponding to the signature certificate of the responder and the second quantum-resistant signature private key generated by the responder;

[0323] The device also includes: a third signature information verification module, which is used to use the third random key to decrypt the received third encrypted information in the third encrypted information decryption module 1009, and after obtaining the first key encapsulation, use the public key corresponding to the private key used for the first re-signature to perform signature verification on the received third signature information, and use the public key corresponding to the private key used for the second re-signature to perform signature verification on the received fourth signature information.

[0324] Optionally, the device further includes: a first sub-tunnel negotiation information encryption module, which is used to, after the first key decapsulation module 1010 decapsulates the first key encapsulation obtained by decryption based on the first quantum-resistant encryption private key corresponding to the first quantum-resistant encryption public key to obtain the second random key, use the first protection key to encrypt the first sub-tunnel negotiation information of the initiator to obtain fifth encrypted information, and use the first verification key to perform non-repudiation calculation on the fifth encrypted information to obtain first non-repudiation information; wherein the first protection key and the first verification key are obtained by: deriving keys based on the obtained random key;

[0325] A first sub-tunnel negotiation message sending module, configured to send a first sub-tunnel negotiation message including the fifth encrypted information and the first anti-repudiation information to the responder, so that the responder decrypts the encrypted first sub-tunnel negotiation information using the first protection key to obtain the first sub-tunnel negotiation information; and performs anti-repudiation verification on the received first anti-repudiation information based on the first verification key and the received fifth encrypted information;

[0326] A second sub-tunnel negotiation message receiving module is used to receive a second sub-tunnel negotiation message sent by the responder; wherein the second sub-tunnel negotiation message includes sixth encryption information and second anti-repudiation information; the sixth encryption information is obtained by encrypting the second sub-tunnel negotiation information of the responder using the first protection key; the second anti-repudiation information is obtained by performing anti-repudiation calculation on the sixth encryption information using the first verification key;

[0327] A second sub-tunnel negotiation information decryption module, used to decrypt the received sixth encrypted information using the first protection key to obtain second sub-tunnel negotiation information;

[0328] The second non-repudiation module is used to perform non-repudiation verification on the received second non-repudiation information based on the first verification key and the received sixth encrypted information to complete identity confirmation.

[0329] Optionally, the first sub-tunnel negotiation information includes at least one of the following types of information: the identifier of the initiator, the identifier of the responder, the generated random number, the tunnel selector of the initiator, the tunnel selector of the responder, and the obtained key encapsulation; the second sub-tunnel negotiation information includes at least one of the following types of information: the identifier of the initiator, the identifier of the responder, the generated random number, the tunnel selector of the initiator, the tunnel selector of the responder, and the obtained key encapsulation.

[0330] Optionally, the device further includes: a key derivation module, configured to perform key derivation based on the first sub-tunnel negotiation information and the second sub-tunnel negotiation information to obtain a key for use in an encapsulating security payload / authentication header stage.

[0331] Optionally, the device further includes: a question message receiving module, configured to receive a question message sent by the initiator after the key negotiation request sending module 1001 sends a key negotiation request to the responder and before the first key negotiation message receiving module 1002 receives the first key negotiation message sent by the responder; wherein the question message is used to instruct the initiator to use a specified algorithm to calculate the source data sent by the responder to generate reply data that conforms to a specified format;

[0332] A reply data generating module, used to calculate the source data using the specified algorithm to generate reply data conforming to the specified format;

[0333] A reply message sending module is used to send a reply message containing the reply data to the responder, so that the received reply data can be verified based on the specified algorithm and the source data to see if it is correct, and if the verification is correct, send a first key negotiation message to the initiator.

[0334] Optionally, the specified algorithm is an algorithm other than asymmetric encryption.

[0335] Optionally, the initiator is provided with second cryptographic algorithm hardware; each encryption process, each decryption process, each signing process, and / or each signature verification process of the initiator is implemented by calculation through the second cryptographic algorithm hardware.

[0336] The present application also provides an electronic device, such as Fig.11 As shown, including:

[0337] Memory 1101, used for storing computer programs;

[0338] The processor 1102 is used to implement any of the steps of the above-mentioned IPSec hybrid anti-quantum computing security method when executing the program stored in the memory 1101.

[0339] In addition, the electronic device may further include a communication bus and / or a communication interface, and the processor 1102, the communication interface, and the memory 1101 communicate with each other through the communication bus. The communication bus mentioned in the electronic device may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The communication bus may be divided into an address bus, a data bus, a control bus, and the like. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0340] The communication interface is used for communication between the above electronic device and other devices. The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory.

[0341] Optionally, the memory may also be at least one storage device located away from the aforementioned processor. The aforementioned processor may be a general-purpose processor, including a central processing unit, a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0342] In another embodiment provided in the present application, a computer-readable storage medium is also provided, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned IPSec hybrid anti-quantum computing security methods are implemented.

[0343] In another embodiment provided by the present application, a computer program product including instructions is also provided, which, when executed on a computer, enables the computer to execute any one of the IPSec hybrid anti-quantum computing security methods in the above embodiments.

[0344] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a solid-state hard disk (SSD), etc.

[0345] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0346] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the method, device, storage medium, electronic device, and program product embodiments, since they are basically similar to the system embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0347] The above description is only a preferred embodiment of the present application and is not intended to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application are included in the protection scope of the present application.

Claims

1. An IPSec hybrid anti-quantum computing security method, characterized in that: The method is applied to a responder, and the method comprises: When receiving a key negotiation request sent by the initiator, sending a first key negotiation message to the initiator; wherein the first key negotiation message includes the encryption certificate of the responder; Receive a second key negotiation message sent by the initiator; wherein the second key negotiation message includes: first encrypted information obtained by encrypting a first random key using a public key in the encryption certificate of the responder, the encryption certificate of the initiator, and second encrypted information; the second encrypted information is obtained by encrypting a first quantum-resistant encryption public key generated by the initiator based on a quantum-resistant cryptographic algorithm using the first random key; Decrypting the received first encrypted information using the private key corresponding to the encryption certificate of the responder to obtain the first random key; Decrypting the received second encrypted information using the first random key to obtain the first quantum-resistant encryption public key; Encapsulating the second random key using the first quantum-resistant encryption public key to obtain a first key encapsulation; Encrypting the first key package using a third random key to obtain third encrypted information; and encrypting the third random key using a public key in the encryption certificate of the initiator to obtain fourth encrypted information; Sending a third key agreement message including the third encrypted information and the fourth encrypted information to the initiator, so that the initiator decrypts the received fourth encrypted information based on the private key corresponding to the encryption certificate of the initiator to obtain the third random key, decrypts the received third encrypted information using the third random key to obtain the first key encapsulation, and decapsulates the decrypted first key encapsulation based on the first quantum resistant encryption private key corresponding to the first quantum resistant encryption public key to obtain the second random key.

2. The method according to claim 1, characterized in that The second encrypted information is obtained by encrypting the first quantum-resistant encryption public key generated by the initiator based on the quantum-resistant cryptographic algorithm and the first quantum-resistant signature public key using the first random key; The second key agreement message further includes: the signature certificate of the initiator, the first signature information, and the second signature information; wherein the first signature information is obtained by first re-signing the first encrypted information and the second encrypted information using one of the private key corresponding to the signature certificate of the initiator and the first quantum-resistant signature private key corresponding to the first quantum-resistant signature public key; the second signature information is obtained by second re-signing the first signature information using the other of the private key corresponding to the signature certificate of the initiator and the first quantum-resistant signature private key; Decrypting the received second encrypted information using the first random key to obtain the first quantum-resistant encryption public key includes: Decrypting the received second encrypted information using the first random key to obtain the first quantum-resistant encryption public key and the first quantum-resistant signature public key; Before encapsulating the second random key with the first quantum-resistant encryption public key to obtain the first key encapsulation, the method further includes: Performing signature verification on the received first signature information using the public key corresponding to the private key used for the first re-signature, and performing signature verification on the received second signature information using the public key corresponding to the private key used for the second re-signature; Encapsulating the second random key using the first quantum-resistant encryption public key to obtain a first key encapsulation includes: When the signature verification passes, the second random key is encapsulated by using the first quantum-resistant encryption public key to obtain a first key encapsulation.

3. The method according to claim 1, characterized in that The method of encrypting the first key package by using the third random key to obtain third encrypted information includes: Encrypting the second quantum-resistant encryption public key and the first key package generated by the responder using the third random key to obtain third encrypted information, so that the initiator encapsulates the current fourth random key based on the second quantum-resistant encryption public key to obtain the second key package; After sending a third key agreement message including the third encryption information and the fourth encryption information to the initiator, the method further includes: Receiving a fourth key negotiation message currently sent by the initiator; wherein the fourth key negotiation message includes: a second key encapsulation obtained by encapsulating the current fourth random key using the second quantum-resistant encryption public key; Decapsulate the currently received second key encapsulation using the second quantum resistant encryption private key corresponding to the second quantum resistant encryption public key to obtain a current fourth random key; Encapsulating the current fifth random key using the first quantum-resistant encryption public key to obtain a current third key encapsulation; Sending a fifth key agreement message including the current third key encapsulation to the initiator, so that the initiator decapsulates the received third key encapsulation based on the first quantum-resistant encryption private key to obtain a current fifth random key.

4. The method according to claim 3, characterized in that After sending the fifth key agreement message including the current third key encapsulation to the initiator, the method further includes: Return to the step of receiving the fourth key agreement message currently sent by the initiator until the number of the sent third key encapsulations reaches a preset number.

5. The method according to any one of claims 1 to 4, characterized in that: After sending a third key agreement message including the third encryption information and the fourth encryption information to the initiator, the method further includes: Receive a first sub-tunnel negotiation message sent by the initiator; wherein the first sub-tunnel negotiation message includes: fifth encrypted information obtained by encrypting the first sub-tunnel negotiation information of the initiator using a first protection key, and first non-repudiation information obtained by performing non-repudiation calculation on the fifth encrypted information using a first verification key; the first protection key and the first verification key are obtained by performing key derivation based on the obtained random key; Decrypting the encrypted first sub-tunnel negotiation information using the first protection key to obtain the first sub-tunnel negotiation information; and performing non-repudiation verification on the received first non-repudiation information based on the first verification key and the received fifth encrypted information; After the non-repudiation verification is passed, the second sub-tunnel negotiation information of the responder is encrypted using the first protection key to obtain sixth encrypted information, and the sixth encrypted information is non-repudiation calculated using the first verification key to obtain second non-repudiation information; A second sub-tunnel negotiation message including the sixth encrypted information and the second non-repudiation information is sent to the initiator, so that the initiator uses the first protection key to decrypt the received sixth encrypted information to obtain the second sub-tunnel negotiation information, and performs non-repudiation verification on the received second non-repudiation information based on the first verification key and the received sixth encrypted information to complete identity confirmation.

6. The method according to claim 5, characterized in that The first sub-tunnel negotiation information includes at least one of the following types of information: an identifier of the initiator, an identifier of the responder, a generated random number, a tunnel selector of the initiator, a tunnel selector of the responder, and an obtained key encapsulation; The second sub-tunnel negotiation information includes at least one of the following types of information: an identifier of the initiator, an identifier of the responder, a generated random number, a tunnel selector of the initiator, a tunnel selector of the responder, and an obtained key encapsulation; and / or, The method further comprises: A key is derived based on the first sub-tunnel negotiation information and the second sub-tunnel negotiation information to obtain a key for use in the encapsulating security payload / authentication header stage.

7. The method according to claim 1, characterized in that Before sending the first key negotiation message to the initiator, the method further includes: When receiving a key negotiation request sent by the initiator, sending a question message to the initiator; wherein the question message is used to instruct the initiator to use a specified algorithm to calculate the source data sent by the responder to generate reply data that conforms to a specified format; Receiving a reply message sent by the initiator; wherein the reply message includes reply data generated by the initiator based on the question message; Verifying whether the received reply data is correct based on the specified algorithm and the source data; Sending a first key negotiation message to the initiator includes: When the received reply data is verified to be correct, a first key negotiation message is sent to the initiator.

8. The method according to any one of claims 1 to 4, characterized in that: The responder is provided with a first cryptographic algorithm hardware; each encryption process, each decryption process, each signing process, and / or each signature verification process of the responder is implemented by calculation through the first cryptographic algorithm hardware.

9. An IPSec hybrid anti-quantum computing security method, characterized in that: The method is applied to an initiator, and the method includes: Send a key negotiation request to the responder; Receiving a first key negotiation message sent by the responder; wherein the first key negotiation message includes an encryption certificate of the responder; Encrypting the first random key using the public key in the encryption certificate of the responder to obtain first encrypted information; Generate a first quantum-resistant encryption public key and a corresponding first quantum-resistant encryption private key based on a quantum-resistant cryptographic algorithm; Encrypting the first quantum-resistant encryption public key using the first random key to obtain second encrypted information; Sending a second key negotiation message including the first encryption information, the second encryption information, and the encryption certificate of the initiator to the responder; Receive a third key agreement message sent by the responder; wherein the third key agreement message includes: a first key encapsulation, third encryption information, and fourth encryption information; the first key encapsulation is obtained by encapsulating the second random key with the first quantum-resistant encryption public key; the third encryption information is obtained by encrypting the first key encapsulation with the third random key; the fourth encryption information is obtained by encrypting the third random key with the public key in the encryption certificate of the initiator; Decrypting the received fourth encrypted information based on the private key corresponding to the encryption certificate of the initiator to obtain the third random key; Decrypting the received third encrypted information using the third random key to obtain the first key encapsulation; The first key encapsulation obtained by decryption is decapsulated based on the first quantum-resistant encryption private key to obtain the second random key.

10. The method according to claim 9, characterized in that Encrypting the first quantum-resistant encryption public key using the first random key to obtain second encrypted information includes: Using the first random key, encrypt a first quantum-resistant encryption public key and a first quantum-resistant signature public key generated by the initiator based on a quantum-resistant cryptographic algorithm to obtain second encrypted information; Before sending a second key agreement message including the first encryption information, the second encryption information, and the encryption certificate of the initiator to the responder, the method further includes: Using one of the private key corresponding to the signature certificate of the initiator and the first quantum-resistant signature private key corresponding to the first quantum-resistant signature public key, the first encrypted information and the second encrypted information are first re-signed to obtain first signature information, and using the other of the private key corresponding to the signature certificate of the initiator and the first quantum-resistant signature private key, the first signature information is second re-signed to obtain second signature information; Sending a second key negotiation message including the first encryption information, the second encryption information, and the encryption certificate of the initiator to the responder includes: Sending a second key agreement message including the first encrypted information, the second encrypted information, the encryption certificate of the initiator, the signature certificate of the initiator, the first signature information, and the second signature information to the responder; and / or, The third encrypted information is obtained by encrypting the second quantum-resistant encryption public key generated by the responder and the first key encapsulation using the second random key; After decapsulating the decrypted first key encapsulation based on the first quantum-resistant encryption private key corresponding to the first quantum-resistant encryption public key to obtain the second random key, the method further includes: Encapsulating the current fourth random key using the second quantum-resistant encryption public key to obtain a current second key encapsulation; Sending a fourth key agreement message including the current second key encapsulation to the responder, so that the responder decapsulates the received second key encapsulation using the second quantum resistant encryption private key corresponding to the second quantum resistant encryption public key to obtain the current fourth random key; receiving a fifth key agreement message currently sent by the responder; wherein the fifth key agreement message includes a third key encapsulation obtained by encapsulating the current fifth random key using the first quantum-resistant encryption public key; Based on the first quantum-resistant encryption private key, decapsulate the received third key encapsulation to obtain a current fifth random key; After decapsulating the received third key encapsulation based on the first quantum-resistant encryption private key to obtain a current fifth random key, the method further includes: Return to the step of encapsulating the current fourth random key with the second quantum-resistant encryption public key to obtain the current second key encapsulation, until the number of sent second key encapsulations reaches a preset number; and / or, The third key agreement message further includes: third signature information and fourth signature information; the third encrypted information is obtained by encrypting the second quantum-resistant encryption public key generated by the responder, the second quantum-resistant signature public key generated by the responder, and the first key encapsulation using a third random key; wherein the third signature information is obtained by first re-signing the third encrypted information and the fourth encrypted information using one of the private key corresponding to the signature certificate of the responder and the second quantum-resistant signature private key generated by the responder, and the fourth signature information is obtained by second re-signing the third signature information using the other of the private key corresponding to the signature certificate of the responder and the second quantum-resistant signature private key generated by the responder; After decrypting the received third encrypted information using the third random key to obtain the first key encapsulation, the method further includes: Performing signature verification on the received third signature information using the public key corresponding to the private key used for the first signature, and performing signature verification on the received fourth signature information using the public key corresponding to the private key used for the second signature; and / or, After decapsulating the decrypted first key encapsulation based on the first quantum-resistant encryption private key corresponding to the first quantum-resistant encryption public key to obtain the second random key, the method further includes: The first sub-tunnel negotiation information of the initiator is encrypted using the first protection key to obtain fifth encrypted information, and the fifth encrypted information is non-repudiated by the first verification key to obtain first non-repudiation information; wherein the first protection key and the first verification key are obtained by performing key derivation based on the obtained random key; Sending a first sub-tunnel negotiation message including the fifth encrypted information and the first non-repudiation information to the responder, so that the responder decrypts the encrypted first sub-tunnel negotiation information using the first protection key to obtain the first sub-tunnel negotiation information; and performing non-repudiation verification on the received first non-repudiation information based on the first verification key and the received fifth encrypted information; Receive a second sub-tunnel negotiation message sent by the responder; wherein the second sub-tunnel negotiation message includes sixth encrypted information and second non-repudiation information; the sixth encrypted information is obtained by encrypting the second sub-tunnel negotiation information of the responder using the first protection key; the second non-repudiation information is obtained by performing non-repudiation calculation on the sixth encrypted information using the first verification key; Decrypting the received sixth encrypted information using the first protection key to obtain second sub-tunnel negotiation information; Performing non-repudiation verification on the received second non-repudiation information based on the first verification key and the received sixth encrypted information to complete identity confirmation; The first sub-tunnel negotiation information includes at least one of the following types of information: an identifier of the initiator, an identifier of the responder, a generated random number, a tunnel selector of the initiator, a tunnel selector of the responder, and an obtained key encapsulation; The second sub-tunnel negotiation information includes at least one of the following types of information: an identifier of the initiator, an identifier of the responder, a generated random number, a tunnel selector of the initiator, a tunnel selector of the responder, and an obtained key encapsulation; The method further comprises: Performing key derivation based on the first sub-tunnel negotiation information and the second sub-tunnel negotiation information to obtain a key for use in the encapsulating security payload / authentication header stage; and / or, After sending the key negotiation request to the responder and before receiving the first key negotiation message sent by the responder, the method further includes: Receiving a question message sent by the initiator; wherein the question message is used to instruct the initiator to use a specified algorithm to calculate the source data sent by the responder to generate reply data that conforms to a specified format; Calculate the source data using the specified algorithm to generate response data that complies with the specified format; A reply message including the reply data is sent to the responder so that the received reply data is verified to be correct based on the specified algorithm and the source data, and if the verification is correct, a first key negotiation message is sent to the initiator.

11. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor, for implementing the method described in any one of claims 1 to 8, or the method described in any one of claims 9 to 10, when executing a program stored in a memory.

12. A computer program product comprising instructions, characterized in that When the computer program product is executed on a computer, the computer is enabled to implement the method according to any one of claims 1 to 8 or the method according to any one of claims 9 to 10.

Citation Information

Patent Citations

  • Anti-quantum security enhancement method of national secret IPSec VPN protocol

    CN118540165A

  • National password IPSec secure communication method supporting quantum cryptography resistance

    CN118631448A