A quantum computing method and device based on national secret technology

By introducing an anti-quantum computing payload into the key exchange protocol, transmitting the shared key ID and generating a SKEYID with anti-quantum computing capabilities, the security risk of the encryption algorithm in the national secret IPSEC VPN technology being cracked by quantum computers is solved, and data encryption is realized. Security and compatibility.

CN115473639BActive Publication Date: 2024-09-24NANJING SHOUCHUAN XINAN TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211114432.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-14
Publication Date
2024-09-24
Estimated Expiration
2042-09-14

AI Technical Summary

Technical Problem

The SM2 ECC encryption algorithm used in the existing national secret IPSEC VPN technology in ISAKMP SA may be cracked by quantum computers, resulting in security risks for VPN communication data.

Method used

The anti-quantum computing payload is introduced into the key exchange protocol, the key ID is encrypted through a symmetric encryption algorithm, and the shared key ID is transferred between the initiator and the responder to generate a SKEYID with anti-quantum computing capabilities, thereby enhancing encryption. The security of the key exchange protocol.

Benefits of technology

Without changing the quality of the original network and communication, it enhances the security of data encryption, provides anti-quantum computing functions, complies with relevant national security regulations, and maintains system compatibility.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115473639B
    Figure CN115473639B
Patent Text Reader

Abstract

The present invention discloses a quantum computing resistance method and device based on national secret technology, wherein the method applied to the initiator terminal includes: randomly selecting a group of keys to obtain a key ID corresponding thereto; performing standard key exchange negotiation; adding a quantum computing resistance load PPKi at the end of message 3, PPKi containing the encrypted key ID, and sending the modified message 3 to the responder; receiving message 4 sent by the responder, judging whether there is a quantum computing resistance load PPKr in message 4, if there is, obtaining the key ID in the message 4 load PPKr and judging whether it is the same as the key ID in PPKi, if the same, obtaining the key according to the key ID, and then calculating SKEYID, and using the calculated SKEYID for subsequent standard key exchange negotiation. On the basis of realizing national secret technology, the present invention adds quantum computing resistance function to ensure data encryption security.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of key exchange based on national secret technology, and in particular to a quantum computing method and device based on national secret technology. Background Art

[0002] The national secret IPSEC VPN technology includes an exchange phase, which mainly runs the key exchange protocol. The key exchange protocol is divided into two steps, ISAKMP SA and IPSec SA. The ultimate goal is to authenticate and generate and protect the shared policies and keys used for data communication between VPNs. With the continuous advancement and development of emerging technologies such as quantum computing, the national secret SM2 ECC encryption algorithm used in ISAKMP SA can theoretically be cracked using quantum computers. Assuming that VPN communication data is stored now, when the computing power of quantum computers reaches a certain performance, it will be able to crack and decrypt VPN communication data. Although the scientific and technological capabilities to build such a large quantum computer are not yet available, the potential safety risks of this technology have caused people to worry about its use. Summary of the invention

[0003] Purpose of the invention: The purpose of the present invention is to provide a quantum computing resistance method and device based on national secret technology, which adds quantum computing resistance function on the basis of realizing national secret IPSEC VPN technology, and can ensure data encryption security without changing the quality of the original network and communication.

[0004] Technical solution: The quantum-resistant computing method based on national secret technology of the present invention is applied to the initiator terminal; the initiator terminal is pre-set with several groups of keys and key IDs, and the key IDs correspond to the keys one by one; the computing method includes the following steps:

[0005] S11: Randomly select a group of keys and obtain the corresponding key ID;

[0006] S12: Perform standard key exchange negotiation;

[0007] S13: Add a quantum computing resistant payload PPKi at the end of message 3 of the key exchange protocol. The modified message 3 is represented as: HDR, XCHi, SIGi, PPKi. The PPKi includes the key ID encrypted by the symmetric encryption algorithm. The modified message 3 is sent to the responder.

[0008] S14: Receive message 4 sent by the responder, determine whether there is a quantum computing-resistant payload PPKr in message 4, if yes, execute S15, if not, process message 4 according to the standard key exchange negotiation;

[0009] S15: Use a symmetric decryption algorithm to decrypt the quantum computing payload PPKr to obtain the key ID, and determine whether the key ID in PPKr is the same as the key ID in PPKi. If they are the same, execute S16. If they are not the same, the negotiation fails and the connection between the initiator and the responder is disconnected;

[0010] S16: Get the key according to the key ID, and then calculate SKEYID, SKEYID = PRF (PRF (KEY, Ni_b | Nr_b), CKY-I | CKY-R);

[0011] S17: Use the SKEYID calculated in S16 to perform subsequent standard key exchange negotiation.

[0012] To further improve the above technical solution, the key ID encrypted by the symmetric encryption algorithm in S13 is Symmetric_Encrypt (key ID, Ski), the symmetric encryption algorithm adopts CBC mode, the initialization vector IV uses the last group of ciphertext of the initiator's identification payload IDi, and the key ID is padded before encryption so that the key ID length is equal to a multiple of 16, and the values ​​of all padding bytes are 0 except the last byte, and the value of the last byte is the number of padding bytes excluding itself.

[0013] Furthermore, the anti-quantum payload PPKi is a custom payload, and the type value is selected from 129 to 255.

[0014] Furthermore, the format of the quantum-resistant payload PPKi includes a header and a body, the header field includes the next payload, reserved, and payload length, the next payload field is 1 byte long and its content is set to 0, the reserved field is 1 byte long and its content is set to 0, the payload length field is 2 bytes long and its content is the length of the entire payload; the body field includes a key ID, the length of the key ID field is variable, and its content is the encrypted key ID data.

[0015] At the same time, the present invention also provides a quantum-resistant computing method based on national secret technology applied to a responder terminal; the responder terminal is pre-set with several groups of keys and key IDs shared with the initiator, and the key ID corresponds to the key one by one; the computing method comprises the following steps:

[0016] S21: Perform standard key exchange negotiation;

[0017] S22: Receive message 3 sent by the initiator, determine whether there is an anti-quantum computing payload PPKi in message 3, if yes, execute S23, if not, process message 3 according to the standard key exchange negotiation;

[0018] S23: Use a symmetric decryption algorithm to decrypt the quantum computing payload PPKi to obtain a key ID, and determine whether the key ID in PPKi is one of the preset key IDs. If so, execute S24. If not, the negotiation fails and the connection between the responder and the initiator is disconnected.

[0019] S24: Add a quantum computing resistant payload PPKr to the end of message 4 of the key exchange protocol. The modified message 4 is represented as: HDR, XCHr, SIGr, PPKr. The PPKr contains a key ID encrypted by a symmetric encryption algorithm, and the key ID selected by the PPKr is the same as the key ID in the PPKi. The modified message 4 is sent to the initiator.

[0020] S25: Get the key according to the key ID, and then calculate SKEYID, SKEYID = PRF (PRF (KEY, Ni_b | Nr_b), CKY-I | CKY-R);

[0021] S26: Use the SKEYID calculated in S25 to perform subsequent standard key exchange negotiation.

[0022] To further improve the above technical solution, the key ID encrypted by the symmetric encryption algorithm in S13 is Symmetric_Encrypt (key ID, Skr), the symmetric encryption algorithm adopts CBC mode, the initialization vector IV uses the last group of ciphertext of the responder's identification payload IDr, and the key ID is padded before encryption so that the key ID length is equal to a multiple of 16, and the values ​​of all padding bytes are 0 except the last byte, and the value of the last byte is the number of padding bytes excluding itself.

[0023] Furthermore, the quantum-resistant payload PPKr is a custom payload, and the type value is selected from 129 to 255;

[0024] Furthermore, the format of the quantum-resistant payload PPKr includes a header and a body, the header field includes the next payload, reserved, and payload length, the next payload field length is 1 byte, and the content is set to 0, the reserved field length is 1 byte, and the content is set to 0, the payload length field length is 2 bytes, and the content is the length of the entire payload; the body field includes a key ID, the length of the key ID field is variable, and the content is the encrypted key ID data.

[0025] The present invention provides an electronic device, comprising: a processor and a memory storing a computer program, wherein the processor is configured to implement the steps of the above-mentioned anti-quantum computing method based on national encryption technology by executing the computer program. The electronic device is a hardware gateway product that can ensure the security of enterprise boundary data transmission.

[0026] Beneficial effect: Compared with the prior art, the advantages of the present invention are: the method provided by the present invention adds an additional set of shared keys in the key exchange protocol, transmits the shared key ID between the initiator and the responder, and then mixes the shared key into the generation process of the basic key parameter SKEYID, thereby providing the ability to resist quantum computing for the subsequent SA key generation. The present invention adds the anti-quantum computing function on the basis of realizing the national secret IPSEC VPN technology, which can ensure the security of data encryption without changing the quality of the original network and communication, and will not increase the repeated investment of users. At the same time, the cryptographic algorithm and technology are independently controllable and meet the relevant national security standards and requirements.

[0027] At the same time, the present invention provides an electronic device for implementing the above method, which is a hardware gateway product that can ensure the security of enterprise boundary data transmission. When implementing the above method, the original key exchange protocol is modified as little as possible so that compatible devices that do not support the modifications of the present invention can also correctly access the modified devices, thereby maintaining the system compatibility. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] Figure 1 It is a flow chart of the quantum-resistant computing method based on national secret technology applied to the initiator's terminal;

[0029] Figure 2 It is a flow chart of the anti-quantum computing method based on national encryption technology applied to the responder terminal. DETAILED DESCRIPTION

[0030] The technical solution of the present invention is described in detail below with reference to the accompanying drawings, but the protection scope of the present invention is not limited to the embodiments.

[0031] Embodiment 1:

[0032] The symbols used in the present invention are as follows:

[0033] HDR: an ISAKMP header;

[0034] IDi: the initiator's identification payload;

[0035] IDr: the identifier of the responder;

[0036] Ni_b: the main body of the initiator's nonce payload;

[0037] Nr_b: the body of the responder's nonce payload;

[0038] CKY-I: The initiator's cookie in the ISAKMP header;

[0039] CKY-R: The responder's cookie in the ISAKMP header;

[0040] Symmetric_Encrypt(msg, key): uses a symmetric algorithm to encrypt the message msg with the key key;

[0041] PRF(key, msg): Use the key key to calculate the data summary of the message msg.

[0042] The workflow of the present invention is as follows:

[0043] 1) Preset several groups of shared keys in the initiator terminal and the responder terminal, and generate key IDs accordingly. The key IDs correspond to the keys one by one.

[0044] 2) The initiator randomly selects a set of keys, obtains the key ID, adds the anti-quantum computing payload PPKi to the end of the key exchange protocol message 3, and uses the Ski temporary key to encrypt the key ID and send it.

[0045] 3) The responder reads the PPKi payload of the initiator. If the responder also supports quantum computing resistance, it sends the same key ID, adds a quantum computing resistance payload PPKr in the key exchange protocol message 4, encrypts the key ID with the Skr temporary key and sends it. If it does not support it, no custom payload is added and standard key negotiation is performed.

[0046] 4) The initiator reads the PPKr payload of the responder. If the key ID of the PPKr payload is consistent with the key ID of the PPKi payload, the negotiation is successful; otherwise, the negotiation fails and the connection is disconnected.

[0047] 5) The initiator and responder obtain the key (KEY) according to their respective key IDs, and then calculate SKEYID =PRF(PRF(KEY, Ni_b|Nr_b), CKY-I|CKY-R).

[0048] 6) The subsequent negotiation method is the same as the national IPSEC VPN technical specification.

[0049] Example 2: Figure 1 As shown, the anti-quantum computing method based on national secret technology is applied to the initiator terminal. The initiator terminal is preset with several groups of keys and key IDs. The key ID corresponds to the key one by one. The computing method applied to the initiator terminal includes the following steps:

[0050] S11: Randomly select a group of keys and obtain the corresponding key ID;

[0051] S12: Perform standard key exchange negotiation;

[0052] S13: Add a quantum computing resistant payload PPKi at the end of message 3 of the key exchange protocol. The modified message 3 is represented as: HDR, XCHi, SIGi, PPKi. The PPKi includes the key ID encrypted by the symmetric encryption algorithm. The modified message 3 is sent to the responder.

[0053] S14: Receive message 4 sent by the responder, determine whether there is a quantum computing-resistant payload PPKr in message 4, if yes, execute S15, if not, process message 4 according to the standard key exchange negotiation;

[0054] S15: Obtain the key ID in the payload PPKr of message 4 and determine whether it is the same as the key ID in PPKi. If they are the same, execute S16. If they are not the same, the negotiation fails and the connection between the initiator and the responder is disconnected.

[0055] S16: Get the key according to the key ID, and then calculate SKEYID, SKEYID = PRF (PRF (KEY, Ni_b | Nr_b), CKY-I | CKY-R);

[0056] S17: Use the SKEYID calculated in S16 to perform subsequent standard key exchange negotiation.

[0057] The modified key exchange protocol message 3 is as follows: HDR, XCHi, SIGi, PPKi; where PPKi contains the key ID encrypted using the symmetric encryption algorithm, key ID = Symmetric_Encrypt (key ID, Ski). The symmetric encryption operation uses the CBC mode, and the initialization vector IV uses the last set of ciphertexts of the IDi payload; padding should be performed before encryption so that the key ID length is equal to a multiple of 16 (SM1, SM4 algorithm). The values ​​of all padding bytes are 0 except the last byte, and the value of the last byte is the number of padding bytes excluding itself.

[0058] The anti-quantum computing payload PPKi is used to communicate between the initiator and responder of the key exchange whether the anti-quantum computing function is supported, and if supported, the key ID used for anti-quantum computing. This payload is a custom payload, and the type value can be selected from 129 to 255. The format of the anti-quantum computing payload is as follows.

[0059] sheet Format for quantum-resistant payloads

[0060]

[0061] Next Payload: The length of this field is 1 byte. Since it is the last payload, it should be set to 0. Reserved: The length of this field is 1 byte and its content should be 0. Payload Length: The length of this field is 2 bytes. It indicates the length of the entire payload in bytes. Key ID: The length of this field is variable and its content is the encrypted key ID data.

[0062] Example 3: Figure 2 As shown, the anti-quantum computing method based on national secret technology is applied to the responder terminal. The responder terminal is preset with several groups of keys and key IDs shared with the initiator. The key ID corresponds to the key one by one. The computing method applied to the responder terminal includes the following steps:

[0063] S21: Perform standard key exchange negotiation;

[0064] S22: Receive message 3 sent by the initiator, determine whether there is an anti-quantum computing payload PPKi in message 3, if yes, execute S23, if not, process message 3 according to the standard key exchange negotiation;

[0065] S23: Obtain the key ID in the payload PPKi of message 3, and determine whether the key ID is one of the preset key IDs. If so, execute S24; if not, the negotiation fails, and the connection between the responder and the initiator is disconnected;

[0066] S24: Add a quantum computing resistant payload PPKr to the end of message 4 of the key exchange protocol. The modified message 4 is represented as: HDR, XCHr, SIGr, PPKr, PPKr includes a key ID encrypted by a symmetric encryption algorithm, and the key ID selected by PPKr is the same as the key ID in the PPKi. Send the modified message 4 to the initiator;

[0067] S25: Get the key according to the key ID, and then calculate SKEYID, SKEYID = PRF (PRF (KEY, Ni_b | Nr_b), CKY-I | CKY-R);

[0068] S26: Use the SKEYID calculated in S25 to perform subsequent standard key exchange negotiation.

[0069] The modified key exchange protocol message 4 is represented as follows: HDR, XCHr, SIGr, PPKr; where the key ID in PPKr = Symmetric_Encrypt(key ID, Skr). The symmetric encryption operation adopts CBC mode, and the initialization vector IV uses the last set of ciphertexts of the IDr payload. Padding should be performed before encryption so that the key ID length is equal to a multiple of 16 (SM1, SM4 algorithm). The values ​​of all padding bytes are 0 except the last byte, and the value of the last byte is the number of padding bytes excluding itself.

[0070] The anti-quantum computing payload PPKr is used to transmit whether the anti-quantum computing function is supported between the initiator and the responder of the key exchange, and if supported, the key ID used for anti-quantum computing. The specific format of the anti-quantum computing payload PPKr is the same as the format of the anti-quantum computing payload PPKi in Example 2.

[0071] Embodiment 4: This embodiment further provides an electronic device, including a processor and a memory, wherein the memory is used to store a computer program, wherein the processor is configured to implement the anti-quantum computing method based on national secret technology in any of the above embodiments by executing the computer program.

[0072] The electronic device provided by the present invention is a hardware gateway product that can ensure the security of data transmission at the enterprise boundary. On the basis of realizing the national secret IPSEC VPN technology, it adds anti-quantum computing function, ensures that the quality of the original network and communication is not changed, and at the same time ensures the security of data encryption, and will not increase the user's repeated investment. At the same time, the cryptographic algorithm and technology are independently controllable and meet the relevant national security standards and requirements.

[0073] As described above, although the present invention has been shown and described with reference to specific preferred embodiments, it should not be construed as limiting the present invention itself. Various changes in form and details may be made without departing from the spirit and scope of the present invention as defined in the appended claims.

Claims

1. A quantum computing method based on national secret technology, applied to the initiator terminal; characterized in that: The initiator terminal is pre-set with several groups of keys and key IDs, and the key IDs correspond to the keys one by one; the calculation method comprises the following steps: S11: Randomly select a group of keys and obtain the corresponding key ID; S12: Perform standard key exchange negotiation; S13: Add a quantum computing resistant payload PPKi at the end of message 3 of the key exchange protocol. The modified message 3 is represented as: HDR, XCHi, SIGi, PPKi. The PPKi includes the key ID encrypted by the symmetric encryption algorithm. The modified message 3 is sent to the responder. S14: Receive message 4 sent by the responder, determine whether there is a quantum computing-resistant payload PPKr in message 4, if yes, execute S15, if not, process message 4 according to the standard key exchange negotiation; S15: Use a symmetric decryption algorithm to decrypt the quantum computing payload PPKr to obtain the key ID, and determine whether the key ID in PPKr is the same as the key ID in PPKi. If they are the same, execute S16. If they are not the same, the negotiation fails and the connection between the initiator and the responder is disconnected; S16: Get the key KEY according to the key ID, and then calculate SKEYID, SKEYID = PRF(PRF(KEY, Ni_b|Nr_b), CKY-I|CKY-R); where Ni_b is the main body of the initiator's nonce payload, Nr_b is the main body of the responder's nonce payload, CKY-I is the initiator's cookie in the ISAKMP header, and CKY-R is the responder's cookie in the ISAKMP header; PRF(key, msg): Use the key key to calculate the data summary of the message msg; S17: Use the SKEYID calculated in S16 to perform subsequent standard key exchange negotiation.

2. The anti-quantum computing method based on national secret technology according to claim 1 is characterized in that: The key ID encrypted by the symmetric encryption algorithm in S13 is Symmetric_Encrypt (key ID, Ski). The symmetric encryption algorithm adopts CBC mode. The initialization vector IV uses the last ciphertext of the initiator's identification payload IDi. Before encryption, the key ID is padded so that the key ID length is equal to a multiple of 16. The values ​​of all padding bytes are 0 except the last byte. The value of the last byte is the number of padding bytes excluding itself.

3. The anti-quantum computing method based on national secret technology according to claim 1 is characterized in that: The anti-quantum computing payload PPKi is a custom payload, and the type value is selected from 129 to 255.

4. The anti-quantum computing method based on national secret technology according to claim 3 is characterized in that: The format of the anti-quantum computing payload PPKi includes a header and a body. The header field includes the next payload, reserved, and payload length. The next payload field is 1 byte long and its content is set to 0. The reserved field is 1 byte long and its content is set to 0. The payload length field is 2 bytes long and its content is the length of the entire payload. The body field includes a key ID. The length of the key ID field is variable and its content is the encrypted key ID data.

5. A quantum computing method based on national secret technology, applied to the responder terminal; characterized in that: The responder terminal is pre-set with several groups of keys and key IDs shared with the initiator, and the key IDs correspond to the keys one by one; the calculation method comprises the following steps: S21: Perform standard key exchange negotiation; S22: Receive message 3 sent by the initiator, determine whether there is an anti-quantum computing payload PPKi in message 3, if yes, execute S23, if not, process message 3 according to the standard key exchange negotiation; S23: Use a symmetric decryption algorithm to decrypt the quantum computing payload PPKi to obtain a key ID, and determine whether the key ID in PPKi is one of the preset key IDs. If so, execute S24. If not, the negotiation fails and the connection between the responder and the initiator is disconnected. S24: Add a quantum computing resistant payload PPKr to the end of message 4 of the key exchange protocol. The modified message 4 is represented as: HDR, XCHr, SIGr, PPKr. The PPKr contains a key ID encrypted by a symmetric encryption algorithm, and the key ID selected by the PPKr is the same as the key ID in the PPKi. The modified message 4 is sent to the initiator. S25: Get the key KEY according to the key ID, and then calculate SKEYID, SKEYID = PRF(PRF(KEY, Ni_b|Nr_b), CKY-I|CKY-R); where Ni_b is the main body of the initiator's nonce payload, Nr_b is the main body of the responder's nonce payload, CKY-I is the initiator's cookie in the ISAKMP header, and CKY-R is the responder's cookie in the ISAKMP header; PRF(key, msg): Use the key key to calculate the data summary of the message msg; S26: Use the SKEYID calculated in S25 to perform subsequent standard key exchange negotiation.

6. The anti-quantum computing method based on national secret technology according to claim 5 is characterized in that: The key ID encrypted by the symmetric encryption algorithm in S13 is Symmetric_Encrypt (key ID, Skr). The symmetric encryption algorithm adopts CBC mode. The initialization vector IV uses the last set of ciphertext of the responder's identification payload IDr. Before encryption, the key ID is padded so that the key ID length is equal to a multiple of 16. The values ​​of all padding bytes are 0 except the last byte. The value of the last byte is the number of padding bytes excluding itself.

7. The anti-quantum computing method based on national secret technology according to claim 5 is characterized in that: The anti-quantum computing payload PPKr is a custom payload, and the type value is selected from 129 to 255.

8. The anti-quantum computing method based on national secret technology according to claim 7 is characterized in that: The format of the quantum computing resistant payload PPKr includes a header and a body, wherein the header field includes the next payload, reserved, and payload length. The next payload field is 1 byte long and its content is set to 0. The reserved field is 1 byte long and its content is set to 0. The payload length field is 2 bytes long and its content is the length of the entire payload. The body field includes a key ID, the length of the key ID field is variable, and its content is the encrypted key ID data.

9. An electronic device, characterized in that: include: a processor and a memory for storing a computer program; The processor is configured to implement the steps of the method according to any one of claims 1 to 8 by executing the computer program.