Key exchange method and device, equipment and storage medium
By putting the post-quantum public key cryptography algorithm into the ISAKMP protocol framework of the National ISAKMP protocol, using the post-quantum key packaging algorithm to build a security alliance payload and perform key exchange and authentication, the security risks and protocols in the existing technology in the quantum computing environment are solved. Complexity issues achieve quantum security and key exchange reliability.
Patent Information
- Application Number
- CN202411751905.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-02
- Publication Date
- 2025-02-21
- Estimated Expiration
- 2044-12-02
AI Technical Summary
The prior art poses security risks in the quantum computing environment, and the international IKEv2 protocol processing process is complex and does not consider the identity authentication function.
By placing the post-quantum public key cryptography algorithm into the ISAKMP protocol framework of the National Secretariat, the post-quantum key packaging algorithm is used to build a security alliance payload, and a notification message is built through the security alliance payload to perform key exchange and identity authentication.
It realizes quantum security while having the security of active public key cryptography, and ensures the reliability of key exchange through identity verification, solving the problem that international protocols do not have quantum security.
Smart Images

Figure CN119496614A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of information security technology, and in particular to a key exchange method, device, equipment and storage medium. Background Art
[0002] With the development of quantum computing technology, the security of existing public key cryptographic algorithms has been seriously challenged, especially cryptographic algorithms designed based on large integer factorization and discrete logarithm problems. In order to solve this potential problem, cryptographers have developed a number of cryptographic algorithms that can resist quantum computing attacks, called post-quantum public key cryptographic algorithms. However, due to the short application time, these algorithms are not very mature, so the mixed use of existing public key cryptographic algorithms and post-quantum public key cryptographic algorithms is currently the mainstream use method, such as in cryptographic protocols.
[0003] At present, the Internet Security Association and Key Management Protocol (ISAKMP) protocol based on the national secret algorithm uses the SM2 algorithm for key exchange and identity authentication during the key exchange process. The SM2 algorithm has serious security risks in the quantum computing environment. At the same time, when the international IKEv2 protocol is used for post-quantum public key cryptography fusion design, the protocol processing flow is complicated, and only the key exchange function is considered, but not the identity authentication function. Summary of the invention
[0004] In view of this, the purpose of the present invention is to provide a key exchange method, device, equipment and storage medium, which can retain the current public key cryptographic algorithm and function, and place the post-quantum public key cryptographic algorithm into the national secret ISAKMP protocol framework, so that the protocol can achieve quantum security while having the security of the current public key cryptography. At the same time, in the post-quantum public key cryptography fusion design, identity authentication is performed after the key exchange, ensuring the reliability of the key exchange process. The specific scheme is as follows:
[0005] In a first aspect, the present application provides a key exchange method, which is applied to a message initiator of an Internet security association and key management protocol, comprising:
[0006] Constructing a security association payload based on a post-quantum key encapsulation algorithm and a preset national secret algorithm, and constructing a notification message based on the security association payload and a corresponding post-quantum key exchange notification payload based on the Internet security association and key management protocol, and sending the notification message to a message responder, so that the message responder returns a corresponding response message to the message initiator according to the security association payload and the post-quantum key exchange notification payload in the notification message;
[0007] Determine a plurality of post-quantum key encapsulation public keys according to the post-quantum key encapsulation algorithm, construct a corresponding first post-quantum key exchange notification based on each of the post-quantum key encapsulation public keys and send the notification to the message responder, so that the message responder receives the current first post-quantum key exchange notification, encrypts the corresponding temporary shared key using the post-quantum key encapsulation public key to generate a first post-quantum key ciphertext, and constructs a first key exchange response according to the first post-quantum key ciphertext and sends the response to the message initiator;
[0008] Determine a new post-quantum key encapsulation public key and its own first post-quantum signature certificate according to the post-quantum key encapsulation algorithm, generate a first post-quantum signature result based on the first post-quantum signature certificate and all determined post-quantum key encapsulation public keys, and construct a second post-quantum key exchange notification based on the new post-quantum key encapsulation public key, the first post-quantum signature certificate and the first post-quantum signature result, and send it to the message responder, so that the message responder receives the second post-quantum key exchange notification, encrypts the new temporary shared key with the new post-quantum key encapsulation public key to generate a second post-quantum key ciphertext, and generates a second post-quantum signature result based on its own second post-quantum signature certificate and all temporary shared keys, and constructs a second key exchange response based on the second post-quantum key ciphertext, the second post-quantum signature certificate and the second post-quantum signature result, and sends it to the message initiator;
[0009] Based on the Internet security association and key management protocol, identity authentication is performed between itself and the message responder according to the second post-quantum key exchange notification and the second key exchange response.
[0010] Optionally, also include:
[0011] Collect all the temporary shared keys currently received by the message initiator, and use the random number of the initial interaction message between the initiator and the responder and all the temporary shared keys currently received to generate the current reference key of the message initiator.
[0012] Optionally, the process of constructing a corresponding first post-quantum key exchange notification based on each post-quantum key encapsulation public key and sending the notification to the message responder includes:
[0013] Constructing the corresponding first post-quantum key exchange notification based on each of the post-quantum key encapsulation public keys, determining the current reference key of the message initiator, and encrypting the first post-quantum key exchange notification based on the reference key to obtain a notification ciphertext;
[0014] The notification ciphertext is sent to the message responder so that the message responder receives and decrypts the notification ciphertext to obtain the first post-quantum key exchange notification, and uses the post-quantum key encapsulation public key to encrypt the corresponding temporary shared key to generate the first post-quantum key ciphertext, and constructs the first key exchange response according to the first post-quantum key ciphertext and sends it to the message initiator.
[0015] Optionally, constructing a notification message according to the security association payload and the corresponding post-quantum key exchange notification payload based on the Internet security association and key management protocol, and sending the notification message to a message responder, so that the message responder returns a corresponding response message to the message initiator according to the security association payload and the post-quantum key exchange notification payload in the notification message, includes:
[0016] Constructing a message fragment notification payload, and constructing the notification message according to the security association payload, the post-quantum key exchange notification payload and the message fragment notification payload based on the Internet Security Association and Key Management Protocol, and sending the notification message to the message responder, so that the message responder returns the corresponding response message to the message initiator according to the security association payload, the post-quantum key exchange notification payload and the message fragment notification payload in the notification message;
[0017] Accordingly, sending the notification ciphertext to the message responder includes:
[0018] Determining whether the message data volume of the first post-quantum key exchange notification is greater than the data transmission volume of a preset network maximum transmission unit, and if the message data volume is greater than the data transmission volume of the preset network maximum transmission unit, determining whether the reference key currently exists;
[0019] If the base key currently exists, the notification ciphertext is fragmented based on the base key, and the fragmented notification ciphertext is sent to the message responder.
[0020] Optionally, fragmenting the notification ciphertext based on the reference key and sending the fragmented notification ciphertext to the message responder includes:
[0021] Slice the notification ciphertext based on the reference key to obtain a plurality of slice packets;
[0022] Determine the number of fragment packets of the notification ciphertext and the fragment sequence number of each fragment packet, and respectively add a first identifier corresponding to the number of fragment packets and a second identifier corresponding to the fragment sequence number of each fragment packet to a target position of the corresponding fragment packet; the target position is a position after the message header of the fragment packet;
[0023] An integrity verification key is generated based on the reference key, each of the fragment packets is encrypted using the integrity verification key, and each of the encrypted fragment packets is sent to the message responder.
[0024] In a second aspect, the present application discloses a key exchange method, which is applied to a message responder of an Internet security association and key management protocol, comprising:
[0025] Receive a notification message sent by a message initiator, and send a response message corresponding to the notification message to the message initiator according to the security association payload and the post-quantum key exchange notification payload in the notification message; the notification message is a message constructed by the message initiator based on the Internet Security Association and Key Management Protocol according to the security association payload and the corresponding post-quantum key exchange notification payload after the security association payload is constructed based on the post-quantum key encapsulation algorithm and the preset national secret algorithm;
[0026] Receive a first post-quantum key exchange notification from the current message initiator, encrypt the corresponding temporary shared key using the post-quantum key encapsulation public key to generate a first post-quantum key ciphertext, and construct a first key exchange response based on the first post-quantum key ciphertext and send it to the message initiator; the first post-quantum key exchange notification is a message constructed and sent by the message initiator based on a number of post-quantum key encapsulation public keys determined according to the post-quantum key encapsulation algorithm;
[0027] Receive a second post-quantum key exchange notification from the message initiator, encrypt a new temporary shared key using a new post-quantum key encapsulation public key to generate a second post-quantum key ciphertext, generate a second post-quantum signature result based on its own second post-quantum signature certificate and all temporary shared keys, and construct a second key exchange response based on the second post-quantum key ciphertext, the second post-quantum signature certificate and the second post-quantum signature result and send it to the message initiator; the second post-quantum key exchange notification is a message constructed and sent by the message initiator based on the new post-quantum key encapsulation public key, the first post-quantum signature certificate and the first post-quantum signature result after the message initiator determines the new post-quantum key encapsulation public key and its own first post-quantum signature certificate according to the post-quantum key encapsulation algorithm, and generates a first post-quantum signature result based on the first post-quantum signature certificate and all determined post-quantum key encapsulation public keys;
[0028] Based on the Internet Security Association and Key Management Protocol, identity authentication is performed between itself and the message initiator according to the second post-quantum key exchange notification and the second key exchange response.
[0029] In a third aspect, the present application discloses a key exchange device, which is applied to a message initiator of an Internet security association and key management protocol, comprising:
[0030] A first message construction module is used to construct a security association payload based on a post-quantum key encapsulation algorithm and a preset national secret algorithm, and to construct a notification message according to the security association payload and a corresponding post-quantum key exchange notification payload based on the Internet security association and key management protocol, and to send the notification message to a message responder, so that the message responder returns a corresponding response message to the message initiator according to the security association payload and the post-quantum key exchange notification payload in the notification message;
[0031] A first notification construction module is used to determine a number of post-quantum key encapsulation public keys according to the post-quantum key encapsulation algorithm, construct a corresponding first post-quantum key exchange notification based on each of the post-quantum key encapsulation public keys, and send it to the message responder, so that the message responder receives the first post-quantum key exchange notification, uses the post-quantum key encapsulation public key to encrypt the corresponding temporary shared key to generate a first post-quantum key ciphertext, and constructs a first key exchange response according to the first post-quantum key ciphertext and sends it to the message initiator;
[0032] a second notification construction module, configured to determine a new post-quantum key encapsulation public key and its own first post-quantum signature certificate according to the post-quantum key encapsulation algorithm, generate a first post-quantum signature result based on the first post-quantum signature certificate and all determined post-quantum key encapsulation public keys, and construct a second post-quantum key exchange notification based on the new post-quantum key encapsulation public key, the first post-quantum signature certificate and the first post-quantum signature result, and send the notification to the message responder, so that the message responder receives the second post-quantum key exchange notification, encrypts the new temporary shared key with the new post-quantum key encapsulation public key to generate a second post-quantum key ciphertext, and generates a second post-quantum signature result based on its own second post-quantum signature certificate and all temporary shared keys, and constructs a second key exchange response based on the second post-quantum key ciphertext, the second post-quantum signature certificate and the second post-quantum signature result, and sends the response to the message initiator;
[0033] A first identity authentication module is used to perform identity authentication between itself and the message responder based on the Internet Security Association and Key Management Protocol according to the second post-quantum key exchange notification and the second key exchange response.
[0034] In a fourth aspect, the present application discloses a key exchange device, which is applied to a message responder of an Internet security association and key management protocol, comprising:
[0035] A second message construction module is used to receive a notification message sent by a message initiator, and send a response message corresponding to the notification message to the message initiator according to the security association payload and the post-quantum key exchange notification payload in the notification message; the notification message is a message constructed by the message initiator based on the Internet Security Association and Key Management Protocol according to the security association payload and the corresponding post-quantum key exchange notification payload after the security association payload is constructed based on the post-quantum key encapsulation algorithm and the preset national secret algorithm;
[0036] A first response construction module is used to receive a first post-quantum key exchange notification from the current message initiator, encrypt the corresponding temporary shared key using the post-quantum key encapsulation public key to generate a first post-quantum key ciphertext, and construct a first key exchange response based on the first post-quantum key ciphertext and send it to the message initiator; the first post-quantum key exchange notification is a message constructed and sent by the message initiator based on a number of post-quantum key encapsulation public keys determined according to the post-quantum key encapsulation algorithm;
[0037] A second response construction module is used to receive a second post-quantum key exchange notification from the message initiator, encrypt a new temporary shared key using a new post-quantum key encapsulation public key to generate a second post-quantum key ciphertext, generate a second post-quantum signature result based on its own second post-quantum signature certificate and all temporary shared keys, and construct a second key exchange response based on the second post-quantum key ciphertext, the second post-quantum signature certificate and the second post-quantum signature result and send it to the message initiator; the second post-quantum key exchange notification is a message constructed and sent by the message initiator based on the new post-quantum key encapsulation public key, the first post-quantum signature certificate and the first post-quantum signature result after the message initiator determines the new post-quantum key encapsulation public key and its own first post-quantum signature certificate according to the post-quantum key encapsulation algorithm, and generates a first post-quantum signature result based on the first post-quantum signature certificate and all determined post-quantum key encapsulation public keys;
[0038] A second identity authentication module is used to perform identity authentication between itself and the message initiator based on the Internet security association and key management protocol according to the second post-quantum key exchange notification and the second key exchange response.
[0039] In a fifth aspect, the present application provides an electronic device, including:
[0040] Memory, used to store computer programs;
[0041] A processor is used to execute the computer program to implement the aforementioned key exchange method.
[0042] In a sixth aspect, the present application provides a computer-readable storage medium for storing a computer program, which implements the aforementioned key exchange method when executed by a processor.
[0043] In the present application, the message initiator of the Internet Security Association and Key Management Protocol first constructs a security alliance payload based on a post-quantum key encapsulation algorithm and a preset national secret algorithm, and constructs a notification message based on the Internet Security Association and Key Management Protocol according to the security alliance payload and the corresponding post-quantum key exchange notification payload, and sends the notification message to the message responder, so that the message responder returns a corresponding response message to the message initiator according to the security alliance payload and the post-quantum key exchange notification payload in the notification message, and then determines a number of post-quantum key encapsulation public keys according to the post-quantum key encapsulation algorithm, constructs a corresponding first post-quantum key exchange notification based on each of the post-quantum key encapsulation public keys and sends it to the message responder, so that the message responder receives the current first post-quantum key exchange notification, uses the post-quantum key encapsulation public key to encrypt the corresponding temporary shared key to generate a first post-quantum key ciphertext, and constructs a first key exchange response according to the first post-quantum key ciphertext and sends it to the message initiator, and then determines a number of post-quantum key encapsulation public keys according to the post-quantum key encapsulation algorithm, and constructs a corresponding first post-quantum key exchange notification based on each of the post-quantum key encapsulation public keys and sends it to the message responder, so that the message responder receives the current first post-quantum key exchange notification, and uses the post-quantum key encapsulation public key to encrypt the corresponding temporary shared key to generate a first post-quantum key ciphertext, and constructs a first key exchange response according to the first post-quantum key ciphertext and sends it to the message initiator, and then sends it to the message responder according to the post-quantum key The encapsulation algorithm determines a new post-quantum key encapsulation public key and its own first post-quantum signature certificate, generates a first post-quantum signature result based on the first post-quantum signature certificate and all determined post-quantum key encapsulation public keys, and constructs a second post-quantum key exchange notification based on the new post-quantum key encapsulation public key, the first post-quantum signature certificate and the first post-quantum signature result, and sends it to the message responder, so that the message responder receives the second post-quantum key exchange notification, encrypts the new temporary shared key with the new post-quantum key encapsulation public key to generate a second post-quantum key ciphertext, and generates a second post-quantum signature result based on its own second post-quantum signature certificate and all temporary shared keys, constructs a second key exchange response based on the second post-quantum key ciphertext, the second post-quantum signature certificate and the second post-quantum signature result, and sends it to the message initiator, and finally performs identity authentication between itself and the message responder based on the second post-quantum key exchange notification and the second key exchange response based on the Internet security association and key management protocol. In this way, the message initiator sends a key exchange request based on a preset post-quantum algorithm, and the responder exchanges keys with the message initiator based on the key exchange request. By using the post-quantum encapsulation algorithm to build a security association payload, and using the security association payload to build a notification message, and using the notification message to exchange keys, the Internet security association and key management protocol can achieve quantum security while having the security of existing public key cryptography, thus solving the problem that current international protocols do not have quantum security. In addition, a post-quantum key exchange notification based on the post-quantum algorithm is used to build a key exchange and identity authentication between the message initiator and the message responder, thereby ensuring the reliability of the key exchange. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the embodiments of the present invention 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 embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0045] Figure 1 A flow chart of a key exchange method disclosed in this application;
[0046] Figure 2 A key exchange flow chart disclosed in this application;
[0047] Figure 3 A specific key exchange flow chart disclosed in this application;
[0048] Figure 4 A flow chart of a message fragmentation method disclosed in this application;
[0049] Figure 5 A message fragmentation flow chart disclosed in this application;
[0050] Figure 6 A flow chart of another key exchange method disclosed in this application;
[0051] Figure 7 A schematic diagram of the structure of a key exchange device disclosed in this application;
[0052] Figure 8 This is a schematic diagram of the structure of another key exchange device disclosed in this application;
[0053] Fig. 9 This is a structural diagram of an electronic device disclosed in this application. DETAILED DESCRIPTION
[0054] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0055] At present, due to the serious security risks of the national secret ISAKMP protocol in the quantum computing environment, and the complex processing flow of the international IKEv2 (Internet Key Exchange) protocol, which only considers the key exchange function but not the post-quantum identity authentication function, the present application provides a key exchange method, which constructs a security alliance payload by using a post-quantum encapsulation algorithm, constructs a notification message by using the security alliance payload, and exchanges keys through the notification message, so that the national secret ISAKMP protocol can achieve quantum security while having the security of the current public key cryptography, and at the same time, the reliability of the key exchange is ensured by constructing a second post-quantum key exchange notification and a second key exchange response to authenticate the identity between the message initiator and the message responder.
[0056] See also Figure 1 As shown, an embodiment of the present invention discloses a key exchange method, which is applied to a message initiator of an Internet security association and key management protocol, comprising:
[0057] Step S11: construct a security association payload based on a post-quantum key encapsulation algorithm and a preset national secret algorithm, and construct a notification message based on the security association payload and the corresponding post-quantum key exchange notification payload based on the Internet Security Association and Key Management Protocol, and send the notification message to the message responder, so that the message responder returns a corresponding response message to the message initiator according to the security association payload and the post-quantum key exchange notification payload in the notification message.
[0058] It can be understood that the current public key cryptographic algorithm and function are retained in this embodiment, and the national secret ISAKMP protocol framework is modified by using the post-quantum public key cryptographic algorithm, that is, the post-quantum public key cryptographic algorithm is placed in the national secret ISAKMP protocol framework, and a security alliance payload is constructed based on the post-quantum key encapsulation algorithm and the preset national secret algorithm, and a notification message is constructed based on the Internet security association and key management protocol according to the security alliance payload and the corresponding post-quantum key exchange notification payload. In this embodiment, the specific modifications to the protocol are shown in Table 1 below, and the specific protocol payload modifications are shown in Table 2 below, where GPH (Gallons Per Hour) represents the public payload header, and the bold part represents the specific modification of the payload.
[0059] Table 1 Protocol modification instructions
[0060] Table 2 Load modification instructions
[0061] After constructing a security association payload based on the post-quantum key encapsulation algorithm and the preset national secret algorithm, a notification message constructed based on the Internet Security Association and Key Management Protocol according to the security association payload and the corresponding post-quantum key exchange notification payload is sent to the message responder, so that the message responder returns a corresponding response message to the message initiator according to the security association payload and the post-quantum key exchange notification payload in the notification message, which may specifically include: constructing a message fragment notification payload, i.e., the N (Fragment) notification payload in Table 1, and based on the Internet Security Association and Key Management Protocol, i.e., the national secret ISAKMP protocol, according to the security association payload, i.e., the SA (Security The method comprises: constructing a notification message by using the SA payload, the N(Intermedia) payload, the N(Multi_Key) payload and the N(Fragment) payload in Table 1, and sending the notification message to the message responder, so that the message responder returns a corresponding response message to the message initiator according to the SA payload, the N(Intermedia) payload, the N(Multi_Key) payload and the N(Fragment) payload in the notification message; correspondingly, sending the notification ciphertext to the message responder may specifically include: determining whether the message data volume of the first post-quantum key exchange notification is greater than the data transmission volume of the preset network maximum transmission unit, that is, the MTU (Maximum Transmission Unit), if the message data volume is greater than the MTU data transmission volume, determining whether there is a reference key, that is, SKEYID, currently; in a specific implementation manner, if there is a reference key SKEYID currently, fragmenting the notification ciphertext based on the reference key SKEYID, and sending the fragmented notification ciphertext to the message responder. It should be noted that, because the cryptographic parameters of the post-quantum public key algorithm are greater than 2000 bytes, a message that contains the post-quantum public key algorithm parameters will exceed the MTU (about 1500 bytes) of the network transmission. In this embodiment, by notifying the ciphertext fragmentation based on the reference key pair, the problem of key negotiation failure during ISAKMP protocol interaction caused by the arbitrary discarding of IP (Internet Protocol) fragments by devices such as firewalls in the network is effectively solved.
[0062] Step S12: determine several post-quantum key encapsulation public keys according to the post-quantum key encapsulation algorithm, construct a corresponding first post-quantum key exchange notification based on each of the post-quantum key encapsulation public keys and send it to the message responder, so that the message responder receives the current first post-quantum key exchange notification, uses the post-quantum key encapsulation public key to encrypt the corresponding temporary shared key to generate a first post-quantum key ciphertext, and constructs a first key exchange response according to the first post-quantum key ciphertext and sends it to the message initiator.
[0063] It should be pointed out that if Figure 2 As shown, the new protocol framework in this embodiment is modified under the original protocol framework. Figure 2 The Zhongyuan protocol framework is messages 1, 2, 3, 4, 5, and 6, which have the functions of key exchange and identity authentication (signature verification), but SM2 is used to complete them; based on the content in the previous step, this embodiment modifies the payload in messages 1 and 2 based on the post-quantum algorithm, and adds (optional) 3.1 / (optional) 4.1 for the first post-quantum key exchange, (optional) 3.2 / (optional) 4.2... for the second post-quantum key exchange, and accordingly, the third, fourth, and nth post-quantum key exchanges can be continued, and in the nth post-quantum key exchange, both post-quantum key exchange and post-quantum identity authentication (signature verification) are performed, and this identity authentication is to authenticate the key exchange data generated by all previous post-quantum key exchanges. In other words, Figure 2 As shown, in a complete identity authentication process based on the post-quantum algorithm and the national secret ISAKMP protocol, the post-quantum key is exchanged multiple times, but the post-quantum bidirectional identity is only authenticated once.
[0064] In this embodiment, the process of constructing a corresponding first post-quantum key exchange notification based on each post-quantum key encapsulation public key and sending it to the message responder may specifically include: constructing a corresponding first post-quantum key exchange notification based on each post-quantum key encapsulation public key, that is, a post-quantum KEM (Key Encapsulation Mechanism) public key, determining the current reference key SYEYID of the message initiator, and encrypting the first post-quantum key exchange notification based on the reference key SYEYID to obtain a notification ciphertext; sending the notification ciphertext to the message responder so that the message responder receives and decrypts the notification ciphertext to obtain the first post-quantum key exchange notification, and using the post-quantum KEM public key to encrypt the corresponding temporary shared key, that is, Skrn to generate a first post-quantum key ciphertext, that is, the first KEM ciphertext, and constructing a first key exchange response based on the first post-quantum key ciphertext and sending it to the message initiator. In this embodiment, the post-quantum key exchange notification is encrypted by the reference key to ensure the security of information during the key exchange process.
[0065] Step S13: determine a new post-quantum key encapsulation public key and its own first post-quantum signature certificate according to the post-quantum key encapsulation algorithm, generate a first post-quantum signature result based on the first post-quantum signature certificate and all determined post-quantum key encapsulation public keys, and construct a second post-quantum key exchange notification based on the new post-quantum key encapsulation public key, the first post-quantum signature certificate and the first post-quantum signature result, and send it to the message responder, so that the message responder receives the second post-quantum key exchange notification, encrypts the new temporary shared key with the new post-quantum key encapsulation public key to generate a second post-quantum key ciphertext, and generates a second post-quantum signature result based on its own second post-quantum signature certificate and all temporary shared keys, and constructs a second key exchange response based on the second post-quantum key ciphertext, the second post-quantum signature certificate and the second post-quantum signature result, and sends it to the message initiator.
[0066] In this embodiment, the process of constructing a second post-quantum key exchange notification based on the new post-quantum key encapsulation public key, the first post-quantum signature certificate and the first post-quantum signature result and sending it to the message responder may specifically include: constructing a corresponding second post-quantum key exchange notification based on each post-quantum key encapsulation public key, determining the current reference key SKEYID of the message initiator, and encrypting the second post-quantum key exchange notification based on the reference key SKEYID to obtain a notification ciphertext; sending the notification ciphertext to the message responder so that the message responder receives and decrypts the notification ciphertext to obtain a second post-quantum key exchange notification, and using the post-quantum KEM public key to encrypt the corresponding temporary shared key Skrn to generate a second post-quantum key ciphertext, that is, a second KEM ciphertext, and constructing a first key exchange response based on the second KEM ciphertext and sending it to the message initiator. In this embodiment, the post-quantum key exchange notification is encrypted by the reference key to ensure the security of information during the key exchange process.
[0067] Step S14: Based on the Internet Security Association and Key Management Protocol, perform identity authentication between itself and the message responder according to the second post-quantum key exchange notification and the second key exchange response.
[0068] In this embodiment, based on the national secret ISAKMP protocol, identity authentication is performed between itself and the message responder according to the second post-quantum key exchange notification and the second key exchange response. By performing identity authentication between the message initiator and the message responder, the reliability of the key exchange process is guaranteed.
[0069] The specific process of this embodiment is as follows Figure 2As shown in the figure, the initiator adds N (Intermedia) and N (Multi_Key) notification payloads after the SA payload of message 1 and adds the post-quantum KEM algorithm information in the Transform sub-payload in the SA payload; the responder agrees to use the post-quantum KEM algorithm for key exchange, adds the same N (Intermedia) and N (Multi_Key) payloads after the SA payload of message 2, and selects the determined post-quantum KEM algorithm information in the Transform payload in the SA payload; messages 3 and 4 remain unchanged, using the national secret ISAKMP protocol message format; the message initiator sends its own post-quantum KEM public key in message 3.1; the message responder sends the KE wrapped with the post-quantum KEM public key of the message initiator in message 4.1. M ciphertext; the message initiator and the message responder send several post-quantum KEM key exchange messages 3.2~4.n-1 based on messages 3.1 and 4.1; the message initiator sends post-quantum KEM key exchange message 3.n for the last time, and this time sends the local post-quantum KEM public key, the local post-quantum signature certificate and the post-quantum signature results of all previous post-quantum KEM public key data; the message responder sends post-quantum KEM key exchange message 4.n for the last time. In addition to sending the KEM ciphertext encapsulated with the post-quantum KEM public key of the message initiator, it also sends the local post-quantum signature certificate and the post-quantum signature results of the shared key encapsulated by all previous post-quantum KEM; messages 5 and 6 remain unchanged, and the national secret ISAKMP protocol message format is used to complete the verification of all the interaction processes of the protocol. In a specific implementation, the modified national secret ISAKMP protocol is instantiated with two key exchanges of the post-quantum public key cryptographic algorithms Kyber-768 / Falcon-1024 and Kyber-1024 / Falcon-1024, and the protocol interaction process is as follows: Figure 3As shown, the message initiator adds N (Intermedia) and N (Multi_Key) notification payloads after the SA payload of message 1 and adds the algorithm IDs (Identity document) of the post-quantum KEM algorithms Kyber-768 and Kyber-1024 in the Transform payload of the SA payload; the message responder agrees to use the post-quantum KEM algorithm for key exchange, adds the same N (Intermedia) and N (Multi_Key) payloads after the SA payload of message 2, and selects the determined algorithm IDs of the post-quantum KEM algorithms Kyber-768 and Kyber-1024 in the Transform payload of the SA payload; messages 3 and 4 remain unchanged, using the national secret ISAKMP protocol message format; the message initiator generates a temporary Kyber-768 public and private key, sends the Kyber-768 public key data in message 3.1, and saves the private key; the message responder uses the Kyber-768 public key of the message initiator for KEM encapsulation, obtains the shared key SKr1, and sends the KEM encapsulated ciphertext in message 4.1; The message initiator generates a temporary Kyber-1024 public and private key, sends the Kyber-1024 public key data in message 3.2, saves the private key, and sends the Falcon-1024 signature certificate and the Falcon-1024 signature result of the concatenation of the Kyber-768 public key and the Kyber-1024 public key; the message responder sends the KEM ciphertext encapsulated by the message initiator’s Kyber-1024 public key, the local Falcon-1024 signature certificate, and the Falcon-1024 signature result of the concatenation of all previously post-quantum KEM-encapsulated shared keys (i.e., SKr1|SKr2) in message 4.2; messages 5 and 6 remain unchanged, using the national secret ISAKMP protocol message format to complete the verification of the entire protocol interaction process. It should be noted that if the domestic post-quantum public key cryptographic algorithm is standardized, the above-mentioned Kyber-768 / Falcon-1024 and Kyber-1024 / Falcon-1024 algorithms can be replaced with the corresponding domestic algorithms.
[0070] It can be seen that the embodiment of the present application uses the post-quantum encapsulation algorithm to construct a security alliance load, and constructs a notification message through the security alliance load, and performs key exchange through the notification message, so that the Internet security association and key management protocol can achieve quantum security while having the security of the current public key cryptography, thereby solving the problem that the current international protocol does not have quantum security; by constructing a post-quantum key exchange notification and a key exchange response to perform identity authentication between the message initiator and the message responder, the reliability of the key exchange is guaranteed, and multiple post-quantum key encapsulation algorithms can be supported for key exchange, and multiple digital signature algorithms can be supported for post-quantum identity authentication, which has good scalability. In addition, this embodiment adopts message-level modifications to the original protocol framework, adds new message streams to transmit and process post-quantum public key cryptographic parameters, but does not add new payloads, only adds or modifies the original payload category and content, reduces the amount of protocol implementation modification, and makes the modified protocol more practical, easy to be compatible, easy to implement, and easy to prove security.
[0071] Furthermore, in order to avoid the problem of key negotiation failure during interaction of the national secret ISAKMP protocol due to the message size being larger than the transmission data size of the preset network maximum transmission unit, the message needs to be fragmented. In order to illustrate the specific operation of fragmenting the message, as shown below: Figure 4 As shown, the embodiment of the present application also discloses a message fragmentation method, which specifically includes:
[0072] Step S21: Collect all the temporary shared keys currently received by the message initiator, and generate a current reference key using the random number in the initial interaction message between the initiator and the responder and all the temporary shared keys currently received.
[0073] In this embodiment, all temporary shared keys Skrn currently received by the message are collected. All the temporary shared keys Skrn may include specific temporary shared keys, such as Skr1, Skr2, etc., and a pseudo-random number algorithm is used to generate the current base key of the message initiator according to all the temporary shared keys currently received. It should be noted that the base key changes dynamically with the transmission of the message. The base key generation method of the original national secret ISAKMP protocol is SKEYID=PRF(HASH(Ni_b | Nr_b), CKY-I | CKY-R). The base key generation method is changed in the modified protocol in this embodiment to, in a specific implementation manner, if a temporary shared key is not generated currently, a pseudo-random number algorithm, i.e., a PRF (Pseudo Random Function) algorithm, a statistical statement analysis algorithm, i.e., a CKY (Cocke-Kasami-Younger) algorithm and a hash algorithm, i.e., a HASH algorithm is used to generate the current base key of the message initiator. The generation method is SKEYID=PRF(HASH(Ni_b | Nr_b), CKY-I | CKY-R), and use this key to derive encryption to protect the next group of messages; in another specific implementation, if the first group of temporary shared keys Skr1 is generated, the reference key generation method is: SKEYID=PRF(HASH(Ni_b | Nr_b | Skr1), CKY-I | CKY-R). In this embodiment, the generated reference key is used to encrypt the message during the key exchange process, thereby ensuring the reliability of message transmission.
[0074] Step S22: fragment the notification ciphertext based on the reference key to obtain a plurality of fragment packets.
[0075] Because the addition of post-quantum public key cryptography algorithms has increased the size of protocol messages, it is preliminarily estimated that the ISAKMP protocol transmission volume will increase by 20,000 bytes. Among them, a key exchange message using a post-quantum public key cryptography algorithm is about 10,000 bytes. Therefore, the protocol needs to support the IKE fragmentation function, and the IKE fragmentation function is optional. It is defined by the N (Fragment) notification payload, which is placed after the SA payload. If the responder agrees to IKE fragmentation, the same N (Fragment) notification is sent. In this embodiment, the notification ciphertext is fragmented based on the reference key to obtain a number of fragment packets, namely IKE fragments. By fragmenting the notification ciphertext, the problem of key negotiation failure during ISAKMP protocol interaction caused by the arbitrary discarding of IP fragments by devices such as firewalls in the network is solved.
[0076] Step S23, determine the number of fragment packets of the notification ciphertext and the fragment sequence number of each fragment packet, and add the first identifier corresponding to the number of fragment packets and the second identifier corresponding to the fragment sequence number of each fragment packet to the target position of the corresponding fragment packet; the target position is the position after the message header of the fragment packet.
[0077] In this embodiment, the number of fragment packages of the notification ciphertext and the fragment sequence number of each fragment package are determined, and the first identifier corresponding to the number of fragment packages and the second identifier corresponding to the fragment sequence number of each fragment package are added to the target position of the corresponding fragment package. In a specific implementation, 4 bytes of fragment information are added after the message header of each fragment package, which respectively indicate the current number of fragments and the total number of fragments, and then the actual fragment data is spliced. In this embodiment, by adding the first identifier corresponding to the number of fragment packages and the second identifier corresponding to the fragment sequence number of each fragment package to the target position of the corresponding fragment package, the information of the fragment package is clearer, and the reliability of message fragmentation is improved.
[0078] Step S24: Generate an integrity verification key based on the reference key, use the integrity verification key to encrypt each of the fragment packets, and send the encrypted fragment packets to the message responder.
[0079] In a specific implementation, after the base key SKEYID is generated, if the message fragment notification payload is an encrypted payload ciphertext, the payload itself and the fragment package are encrypted respectively, and each encrypted fragment package is sent to the message responder. It should be noted that the fragment package is both encrypted and integrity verified. If IKE fragmentation is not performed, when the original message needs to be encrypted and protected, the encryption protection rules of the national secret ISAKMP protocol are followed, that is, there is no need to verify the integrity of the fragment package. In this embodiment, the IKE fragment package is encrypted by the integrity verification key to ensure the integrity of the fragment information, and each encrypted fragment package is sent to the message responder, which improves the data security during the message transmission process.
[0080] In a specific implementation, the process of message segmentation is as follows: Figure 5As shown, the message initiator adds N (Fragment) notification payload after the SA payload of message 1 and sends it to the message responder; if the message responder disagrees, it will not send the payload, and the subsequent data packets will not be fragmented by IKE. If it agrees to perform IKE fragmentation, the same N (Fragment) payload will be added after the SA payload of message 2. If message 2 exceeds the MTU length, it will be fragmented in plain text, that is, no encryption and integrity check will be performed; for messages n and n+1, if the message length is less than MTU, IKE fragmentation will not be performed, otherwise fragmentation will be performed. If SKEYID is not generated, plain text fragmentation will be performed. If SKEYID has been generated, SKEYID will be used for key derivation to obtain encryption keys and integrity keys, and IKE ciphertext fragmentation will be performed, where SKF{} represents IKE ciphertext fragmentation.
[0081] In this embodiment, the generated reference key is used to encrypt the message during the key exchange process, thereby ensuring the reliability of the message transmission. By adding the first identifier corresponding to the number of fragment packages and the second identifier corresponding to the fragment sequence number of each fragment package to the target position of the corresponding fragment package, the information of the fragment package is made clearer, the reliability of the message fragmentation is improved, and the encrypted fragment packages are sent to the message responder, thereby improving the data security during the message transmission process.
[0082] Since the national secret ISAKMP protocol has serious security risks in the quantum computing environment, and the international IKEv2 protocol processing flow is complex, only the key exchange function is considered, and the post-quantum identity authentication function is not considered, for this reason, the present application provides a key exchange method, which constructs a security alliance payload by utilizing the post-quantum encapsulation algorithm, constructs a notification message by the security alliance payload, and exchanges keys through the notification message, so that the national secret ISAKMP protocol can achieve quantum security while having the security of the current public key cryptography, and at the same time, the reliability of the key exchange is ensured by constructing a second post-quantum key exchange notification and a second key exchange response to authenticate the identity between the message initiator and the message responder.
[0083] See also Figure 6 The embodiment of the present application discloses a key exchange method, which is applied to a message responder of an Internet security association and key management protocol, including:
[0084] Step S31, receiving a notification message sent by a message initiator, and sending a response message corresponding to the notification message to the message initiator according to the security association payload and the post-quantum key exchange notification payload in the notification message; the notification message is a message constructed by the message initiator based on the Internet Security Association and Key Management Protocol according to the security association payload and the corresponding post-quantum key exchange notification payload after the security association payload is constructed based on the post-quantum key encapsulation algorithm and the preset national secret algorithm.
[0085] Step S32, receiving a first post-quantum key exchange notification from the current message initiator, encrypting the corresponding temporary shared key using the post-quantum key encapsulation public key to generate a first post-quantum key ciphertext, and constructing a first key exchange response based on the first post-quantum key ciphertext and sending it to the message initiator; the first post-quantum key exchange notification is a message constructed and sent by the message initiator based on several post-quantum key encapsulation public keys determined according to the post-quantum key encapsulation algorithm.
[0086] Step S33, receiving the second post-quantum key exchange notification from the message initiator, encrypting the new temporary shared key with the new post-quantum key encapsulation public key to generate a second post-quantum key ciphertext, generating a second post-quantum signature result based on its own second post-quantum signature certificate and all temporary shared keys, and constructing a second key exchange response based on the second post-quantum key ciphertext, the second post-quantum signature certificate and the second post-quantum signature result and sending it to the message initiator; the second post-quantum key exchange notification is a message constructed and sent by the message initiator based on the new post-quantum key encapsulation public key, the first post-quantum signature certificate and the first post-quantum signature result after the message initiator determines the new post-quantum key encapsulation public key and its own first post-quantum signature certificate according to the post-quantum key encapsulation algorithm, and generates a first post-quantum signature result based on the first post-quantum signature certificate and all determined post-quantum key encapsulation public keys.
[0087] Step S34: Based on the Internet Security Association and Key Management Protocol, identity authentication is performed between itself and the message initiator according to the second post-quantum key exchange notification and the second key exchange response.
[0088] It can be seen that in the embodiment of the present application, by using the post-quantum encapsulation algorithm to construct a security association payload, constructing a notification message through the security association payload, and performing key exchange through the notification message, the Internet security association and key management protocol can achieve quantum security while having the security of existing public key cryptography, thereby solving the problem that current international protocols do not have quantum security; by constructing a second post-quantum key exchange notification and a second key exchange response to perform identity authentication between the message initiator and the message responder, the reliability of the key exchange is guaranteed.
[0089] See also Figure 7 As shown, the embodiment of the present application also discloses a key exchange device, which is applied to the message initiator of the Internet security association and key management protocol, including:
[0090] The first message construction module 11 is used to construct a security association payload based on a post-quantum key encapsulation algorithm and a preset national secret algorithm, and to construct a notification message according to the security association payload and the corresponding post-quantum key exchange notification payload based on the Internet security association and key management protocol, and to send the notification message to a message responder, so that the message responder returns a corresponding response message to the message initiator according to the security association payload and the post-quantum key exchange notification payload in the notification message;
[0091] A first notification construction module 12 is used to determine a number of post-quantum key encapsulation public keys according to the post-quantum key encapsulation algorithm, construct a corresponding first post-quantum key exchange notification based on each of the post-quantum key encapsulation public keys and send it to the message responder, so that the message responder receives the first post-quantum key exchange notification, uses the post-quantum key encapsulation public key to encrypt the corresponding temporary shared key to generate a first post-quantum key ciphertext, and constructs a first key exchange response according to the first post-quantum key ciphertext and sends it to the message initiator;
[0092] A second notification construction module 13 is used to determine a new post-quantum key encapsulation public key and its own first post-quantum signature certificate according to the post-quantum key encapsulation algorithm, generate a first post-quantum signature result based on the first post-quantum signature certificate and all determined post-quantum key encapsulation public keys, and construct a second post-quantum key exchange notification based on the new post-quantum key encapsulation public key, the first post-quantum signature certificate and the first post-quantum signature result, and send it to the message responder, so that the message responder receives the second post-quantum key exchange notification, encrypts the new temporary shared key with the new post-quantum key encapsulation public key to generate a second post-quantum key ciphertext, and generates a second post-quantum signature result based on its own second post-quantum signature certificate and all temporary shared keys, and constructs a second key exchange response based on the second post-quantum key ciphertext, the second post-quantum signature certificate and the second post-quantum signature result, and sends it to the message initiator;
[0093] The first identity authentication module 14 is used to perform identity authentication between itself and the message responder based on the Internet Security Association and Key Management Protocol according to the second post-quantum key exchange notification and the second key exchange response.
[0094] In some specific embodiments, the first message constructing module 11 may specifically include:
[0095] A payload construction unit, configured to construct a message fragment notification payload, and construct the notification message according to the security association payload, the post-quantum key exchange notification payload and the message fragment notification payload based on the Internet Security Association and Key Management Protocol, and send the notification message to the message responder, so that the message responder returns the corresponding response message to the message initiator according to the security association payload, the post-quantum key exchange notification payload and the message fragment notification payload in the notification message;
[0096] a data volume determination unit, configured to determine whether the message data volume of the first post-quantum key exchange notification is greater than the data transmission volume of a preset network maximum transmission unit, and if the message data volume is greater than the data transmission volume of the preset network maximum transmission unit, determine whether the reference key currently exists;
[0097] The ciphertext slicing submodule is used to slice the notification ciphertext based on the reference key if the reference key currently exists, and send the sliced notification ciphertext to the message responder.
[0098] In some specific implementations, the ciphertext sharding submodule may specifically include:
[0099] A ciphertext fragmentation unit, configured to fragment the notification ciphertext based on the reference key to obtain a plurality of fragmentation packets;
[0100] an identification adding unit, used to determine the number of fragment packets of the notification ciphertext and the fragment sequence number of each fragment packet, and respectively add a first identification corresponding to the number of fragment packets and a second identification corresponding to the fragment sequence number of each fragment packet to a target position of the corresponding fragment packet; the target position is a position after the message header of the fragment packet;
[0101] The fragment packet encryption unit is used to generate an integrity verification key based on the reference key, encrypt each of the fragment packets using the integrity verification key, and send the encrypted fragment packets to the message responder.
[0102] In some specific embodiments, the first notification constructing module 12 may specifically include:
[0103] A notification encryption unit, configured to construct the corresponding first post-quantum key exchange notification based on each of the post-quantum key encapsulation public keys, determine the current reference key of the message initiator, and encrypt the first post-quantum key exchange notification based on the reference key to obtain a notification ciphertext;
[0104] A ciphertext sending unit is used to send the notification ciphertext to the message responder, so that the message responder receives and decrypts the notification ciphertext to obtain the first post-quantum key exchange notification, and uses the post-quantum key encapsulation public key to encrypt the corresponding temporary shared key to generate the first post-quantum key ciphertext, and constructs the first key exchange response according to the first post-quantum key ciphertext and sends it to the message initiator.
[0105] See also Figure 8 As shown, the embodiment of the present application also discloses a key exchange device, which is applied to a message responder of an Internet security association and key management protocol, including:
[0106] The second message construction module 21 is used to receive the notification message sent by the message initiator, and send a response message corresponding to the notification message to the message initiator according to the security association payload and the post-quantum key exchange notification payload in the notification message; the notification message is a message constructed by the message initiator based on the Internet Security Association and Key Management Protocol according to the security association payload and the corresponding post-quantum key exchange notification payload after the security association payload is constructed based on the post-quantum key encapsulation algorithm and the preset national secret algorithm;
[0107] A first response construction module 22 is used to receive a first post-quantum key exchange notification from the current message initiator, encrypt the corresponding temporary shared key using the post-quantum key encapsulation public key to generate a first post-quantum key ciphertext, and construct a first key exchange response based on the first post-quantum key ciphertext and send it to the message initiator; the first post-quantum key exchange notification is a message constructed and sent by the message initiator based on a number of post-quantum key encapsulation public keys determined according to the post-quantum key encapsulation algorithm;
[0108] The second response construction module 23 is used to receive the second post-quantum key exchange notification of the message initiator, encrypt the new temporary shared key with the new post-quantum key encapsulation public key to generate a second post-quantum key ciphertext, generate a second post-quantum signature result based on its own second post-quantum signature certificate and all temporary shared keys, and construct a second key exchange response according to the second post-quantum key ciphertext, the second post-quantum signature certificate and the second post-quantum signature result and send it to the message initiator; the second post-quantum key exchange notification is a message constructed and sent by the message initiator according to the new post-quantum key encapsulation public key, the first post-quantum signature certificate and the first post-quantum signature result after the message initiator determines the new post-quantum key encapsulation public key and its own first post-quantum signature certificate according to the post-quantum key encapsulation algorithm, and generates a first post-quantum signature result based on the first post-quantum signature certificate and all determined post-quantum key encapsulation public keys;
[0109] The second identity authentication module 24 is used to perform identity authentication between itself and the message initiator based on the Internet Security Association and Key Management Protocol according to the second post-quantum key exchange notification and the second key exchange response.
[0110] Furthermore, the present application also discloses an electronic device. Fig. 9 This is a structural diagram of an electronic device 30 according to an exemplary embodiment. The content in the diagram cannot be regarded as any limitation on the scope of use of the present application.
[0111] Fig. 9 The present invention provides a schematic diagram of the structure of an electronic device 30 provided in an embodiment of the present application. The electronic device 30 may specifically include: at least one processor 31, at least one memory 32, a power supply 33, a communication interface 34, an input / output interface 35, and a communication bus 36. The memory 32 is used to store a computer program, which is loaded and executed by the processor 31 to implement the relevant steps in the key exchange method disclosed in any of the aforementioned embodiments. In addition, the electronic device 30 in this embodiment may specifically be an electronic computer.
[0112] In this embodiment, the power supply 33 is used to provide working voltage for each hardware device on the electronic device 30; the communication interface 34 can create a data transmission channel between the electronic device 30 and the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface 35 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs and is not specifically limited here.
[0113] In addition, the memory 32 as a carrier for storing resources may be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon may include an operating system 321, a computer program 322, etc., and the storage method may be temporary storage or permanent storage.
[0114] The operating system 321 is used to manage and control the hardware devices and computer programs 322 on the electronic device 30, which can be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program that can be used to complete the key exchange method performed by the electronic device 30 disclosed in any of the aforementioned embodiments, the computer program 322 can further include a computer program that can be used to complete other specific tasks.
[0115] Furthermore, the present application also discloses a computer-readable storage medium for storing a computer program; wherein the computer program, when executed by a processor, implements the aforementioned disclosed key exchange method. The specific steps of the method can refer to the corresponding contents disclosed in the aforementioned embodiments, and will not be repeated here.
[0116] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0117] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0118] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0119] Finally, 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 presence of other identical elements in the process, method, article or device including the elements.
[0120] The technical solution provided by the present application is introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for general technicians in this field, according to the idea of the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A key exchange method, characterized in that: Message initiators for Internet security association and key management protocols, including: Constructing a security association payload based on a post-quantum key encapsulation algorithm and a preset national secret algorithm, and constructing a notification message based on the security association payload and a corresponding post-quantum key exchange notification payload based on the Internet security association and key management protocol, and sending the notification message to a message responder, so that the message responder returns a corresponding response message to the message initiator according to the security association payload and the post-quantum key exchange notification payload in the notification message; Determine a plurality of post-quantum key encapsulation public keys according to the post-quantum key encapsulation algorithm, construct a corresponding first post-quantum key exchange notification based on each of the post-quantum key encapsulation public keys and send the notification to the message responder, so that the message responder receives the current first post-quantum key exchange notification, encrypts the corresponding temporary shared key using the post-quantum key encapsulation public key to generate a first post-quantum key ciphertext, and constructs a first key exchange response according to the first post-quantum key ciphertext and sends the response to the message initiator; Determine a new post-quantum key encapsulation public key and its own first post-quantum signature certificate according to the post-quantum key encapsulation algorithm, generate a first post-quantum signature result based on the first post-quantum signature certificate and all determined post-quantum key encapsulation public keys, and construct a second post-quantum key exchange notification based on the new post-quantum key encapsulation public key, the first post-quantum signature certificate and the first post-quantum signature result, and send it to the message responder, so that the message responder receives the second post-quantum key exchange notification, encrypts the new temporary shared key with the new post-quantum key encapsulation public key to generate a second post-quantum key ciphertext, and generates a second post-quantum signature result based on its own second post-quantum signature certificate and all temporary shared keys, and constructs a second key exchange response based on the second post-quantum key ciphertext, the second post-quantum signature certificate and the second post-quantum signature result, and sends it to the message initiator; Based on the Internet security association and key management protocol, identity authentication is performed between itself and the message responder according to the second post-quantum key exchange notification and the second key exchange response.
2. The key exchange method according to claim 1, characterized in that: Also includes: Collect all the temporary shared keys currently received by the message initiator, and generate a current reference key using the random number in the initial interaction message between the initiator and the responder and all the temporary shared keys currently received.
3. The key exchange method according to claim 2, characterized in that: The process of constructing a corresponding post-quantum key exchange notification based on each post-quantum key encapsulation public key and sending it to the message responder includes: Constructing the corresponding post-quantum key exchange notification based on each post-quantum key encapsulation public key, determining the current reference key of the message initiator, and encrypting the post-quantum key exchange notification based on the reference key to obtain a notification ciphertext; The notification ciphertext is sent to the message responder so that the message responder receives and decrypts the notification ciphertext to obtain the post-quantum key exchange notification, and uses the post-quantum key encapsulation public key to encrypt the corresponding temporary shared key to generate the post-quantum key ciphertext, and constructs the key exchange response according to the post-quantum key ciphertext and sends it to the message initiator.
4. The key exchange method according to claim 3, characterized in that: The constructing a notification message according to the security association payload and the corresponding post-quantum key exchange notification payload based on the Internet security association and key management protocol, and sending the notification message to a message responder, so that the message responder returns a corresponding response message to the message initiator according to the security association payload and the post-quantum key exchange notification payload in the notification message, includes: Constructing a message fragment notification payload, and constructing the notification message according to the security association payload, the post-quantum key exchange notification payload and the message fragment notification payload based on the Internet Security Association and Key Management Protocol, and sending the notification message to the message responder, so that the message responder returns the corresponding response message to the message initiator according to the security association payload, the post-quantum key exchange notification payload and the message fragment notification payload in the notification message; Accordingly, sending the notification ciphertext to the message responder includes: Determine whether the message data volume of the post-quantum key exchange notification is greater than the data transmission volume of a preset network maximum transmission unit, and if the message data volume is greater than the data transmission volume of the preset network maximum transmission unit, determine whether the reference key currently exists; If the base key currently exists, the notification ciphertext is fragmented based on the base key, and the fragmented notification ciphertext is sent to the message responder.
5. The key exchange method according to claim 4, characterized in that: The fragmenting the notification ciphertext based on the reference key and sending the fragmented notification ciphertext to the message responder includes: Slice the notification ciphertext based on the reference key to obtain a plurality of slice packets; Determine the number of fragment packets of the notification ciphertext and the fragment sequence number of each fragment packet, and respectively add a first identifier corresponding to the number of fragment packets and a second identifier corresponding to the fragment sequence number of each fragment packet to a target position of the corresponding fragment packet; the target position is a position after the message header of the fragment packet; An integrity verification key is generated based on the reference key, each of the fragment packets is encrypted using the integrity verification key, and each of the encrypted fragment packets is sent to the message responder.
6. A key exchange method, characterized in that: Message responders for Internet Security Association and Key Management Protocol, including: Receive a notification message sent by a message initiator, and send a response message corresponding to the notification message to the message initiator according to the security association payload and the post-quantum key exchange notification payload in the notification message; the notification message is a message constructed by the message initiator based on the Internet Security Association and Key Management Protocol according to the security association payload and the corresponding post-quantum key exchange notification payload after the security association payload is constructed based on the post-quantum key encapsulation algorithm and the preset national secret algorithm; Receive a first post-quantum key exchange notification from the current message initiator, encrypt the corresponding temporary shared key using the post-quantum key encapsulation public key to generate a first post-quantum key ciphertext, and construct a first key exchange response based on the first post-quantum key ciphertext and send it to the message initiator; the first post-quantum key exchange notification is a message constructed and sent by the message initiator based on a number of post-quantum key encapsulation public keys determined according to the post-quantum key encapsulation algorithm; Receive a second post-quantum key exchange notification from the message initiator, encrypt a new temporary shared key using a new post-quantum key encapsulation public key to generate a second post-quantum key ciphertext, generate a second post-quantum signature result based on its own second post-quantum signature certificate and all temporary shared keys, and construct a second key exchange response based on the second post-quantum key ciphertext, the second post-quantum signature certificate and the second post-quantum signature result and send it to the message initiator; the second post-quantum key exchange notification is a message constructed and sent by the message initiator based on the new post-quantum key encapsulation public key, the first post-quantum signature certificate and the first post-quantum signature result after the message initiator determines the new post-quantum key encapsulation public key and its own first post-quantum signature certificate according to the post-quantum key encapsulation algorithm, and generates a first post-quantum signature result based on the first post-quantum signature certificate and all determined post-quantum key encapsulation public keys; Based on the Internet Security Association and Key Management Protocol, identity authentication is performed between itself and the message initiator according to the second post-quantum key exchange notification and the second key exchange response.
7. A key exchange device, characterized in that: Message initiators for Internet security association and key management protocols, including: A first message construction module is used to construct a security association payload based on a post-quantum key encapsulation algorithm and a preset national secret algorithm, and to construct a notification message according to the security association payload and a corresponding post-quantum key exchange notification payload based on the Internet security association and key management protocol, and to send the notification message to a message responder, so that the message responder returns a corresponding response message to the message initiator according to the security association payload and the post-quantum key exchange notification payload in the notification message; A first notification construction module is used to determine a number of post-quantum key encapsulation public keys according to the post-quantum key encapsulation algorithm, construct a corresponding first post-quantum key exchange notification based on each of the post-quantum key encapsulation public keys, and send it to the message responder, so that the message responder receives the first post-quantum key exchange notification, uses the post-quantum key encapsulation public key to encrypt the corresponding temporary shared key to generate a first post-quantum key ciphertext, and constructs a first key exchange response according to the first post-quantum key ciphertext and sends it to the message initiator; a second notification construction module, configured to determine a new post-quantum key encapsulation public key and its own first post-quantum signature certificate according to the post-quantum key encapsulation algorithm, generate a first post-quantum signature result based on the first post-quantum signature certificate and all determined post-quantum key encapsulation public keys, and construct a second post-quantum key exchange notification based on the new post-quantum key encapsulation public key, the first post-quantum signature certificate and the first post-quantum signature result, and send the notification to the message responder, so that the message responder receives the second post-quantum key exchange notification, encrypts the new temporary shared key with the new post-quantum key encapsulation public key to generate a second post-quantum key ciphertext, and generates a second post-quantum signature result based on its own second post-quantum signature certificate and all temporary shared keys, and constructs a second key exchange response based on the second post-quantum key ciphertext, the second post-quantum signature certificate and the second post-quantum signature result, and sends the response to the message initiator; A first identity authentication module is used to perform identity authentication between itself and the message responder based on the Internet Security Association and Key Management Protocol according to the second post-quantum key exchange notification and the second key exchange response.
8. A key exchange device, characterized in that: Message responders for Internet Security Association and Key Management Protocol, including: A second message construction module is used to receive a notification message sent by a message initiator, and send a response message corresponding to the notification message to the message initiator according to the security association payload and the post-quantum key exchange notification payload in the notification message; the notification message is a message constructed by the message initiator based on the Internet Security Association and Key Management Protocol according to the security association payload and the corresponding post-quantum key exchange notification payload after the security association payload is constructed based on the post-quantum key encapsulation algorithm and the preset national secret algorithm; A first response construction module is used to receive a first post-quantum key exchange notification from the current message initiator, encrypt the corresponding temporary shared key using the post-quantum key encapsulation public key to generate a first post-quantum key ciphertext, and construct a first key exchange response based on the first post-quantum key ciphertext and send it to the message initiator; the first post-quantum key exchange notification is a message constructed and sent by the message initiator based on a number of post-quantum key encapsulation public keys determined according to the post-quantum key encapsulation algorithm; A second response construction module is used to receive a second post-quantum key exchange notification from the message initiator, encrypt a new temporary shared key using a new post-quantum key encapsulation public key to generate a second post-quantum key ciphertext, generate a second post-quantum signature result based on its own second post-quantum signature certificate and all temporary shared keys, and construct a second key exchange response based on the second post-quantum key ciphertext, the second post-quantum signature certificate and the second post-quantum signature result and send it to the message initiator; the second post-quantum key exchange notification is a message constructed and sent by the message initiator based on the new post-quantum key encapsulation public key, the first post-quantum signature certificate and the first post-quantum signature result after the message initiator determines the new post-quantum key encapsulation public key and its own first post-quantum signature certificate according to the post-quantum key encapsulation algorithm, and generates a first post-quantum signature result based on the first post-quantum signature certificate and all determined post-quantum key encapsulation public keys; A second identity authentication module is used to perform identity authentication between itself and the message initiator based on the Internet security association and key management protocol according to the second post-quantum key exchange notification and the second key exchange response.
9. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor, configured to execute the computer program to implement the key exchange method according to any one of claims 1 to 6.
10. A computer-readable storage medium, characterized in that: Used to store a computer program, which, when executed by a processor, implements the key exchange method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Communication data transmission method and device, equipment and storage medium
CN119011287A
Data transmission method, device, and storage medium
WO2024113724A1
Cited By
Communication session key negotiation method, device, equipment and medium
CN120658389A