A key agreement method based on a post-quantum and national secret hybrid algorithm
Patent Information
- Application Number
- CN202511628062.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-07
- Publication Date
- 2026-10-30
- Estimated Expiration
- 2045-11-07
AI Technical Summary
当前主流的IPSec依赖的传统公钥密码算法,在量子计算机强大的计算能力面前,面临被破解的巨大风险,一旦现有密码体系被攻破,基于IPSec构建的网络通信安全将荡然无存,敏感信息会大量泄露
本申请实施例提供一种基于后量子和国密混合算法的密钥协商方法,应用于发起方,该方法包括:在密钥协商的各阶段,向响应方发送各阶段的第一消息,各阶段的第一消息包括:各阶段的第一载荷消息,各阶段的第一载荷消息包括:模式指示信息用于指示发起方在各阶段是否支持量子协商模式;各阶段的第一载荷消息用于使得响应方在各阶段确定发起方支持量子协商模式时,向量子密钥分发QKD系统获取各阶段的量子密钥;接收响应方发送的各阶段的第二消息,各阶段的第二消息包括:各阶段的第二载荷消息,各阶段的第二载荷消息包括:各阶段的量子密钥的信息;根据各阶段的量子密钥的信息,向QKD系统获取各阶段的量子密钥;采用预设后量子算法,生成各阶段的后量子共享密钥以及后量子共享密钥的封装信息;获取各阶段的临时共享密钥,并采用预设国密算法产生临时共享密钥的国密密文;向响应方发送各阶段的第三消息,各阶段的第三消息包括:各阶段的第三载荷消息,各阶段的第三载荷消息包括:各阶段的后量子共享密钥的封装信息和国密密文,各阶段的第三载荷消息用于使得响应方对各阶段的后量子共享密钥的封装信息和国密密文进行解密,得到各阶段的后量子共享密钥和临时共享密钥,并根据各阶段的量子密钥、后量子共享密钥和临时共享密钥生成响应方在各阶段的协商密钥;根据各阶段的量子密钥、后量子共享密钥和临时共享密钥,生成发起方在各阶段的协商密钥。
Smart Images

Figure CN121239408B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of cryptographic application technology, and more specifically, to a key negotiation method based on a hybrid algorithm of post-quantum and Chinese cryptography. Background Technology
[0002] In today's increasingly complex cybersecurity landscape and with the rapid development of quantum computing technology, the application of post-quantum algorithms and quantum keys in IPSec is urgently needed. The traditional public-key cryptographic algorithms currently relied upon by mainstream IPSec face a significant risk of being cracked by the powerful computing capabilities of quantum computers. Once the existing cryptographic system is compromised, the security of network communications built on IPSec will be completely lost, and a large amount of sensitive information will be leaked. Post-quantum algorithms and quantum keys, based on the principles of quantum mechanics, can effectively resist quantum computing attacks, providing more reliable security guarantees for IPSec and ensuring that network communications maintain confidentiality, integrity, and authenticity in the quantum era. Summary of the Invention
[0003] The purpose of this invention is to address the shortcomings of the prior art by providing a key negotiation method based on a hybrid algorithm of post-quantum and national cryptographic algorithms. This method integrates post-quantum algorithms and a quantum key distribution system to ensure the security of the IKE protocol during the key negotiation phase and prevent the key from being cracked.
[0004] To achieve the above objectives, the technical solutions adopted in the embodiments of this application are as follows: In a first aspect, embodiments of this application provide a key negotiation method based on a hybrid algorithm of post-quantum and national cryptography, applied to the initiator, the method comprising: At each stage of key negotiation, a first message for each stage is sent to the responder. The first message for each stage includes: a first payload message for each stage, which includes: mode indication information for indicating whether the initiator supports the quantum negotiation mode at each stage; the first payload message for each stage is used to enable the responder to obtain the quantum key for each stage from the quantum key distribution (QKD) system when the responder determines that the initiator supports the quantum negotiation mode at each stage. The responder receives the second messages for each stage, each second message including: the second payload message for each stage, each second payload message including: information about the quantum key for each stage; Based on the quantum key information of each stage, obtain the quantum key of each stage from the QKD system; A preset post-quantum algorithm is used to generate the post-quantum shared key for each stage and the encapsulation information of the post-quantum shared key; Obtain the temporary shared key for each stage, and generate the national cryptographic ciphertext of the temporary shared key using a preset national cryptographic algorithm; The responder sends a third message for each stage, the third message for each stage including: a third payload message for each stage, the third payload message for each stage including: encapsulation information of the post-quantum shared key and the national cryptographic ciphertext for each stage, the third payload message for each stage being used to enable the responder to decrypt the encapsulation information of the post-quantum shared key and the national cryptographic ciphertext for each stage to obtain the post-quantum shared key and the temporary shared key for each stage, and generate the negotiated key for the responder in each stage based on the quantum key, the post-quantum shared key and the temporary shared key for each stage; Based on the quantum key, the post-quantum shared key, and the temporary shared key of each stage, the initiator generates the negotiation key for each stage.
[0005] In an optional implementation, the step of using a preset post-quantum algorithm to generate the post-quantum shared key for each stage and the encapsulation information of the post-quantum shared key includes: By employing the encapsulation algorithm in the preset post-quantum algorithm and combining it with the preset post-quantum public key in the preset hybrid public key of each stage, the post-quantum shared key and the encapsulation information of the post-quantum shared key in each stage are determined. The step of obtaining the temporary shared key for each stage and generating the national cryptographic ciphertext of the temporary shared key using a preset national cryptographic algorithm includes: Obtain the temporary shared key for each stage, and encrypt the temporary shared key for each stage using the national cryptographic public key in the preset mixed public key for each stage, and use the national cryptographic encryption algorithm in the preset national cryptographic algorithm to obtain the national cryptographic ciphertext for each stage.
[0006] In an optional implementation, generating the initiator's negotiation key for each stage based on the quantum key, the post-quantum shared key, and the temporary shared key at each stage includes: The post-quantum shared key and the temporary shared key at each stage are XORed to obtain the initiator's shared key at each stage. Based on the quantum keys of each stage and the shared key of the initiator, the negotiation key of the initiator in each stage is generated.
[0007] In an optional implementation, each stage includes: a first stage; the negotiation key for the first stage is a working key; The method further includes: The authentication key and encryption key of the working key of the initiator in the first stage are determined based on the working key of the initiator in the first stage.
[0008] In an optional implementation, each stage includes: a second stage; the negotiation key for the second stage is a session key; The step of generating the negotiation key for the initiator at each stage based on the quantum key at each stage and the initiator's shared key includes: Based on the quantum key and the shared key of the initiator in the first stage, the working key of the initiator in the first stage is generated; Based on the initiator's working key in the first phase, the quantum key, and the initiator's shared key, a session key for the initiator in the second phase is generated.
[0009] Secondly, embodiments of this application also provide a key negotiation method based on a hybrid algorithm of post-quantum and national cryptography, applied to the responder, the method comprising: In each stage of key negotiation, the initiator sends a first message for each stage, the first message for each stage including: the first payload message for each stage, the first payload message for each stage including: mode indication information for indicating whether the initiator supports quantum negotiation mode in each stage; When the responder determines that the initiator supports the quantum negotiation mode at each stage, the responder obtains the quantum key for each stage from the quantum key distribution (QKD) system. The system sends second messages for each stage to the initiator, each second message including a second payload message for each stage, the second payload message including information about the quantum key for each stage; the second payload message for each stage is used to enable the initiator to obtain the quantum key for each stage from the QKD system based on the information about the quantum key for each stage; a preset post-quantum algorithm is used to generate the post-quantum shared key for each stage and the encapsulation information of the post-quantum shared key; a preset national cryptographic algorithm is used to generate the temporary shared key for each stage and the national cryptographic ciphertext of the temporary shared key; and based on the quantum key, the post-quantum shared key, and the temporary shared key for each stage, the system generates the negotiation key for the initiator in each stage; Receive the third message of each stage sent by the initiator, the third message of each stage includes: the third payload message of each stage, the third payload message of each stage includes: the encapsulation information of the post-quantum shared key of each stage and the national cryptographic ciphertext; The encapsulation information of the post-quantum shared key and the national cryptographic ciphertext at each stage are decrypted to obtain the post-quantum shared key and the temporary shared key at each stage; The respondent generates the negotiation key for each stage based on the quantum key, the post-quantum shared key, and the temporary shared key.
[0010] In an optional implementation, the step of decrypting the encapsulation information of the post-quantum shared key and the national cryptographic ciphertext at each stage to obtain the post-quantum shared key and the temporary shared key at each stage includes: Using the decapsulation algorithm in the preset post-quantum algorithm, the encapsulation information of the post-quantum shared key in each stage is decapsulated according to the preset post-quantum private key in the preset hybrid private key in each stage, so as to obtain the post-quantum shared key in each stage. The national cryptographic algorithm is used to decrypt the national cryptographic ciphertext according to the national cryptographic private key in the preset mixed private key of each stage, so as to obtain the temporary shared key of each stage.
[0011] In an optional implementation, generating the negotiated key for the responder at each stage based on the quantum key, the post-quantum shared key, and the temporary shared key at each stage includes: The post-quantum shared key and the temporary shared key at each stage are XORed to obtain the responder's shared key at each stage. Based on the quantum keys of each stage and the shared key of the responder, the negotiation key of the responder in each stage is generated.
[0012] In an optional implementation, each stage includes: a first stage; the negotiation key for the first stage is a working key; The method further includes: Based on the responder's working key in the first phase, determine the authentication key and the encryption key of the responder's working key in the first phase.
[0013] In an optional implementation, each stage includes: a second stage; the negotiation key for the second stage is a session key; The step of generating the negotiated key for the responder at each stage based on the quantum key at each stage and the responder's shared key includes: Based on the quantum key and the shared key of the responder in the first stage, the working key of the responder in the first stage is generated; Based on the responder's working key in the first phase, the quantum key, and the responder's shared key, a session key for the responder in the second phase is generated.
[0014] The beneficial effects of this application are: This application provides a key negotiation method based on a hybrid algorithm of post-quantum and national cryptography, applied to the initiator. The method includes: sending a first message for each stage of key negotiation to the responder, each first message including a first payload message for each stage, the first payload message including mode indication information to indicate whether the initiator supports the quantum negotiation mode at each stage; the first payload message for each stage enabling the responder to obtain the quantum key for each stage from the quantum key distribution (QKD) system when the responder determines that the initiator supports the quantum negotiation mode at each stage; receiving a second message for each stage sent by the responder, each second message including a second payload message for each stage, the second payload message including information about the quantum key for each stage; obtaining the quantum key for each stage from the QKD system based on the quantum key information for each stage; and using a preset... The post-quantum algorithm generates post-quantum shared keys and their encapsulation information for each stage; it obtains temporary shared keys for each stage and generates national cryptographic ciphertext for the temporary shared keys using a preset national cryptographic algorithm; it sends third messages for each stage to the responder, each third message including: a third payload message for each stage, which includes: encapsulation information of the post-quantum shared keys and national cryptographic ciphertext for each stage. The third payload message for each stage enables the responder to decrypt the encapsulation information and national cryptographic ciphertext of the post-quantum shared keys for each stage, obtaining the post-quantum shared keys and temporary shared keys for each stage, and generates the responder's negotiation key for each stage based on the quantum keys, post-quantum shared keys, and temporary shared keys for each stage; and it generates the initiator's negotiation key for each stage based on the quantum keys, post-quantum shared keys, and temporary shared keys for each stage.
[0015] The method in this application integrates a post-quantum algorithm and a quantum key distribution system. On the one hand, the post-quantum algorithm is designed based on mathematical problems that are difficult to solve in quantum computing, which can resist potential attacks from quantum computers, ensure the security of the IKE protocol during the key negotiation phase, prevent the key from being cracked, and ensure that the subsequent communication content between the two parties is not stolen. The combination of the post-quantum algorithm and the national cryptographic algorithm can provide double protection for the national cryptographic algorithm while ensuring quantum resistance. On the other hand, quantum keys are generated using quantum state properties and have unconditional security. Their non-cloning and measurement collapse properties can prevent man-in-the-middle attacks and eavesdropping. Combined with the post-quantum algorithm, it can provide double security protection for IKE negotiation key calculation, greatly improve the security and reliability of network communication, and effectively safeguard information security in cyberspace. Attached Figure Description
[0016] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0017] Figure 1 One of the flowcharts for a key negotiation method based on a hybrid algorithm of post-quantum and national cryptography provided in this application embodiment; Figure 2 A second schematic flowchart illustrating a key negotiation method based on a hybrid post-quantum and national cryptographic algorithm provided for embodiments of this application; Figure 3 The third flowchart illustrates a key negotiation method based on a hybrid algorithm of post-quantum and national cryptography provided for embodiments of this application; Figure 4 The fourth flowchart illustrates a key negotiation method based on a hybrid post-quantum and national cryptographic algorithm provided for embodiments of this application. Figure 5 The fifth flowchart illustrates a key negotiation method based on a hybrid post-quantum and national cryptographic algorithm provided for embodiments of this application. Figure 6 A schematic diagram of a key negotiation method based on a hybrid algorithm of post-quantum and national cryptography provided for embodiments of this application (Figure 6). Figure 7 The seventh flowchart illustrates a key negotiation method based on a hybrid post-quantum and national cryptographic algorithm provided for embodiments of this application. Figure 8 A schematic diagram of the functional modules of a key negotiation device based on a hybrid algorithm of post-quantum and national cryptography provided in this application embodiment; Figure 9 A schematic diagram of the functional modules of another key negotiation device based on a hybrid algorithm of post-quantum and national cryptography provided in this application embodiment. Detailed Implementation
[0018] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are some embodiments of the present invention, but not all embodiments.
[0019] Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of the application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.
[0020] In the description of this application, it should be noted that if the terms "upper", "lower", etc. appear to indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings, or the orientation or positional relationship that the product of this application is usually placed in, it is only for the convenience of describing this application and simplifying the description, and does not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of this application.
[0021] Furthermore, the terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Additionally, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0022] It should be noted that, where there is no conflict, the features in the embodiments of this application can be combined with each other.
[0023] Internet Key Exchange (IKE) is an application layer protocol built on top of the User Datagram Protocol (UDP) and serves as the signaling protocol for Internet Protocol Security (IPsec). IKE negotiates and establishes Security Associations (SAs) for IPsec, providing the established parameters and generated keys to IPsec. IPsec uses the SAs established by IKE for IP packet encryption and authentication. IKE provides services for automatically negotiating keys and establishing IPsec security associations, simplifying the use and management of IPsec and greatly simplifying its configuration and maintenance. An SA is a relationship established between two encryption points in IPsec through negotiation using the IKE protocol. It provides both parties with information such as which security protocol is used to protect data security, the algorithm identifier, the key, and its lifespan.
[0024] IKE (Chinese National Cryptography): This is an optimized application of the IKE protocol based on Chinese national cryptographic algorithms, used to ensure the security of IPSec VPN communication. By integrating Chinese national cryptographic algorithms such as SM2, SM3, and SM4 into the IKE protocol process, it forms a standard-compliant key exchange system that can effectively resist new attack methods such as quantum computing and protect the security of critical information infrastructure.
[0025] Quantum Key Distribution (QKD) systems are secure key transmission technologies built upon the principles of quantum mechanics. They utilize quantum light sources (such as single-photon sources) to prepare quantum states (e.g., photon polarization states) encoded as binary bits. These states are then transmitted to the receiver via a quantum channel (such as optical fiber or free space). The receiver randomly selects a measurement basis to detect the quantum state and records the result. Subsequently, both parties compare the measurement basis selections through a classical channel (a public but certified communication link) and retain consistent results to generate the original key. Simultaneously, the non-cloning property of quantum states and measurement perturbation effects are used to detect eavesdropping behavior in real time (e.g., abnormal bit error rate). Finally, a secure key is selected and used for subsequent encrypted communication, ensuring that the key is completely protected from quantum computing or traditional attacks throughout the transmission process, providing unconditional physical layer security for information security.
[0026] Post-quantum cryptography (PQC) is a new generation of cryptographic techniques that can resist attacks from quantum computers. With the development of quantum computing, traditional public-key cryptography (such as RSA and ECC), which relies on number theory problems, may be vulnerable to quantum algorithms (such as Shor's algorithm). PQC aims to design encryption algorithms resistant to quantum attacks. Its core principle is to find mathematical problems that are difficult for quantum computers to solve and to design new encryption algorithms based on these problems. Currently, mainstream PQC algorithms include those based on lattices, coding theory, multivariable equations, and hash functions. For example, the lattice-based Kyber algorithm is used for key exchange, and the Dilithium algorithm is used for digital signatures.
[0027] Kyber algorithm: a post-quantum cryptography key encapsulation mechanism based on lattice cryptography. Its security is based on the difficulty of solving the learning error problem on modular lattices, and it has strong resistance to quantum attacks.
[0028] Currently, the traditional public-key cryptographic algorithms relied upon by mainstream IPSec face a huge risk of being cracked in the face of the powerful computing capabilities of quantum computers. Once the existing cryptographic system is breached, the security of network communication built on IPSec will be completely lost, and a large amount of sensitive information will be leaked. Therefore, this application provides a key negotiation method based on a hybrid algorithm of post-quantum and national cryptographic algorithms. By incorporating the post-quantum algorithm, the security of the IKE protocol during the key negotiation stage can be guaranteed, the key can be cracked, and the subsequent communication content between the two parties can be guaranteed not to be stolen.
[0029] The key negotiation method based on a hybrid post-quantum and national cryptographic algorithm provided in this application, illustrated below with specific examples and accompanying drawings, will be explained in detail. Applied to the initiator... Figure 1 This application provides one of the flowcharts illustrating a key negotiation method based on a hybrid post-quantum and national cryptographic algorithm. Figure 1 As shown, the method includes: S101. At each stage of key negotiation, send the first message of each stage to the responder.
[0030] The first message of each stage includes: the first payload message of each stage, which includes: mode indication information used to indicate whether the initiator supports the quantum negotiation mode in each stage; and the first payload message of each stage used to enable the responder to obtain the quantum key of each stage from the quantum key distribution (QKD) system when it is determined that the initiator supports the quantum negotiation mode in each stage.
[0031] In this embodiment, the IKE key negotiation comprises two phases: a first phase and a second phase. After completing the first phase, the second phase proceeds. The first phase establishes an IKE secure channel between the initiator and responder. Both parties negotiate parameters, verify identities, and establish a secure association (IKE SA) to ensure the confidentiality, message integrity, and authentication of subsequent communications. The second phase establishes an IPSec security association (IPSec SA) between the initiator and responder. Under the protection of the established IKE SA, security parameters required for data transmission (such as encryption algorithms and session keys) are negotiated to ultimately generate an IPSec SA for actual data transmission.
[0032] In the first phase of key negotiation, the initiator sends the first message of the first phase to the responder. In the second phase of key negotiation, the initiator sends the first message of the second phase to the responder.
[0033] Specifically, in the first phase of key negotiation, the initiator sends the first message of the first phase to the responder, which includes the first payload message of the first phase, represented as: Quantum_payload_i=Mode|Vendor, where Mode represents the mode indication information, and Vendor represents the manufacturer name of the QKD system. The mode indication information is used to indicate whether the initiator supports the quantum negotiation mode in the first phase. If the value of the mode indication information is 1, it indicates that the initiator does not support the quantum negotiation mode in the first phase. If the value of the mode indication information is 2, it indicates that the initiator supports the quantum negotiation mode in the first phase. The quantum negotiation mode supports the QKD system and the post-quantum + national cryptographic quantum fusion mode.
[0034] When the responder receives the first payload message of the first phase and determines that the initiator supports the quantum negotiation mode, it obtains the quantum key for the first phase from the quantum key distribution (QKD) system.
[0035] It should be noted that the first message in the first phase also includes: HDR and SA. HDR represents an ISAKMP header. ISAKMP is the Internet Security Association and Key Management Protocol, used to negotiate, establish, modify, and delete security associations (SAs) and manage keys.
[0036] In addition, in the second phase of key negotiation, the initiator sends the first message of the second phase to the responder, which includes the first payload message of the second phase, represented as: Quantum_payload_i=Mode|Vendor, where Mode represents the mode indication information and Vendor represents the manufacturer name of the QKD system. The mode indication information is used to indicate whether the initiator supports the quantum negotiation mode in the second phase. Similarly, if the value of the mode indication information is 1, it indicates that the initiator does not support the quantum negotiation mode in the second phase. If the value of the mode indication information is 2, it indicates that the initiator supports the quantum negotiation mode in the second phase. The quantum negotiation mode supports the QKD system and the post-quantum + national cryptographic quantum fusion mode.
[0037] When the responder receives the first payload message of the second phase and determines that the initiator supports the quantum negotiation mode, it obtains the quantum key for the second phase from the quantum key distribution (QKD) system.
[0038] It should be noted that the first message in the second phase also includes: HDR*, HASH_1, SA, Ni[,IDci,IDcr], where HDR* indicates that the payload following the ISAKMP header is encrypted, HASH_1 is a hash payload from the initiator, and Ni[,IDci,IDcr] is the initiator's nonce payload.
[0039] S102, Receive the second messages of each stage sent by the responder.
[0040] The second message at each stage includes: the second payload message at each stage, and the second payload message at each stage includes: information about the quantum key at each stage.
[0041] Specifically, after the response direction quantum key distribution (QKD) system obtains the quantum keys at each stage, it generates a second message for each stage. The second payload message for each stage includes information about the quantum key at each stage, including the quantum key ID, length, and acquisition status.
[0042] This can be understood as follows: the second payload message in both the first and second phases is represented as: Quantum_payload_r=Mode|Vendor|KeyID|KeyLen|Status, where KeyID represents the ID of the quantum key, KeyLen represents the length of the quantum key, and Status represents the acquisition status of the quantum key.
[0043] It should be noted that the second message in the first phase also includes: HDR, SA, CERT_sig_r, and CERT_enc_r, where CERT_sig_r is the signature certificate payload and CERT_enc_r is the encryption certificate payload. The second message in the second phase also includes: HDR*, HASH_2, SA, and Nr[,IDci,IDcr], where HASH_2 is a hash payload from the responder, and Nr[,IDci,IDcr] is the responder's nonce payload.
[0044] S103. Obtain the quantum key for each stage from the QKD system based on the quantum key information for each stage.
[0045] Specifically, if the acquisition status in the second payload message of the second message is successful, then after receiving the second message at each stage, the initiator obtains the quantum key of each stage from the QKD system according to the quantum key information of each stage. At this time, the quantum key of each stage obtained by the initiator and the quantum key of each stage obtained by the responder have the same ID and length. That is to say, the quantum key obtained by the initiator and the responder are the same at each stage.
[0046] S104. Using a preset post-quantum algorithm, generate post-quantum shared keys for each stage and the encapsulation information of the post-quantum shared keys.
[0047] Optionally, the encapsulation algorithm in the preset post-quantum algorithm is used, combined with the preset post-quantum public key in the preset hybrid public key of each stage, to determine the post-quantum shared key and the encapsulation information of the post-quantum shared key for each stage.
[0048] Among them, the encapsulation algorithm in the preset post-quantum algorithm is the Kyber encapsulation algorithm. Combined with the preset post-quantum public key (i.e., the Kyber public key) at each stage, the post-quantum shared key (i.e., the Kyber shared key) at each stage and the encapsulation information of the post-quantum shared key (i.e., the Kyber encapsulation information) are determined.
[0049] S105. Obtain the temporary shared key for each stage, and use the preset national cryptographic algorithm to generate the national cryptographic ciphertext of the temporary shared key.
[0050] Optionally, the temporary shared key for each stage is obtained, and the temporary shared key for each stage is encrypted using the national cryptographic public key in the preset mixed public key for each stage, and the national cryptographic encryption algorithm in the preset national cryptographic algorithm is used to obtain the national cryptographic ciphertext for each stage.
[0051] Specifically, the temporary shared keys for each stage are obtained, and the national cryptographic generation algorithm in the preset national cryptographic algorithm is used. Based on the national cryptographic public key, i.e. the SM2 public key in the preset mixed public key for each stage, the temporary shared keys for each stage are encrypted using the SM2 encryption algorithm to obtain the national cryptographic ciphertext, i.e. the SM2 ciphertext, for each stage.
[0052] S106. Send the third message of each stage to the responder.
[0053] The third message at each stage includes: the third payload message at each stage, which includes: the encapsulation information of the post-quantum shared key and the national cryptographic ciphertext at each stage. The third payload message at each stage is used to enable the responder to decrypt the encapsulation information of the post-quantum shared key and the national cryptographic ciphertext at each stage, obtain the post-quantum shared key and the temporary shared key at each stage, and generate the responder's negotiated key at each stage based on the quantum key, the post-quantum shared key and the temporary shared key at each stage.
[0054] Specifically, after generating the post-quantum shared key for each stage, the encapsulation information of the post-quantum shared key, the temporary shared key for each stage, and the national cryptographic ciphertext of the temporary shared key, the initiator sends the third message for each stage to the responder.
[0055] The third payload message in each stage includes the encapsulation information of the post-quantum shared key and the national cryptographic ciphertext. It can be understood that the third payload message in the first and second stages is represented as: PQC_envelope=KyberEnvelope|Sm2Encrypt, where KyberEnvelope represents the encapsulation information of the post-quantum shared key and Sm2Encrypt represents the national cryptographic ciphertext.
[0056] It should be noted that the third payload message in each stage also includes the quantum key acquisition status, represented as: Quantum_payload_s=Status, which is used by the initiator to notify the responder of the quantum key acquisition status.
[0057] After receiving the third payload messages at each stage, the responder decapsulates the encapsulation information of the post-quantum shared key at each stage to obtain the post-quantum shared key at each stage, and decrypts the national cryptographic ciphertext to obtain the temporary shared key.
[0058] The post-quantum shared key and temporary shared key of each stage are XORed to obtain the initiator shared key of the responder at each stage. Then, based on the quantum key of each stage and the responder shared key, the negotiation key of the responder at each stage is generated.
[0059] It should be noted that the third message in the first phase also includes: HDR, XCHi, and SIGi, where XCHi and SIGi are the data exchanged by the initiator. The third message in the second phase also includes: HDR* and HASH_3, where HASH_3 is another hash payload from the initiator.
[0060] S107. Based on the quantum key, post-quantum shared key, and temporary shared key at each stage, generate the negotiation key for the initiator at each stage.
[0061] Specifically, in the first phase of key negotiation, after the initiator sends the third message of the first phase, it also needs to receive the fourth message of the first phase sent by the responder. The fourth message includes: HDR, XCHr, SIGr, where XCHr and SIGr are the exchange data of the responder. Then, the initiator sends the fifth message of the first phase to the responder. The fifth message includes: HDR*, HASHi, where HASHi is the hash payload of the initiator. The initiator then receives the sixth message sent by the responder. The sixth message includes: HDR*, HASHr, where HASHr is the hash payload of the responder.
[0062] After receiving the sixth message from the responder, the initiator generates the negotiation key for the first phase based on the quantum key, the post-quantum shared key, and the temporary shared key from the first phase. Similarly, after sending the sixth message, the responder generates the negotiation key for the first phase based on the quantum key, the post-quantum shared key, and the temporary shared key from the first phase.
[0063] In the second phase of key negotiation, after the initiator sends the third message of the second phase, it generates the negotiation key of the initiator in the second phase based on the quantum key, the post-quantum shared key and the temporary shared key of the second phase. Similarly, after receiving the third message of the second phase, the responder generates the negotiation key of the responder in the second phase based on the quantum key, the post-quantum shared key and the temporary shared key of the second phase.
[0064] In summary, this application provides a key negotiation method based on a hybrid algorithm of post-quantum and national cryptographic methods, applied to the initiator. The method includes: sending a first message for each stage of key negotiation to the responder, the first message for each stage including: a first payload message for each stage, the first payload message for each stage including: mode indication information to indicate whether the initiator supports the quantum negotiation mode at each stage; the first payload message for each stage enabling the responder to obtain the quantum key for each stage from the quantum key distribution (QKD) system when the responder determines that the initiator supports the quantum negotiation mode at each stage; receiving a second message for each stage sent by the responder, the second message for each stage including: a second payload message for each stage, the second payload message for each stage including: information about the quantum key for each stage; obtaining the quantum key for each stage from the QKD system based on the information about the quantum key for each stage; and so on. Using a pre-defined post-quantum algorithm, generate post-quantum shared keys and their encapsulation information for each stage; obtain temporary shared keys for each stage, and use a pre-defined national cryptographic algorithm to generate national cryptographic ciphertext for the temporary shared keys; send third messages for each stage to the responder, each stage's third message including: a third payload message for each stage, each stage's third payload message including: encapsulation information of the post-quantum shared keys and national cryptographic ciphertext for each stage; the third payload message for each stage is used to enable the responder to decrypt the encapsulation information of the post-quantum shared keys and national cryptographic ciphertext for each stage, obtaining the post-quantum shared keys and temporary shared keys for each stage, and generating the responder's negotiation keys for each stage based on the quantum keys, post-quantum shared keys, and temporary shared keys for each stage; generate the initiator's negotiation keys for each stage based on the quantum keys, post-quantum shared keys, and temporary shared keys for each stage.
[0065] The method in this application integrates a post-quantum algorithm and a quantum key distribution system. On the one hand, the post-quantum algorithm is designed based on mathematical problems that are difficult to solve in quantum computing, which can resist potential attacks from quantum computers, ensure the security of the IKE protocol during the key negotiation phase, prevent the key from being cracked, and ensure that the subsequent communication content between the two parties is not stolen. The combination of the post-quantum algorithm and the national cryptographic algorithm can provide double protection for the national cryptographic algorithm while ensuring quantum resistance. On the other hand, quantum keys are generated using quantum state properties and have unconditional security. Their non-cloning and measurement collapse properties can prevent man-in-the-middle attacks and eavesdropping. Combined with the post-quantum algorithm, it can provide double security protection for IKE negotiation key calculation, greatly improve the security and reliability of network communication, and effectively safeguard information security in cyberspace.
[0066] This application also provides another possible implementation of a key negotiation method based on a hybrid post-quantum and national cryptographic algorithm. Figure 2 This is the second flowchart illustrating a key negotiation method based on a hybrid post-quantum and national cryptographic algorithm provided in this application. Figure 2 As shown, based on the quantum keys, post-quantum shared keys, and temporary shared keys at each stage, the negotiation keys for the initiator at each stage are generated, including: S201. Perform XOR operation on the post-quantum shared key and temporary shared key at each stage to obtain the initiator's shared key at each stage.
[0067] S202. Based on the quantum keys of each stage and the shared key of the initiator, generate the negotiation key of the initiator in each stage.
[0068] In this embodiment, in the first stage of key negotiation, the negotiation key in the first stage is the working key. The hash algorithm hmac_sm3 is used to process the quantum key and the initiator's shared key in the first stage to generate the initiator's working key in the first stage.
[0069] Specifically, it is represented as: SKEYID=prf+(HASH(Ni_b|Nr_b)⊕ShareKey⊕QK,CKY-I|CKY-R), where ShareKey is the initiator's shared key, QK is the quantum key, and SKEYID represents the initiator's working key in the first stage.
[0070] The prrf algorithm can be the hash algorithm hmac_sm3, and the prrf+ algorithm process is represented as follows: prf+(K,S)=T1|T2|T3|T4|...|Tn T1=prf(K,S) T2=prf(K,T1|S) T3=prf(K,T2|S) T4=prf (K,T3|S) ... Tn=prf (K,Tn-1|S) The calculation continues until all required key material is of sufficient length. This can be understood as K being HASH(Ni_b|Nr_b)⊕ShareKey⊕QK; S being CKY-I|CKY-R, thus calculating the initiator's working key for the first phase.
[0071] Optionally, the method further includes: Based on the initiator's working key in the first phase, determine the authentication key and encryption key of the initiator's working key in the first phase.
[0072] Specifically, it is expressed as follows: SKEYID_d=prf+(SKEYID⊕ShareKey⊕QK, CKY-I|CKY-R|0); SKEYID_a=prf+(SKEYID⊕ShareKey⊕QK, SKEYID_d|CKY-I|CKY-R|1); SKEYID_e=prf+(SKEYID⊕ShareKey⊕QK, SKEYID_a|CKY-I|CKY-R|2); Wherein, SKEYID_d represents the derived key of the session key, used to generate the session key; SKEYID_a represents the authentication key of the working key, used to authenticate the working key; and SKEYID_e represents the encryption key of the working key, used to encrypt the working key.
[0073] In the second phase of key negotiation, the negotiation key for the second phase is the session key. The hash algorithm hmac_sm3 is also used to process the quantum key and the initiator's shared key in the second phase to generate the initiator's session key in the second phase.
[0074] Optionally, the initiator's working key for the first stage is generated based on the quantum key and the shared key of the initiator in the first stage; and the initiator's session key for the second stage is generated based on the working key, quantum key and shared key of the initiator in the first stage.
[0075] Specifically, it is expressed as follows: KEYMAT=prf+(SKEYID_d⊕ShareKey⊕QK, protocol|SPI|Ni_b|Nr_b); Here, KEYMAT represents the session key of the initiator in the second phase.
[0076] In the method provided in this application embodiment, the post-quantum shared key and the temporary shared key at each stage are XORed to obtain the initiator's shared key at each stage; based on the quantum key at each stage and the initiator's shared key, the negotiation key of the initiator at each stage is generated. Since the initiator's shared key is obtained by using the post-quantum algorithm and the national cryptographic algorithm, the initiator's shared key can be protected by both the post-quantum algorithm and the national cryptographic algorithm during the key negotiation process, thus ensuring the security of the key negotiation stage.
[0077] This application also provides another key negotiation method based on a hybrid algorithm of post-quantum and national cryptography, applied to the responder. Figure 3 This is the third flowchart illustrating a key negotiation method based on a hybrid post-quantum and national cryptographic algorithm provided in this application; Figure 3 As shown, the method includes: S301. During each stage of key negotiation, receive the first message of each stage sent by the initiator.
[0078] S302. When the responder determines that the initiator supports the quantum negotiation mode at each stage, it obtains the quantum key for each stage from the quantum key distribution (QKD) system.
[0079] The first message of each stage includes: the first payload message of each stage, which includes: mode indication information used to indicate whether the initiator supports the quantum negotiation mode in each stage.
[0080] In this embodiment, the IKE key negotiation comprises two phases: a first phase and a second phase. After completing the first phase, the second phase proceeds. The first phase establishes an IKE secure channel between the initiator and responder. Both parties negotiate parameters, verify identities, and establish a secure association (IKE SA) to ensure the confidentiality, message integrity, and authentication of subsequent communications. The second phase establishes an IPSec security association (IPSec SA) between the initiator and responder. Under the protection of the established IKE SA, security parameters required for data transmission (such as encryption algorithms and session keys) are negotiated to ultimately generate an IPSec SA for actual data transmission.
[0081] In the first phase of key negotiation, the initiator sends the first message of the first phase to the responder. In the second phase of key negotiation, the initiator sends the first message of the second phase to the responder.
[0082] Specifically, in the first phase of key negotiation, the initiator sends the first message of the first phase to the responder, which includes the first payload message of the first phase, represented as: Quantum_payload_i=Mode|Vendor, where Mode represents the mode indication information, and Vendor represents the manufacturer name of the QKD system. The mode indication information is used to indicate whether the initiator supports the quantum negotiation mode in the first phase. If the value of the mode indication information is 1, it indicates that the initiator does not support the quantum negotiation mode in the first phase. If the value of the mode indication information is 2, it indicates that the initiator supports the quantum negotiation mode in the first phase. The quantum negotiation mode supports the QKD system and the post-quantum + national cryptographic quantum fusion mode.
[0083] When the responder receives the first payload message of the first phase and determines that the initiator supports the quantum negotiation mode, it obtains the quantum key for the first phase from the quantum key distribution (QKD) system.
[0084] It should be noted that the first message in the first phase also includes: HDR and SA. HDR represents an ISAKMP header. ISAKMP is the Internet Security Association and Key Management Protocol, used to negotiate, establish, modify, and delete security associations (SAs) and manage keys.
[0085] In addition, in the second phase of key negotiation, the initiator sends the first message of the second phase to the responder, which includes the first payload message of the second phase, represented as: Quantum_payload_i=Mode|Vendor, where Mode represents the mode indication information and Vendor represents the manufacturer name of the QKD system. The mode indication information is used to indicate whether the initiator supports the quantum negotiation mode in the second phase. Similarly, if the value of the mode indication information is 1, it indicates that the initiator does not support the quantum negotiation mode in the second phase. If the value of the mode indication information is 2, it indicates that the initiator supports the quantum negotiation mode in the second phase. The quantum negotiation mode supports the QKD system and the post-quantum + national cryptographic quantum fusion mode.
[0086] When the responder receives the first payload message of the second phase and determines that the initiator supports the quantum negotiation mode, it obtains the quantum key for the second phase from the quantum key distribution (QKD) system.
[0087] It should be noted that the first message in the second phase also includes: HDR*, HASH_1, SA, Ni[,IDci,IDcr], where HDR* indicates that the payload following the ISAKMP header is encrypted, HASH_1 is a hash payload from the initiator, and Ni[,IDci,IDcr] is the initiator's nonce payload.
[0088] S303, Send the second message of each stage to the initiator.
[0089] The second message at each stage includes: the second payload message at each stage, which includes: information about the quantum key at each stage; the second payload message at each stage is used to enable the initiator to obtain the quantum key at each stage from the QKD system based on the information about the quantum key at each stage; a preset post-quantum algorithm is used to generate the post-quantum shared key at each stage and the encapsulation information of the post-quantum shared key; a preset national cryptographic algorithm is used to generate the temporary shared key at each stage and the national cryptographic ciphertext of the temporary shared key; and based on the quantum key, the post-quantum shared key, and the temporary shared key at each stage, the negotiation key for the initiator at each stage is generated.
[0090] In the response direction quantum key distribution (QKD) system, after obtaining the quantum keys at each stage, it generates a second message for each stage. The second payload message for each stage includes information about the quantum key at each stage, including the quantum key ID, length, and acquisition status.
[0091] This can be understood as follows: the second payload message in both the first and second phases is represented as: Quantum_payload_r=Mode|Vendor|KeyID|KeyLen|Status, where KeyID represents the ID of the quantum key, KeyLen represents the length of the quantum key, and Status represents the acquisition status of the quantum key.
[0092] It should be noted that the second message in the first phase also includes: HDR, SA, CERT_sig_r, and CERT_enc_r, where CERT_sig_r is the signature certificate payload and CERT_enc_r is the encryption certificate payload. The second message in the second phase also includes: HDR*, HASH_2, SA, and Nr[,IDci,IDcr], where HASH_2 is a hash payload from the responder, and Nr[,IDci,IDcr] is the responder's nonce payload.
[0093] If the acquisition status in the second payload message of the second message is successful, then after receiving the second message at each stage, the initiator obtains the quantum key of each stage from the QKD system according to the quantum key information of each stage. At this time, the quantum key ID and length of each stage obtained by the initiator and the quantum key obtained by the responder are the same. That is to say, the quantum key obtained by the initiator and the responder are the same at each stage.
[0094] Then, the initiator uses the encapsulation algorithm in the preset post-quantum algorithm to encapsulate the preset post-quantum public key in the preset hybrid public key at each stage, obtaining the post-quantum shared key at each stage and its encapsulation information. Specifically, the encapsulation algorithm in the preset post-quantum algorithm is the Kyber encapsulation algorithm, which encapsulates the preset post-quantum public key (i.e., the Kyber public key) at each stage, obtaining the post-quantum shared key (i.e., the Kyber shared key) at each stage and its encapsulation information (i.e., the Kyber encapsulation information).
[0095] The process involves generating temporary shared keys for each stage using a pre-defined national cryptographic algorithm. Then, based on the national cryptographic public key within the pre-defined mixed public key for each stage, the temporary shared keys are encrypted using the national cryptographic encryption algorithm within the pre-defined national cryptographic algorithm, yielding the national cryptographic ciphertext for each stage. Specifically, the national cryptographic generation algorithm within the pre-defined national cryptographic algorithm is used to generate temporary shared keys for each stage. Then, based on the national cryptographic public key (i.e., the SM2 public key) within the pre-defined mixed public key for each stage, the temporary shared keys are encrypted using the SM2 encryption algorithm, yielding the national cryptographic ciphertext (i.e., the SM2 ciphertext) for each stage. Finally, based on the quantum key, the post-quantum shared key, and the temporary shared key for each stage, the initiator's negotiation key for each stage is generated.
[0096] S304, Receive the third messages sent by the initiator at each stage.
[0097] The third message at each stage includes: the third payload message at each stage, which includes: the encapsulation information of the post-quantum shared key and the national cryptographic ciphertext at each stage.
[0098] Specifically, after generating the post-quantum shared key for each stage, the encapsulation information of the post-quantum shared key, the temporary shared key for each stage, and the national cryptographic ciphertext of the temporary shared key, the initiator sends the third message for each stage to the responder.
[0099] The third payload message in each stage includes the encapsulation information of the post-quantum shared key and the national cryptographic ciphertext. It can be understood that the third payload message in the first and second stages is represented as: PQC_envelope=KyberEnvelope|Sm2Encrypt, where KyberEnvelope represents the encapsulation information of the post-quantum shared key and Sm2Encrypt represents the national cryptographic ciphertext.
[0100] It should be noted that the third payload message in each stage also includes the quantum key acquisition status, represented as: Quantum_payload_s=Status, which is used by the initiator to notify the responder of the quantum key acquisition status.
[0101] The third message in the first phase also includes: HDR, XCHi, and SIGi, where XCHi and SIGi are the data exchanged by the initiator. The third message in the second phase also includes: HDR* and HASH_3, where HASH_3 is another hash payload from the initiator.
[0102] S305. Decrypt the encapsulation information and national cryptographic ciphertext of the post-quantum shared key at each stage to obtain the post-quantum shared key and temporary shared key at each stage.
[0103] After receiving the third payload messages from each stage, the responder decapsulates the encapsulation information of the post-quantum shared key for each stage to obtain the post-quantum shared key for each stage, and decrypts the national cryptographic ciphertext to obtain the temporary shared key.
[0104] S306. Generate the negotiated key for the responder at each stage based on the quantum key, post-quantum shared key, and temporary shared key at each stage.
[0105] Specifically, in the first phase of key negotiation, after receiving the third message of the first phase sent by the initiator, a fourth message of the first phase also needs to be sent to the initiator. The fourth message includes: HDR, XCHr, SIGr, where XCHr and SIGr are the exchange data of the responder. Then, the fifth message of the first phase sent by the initiator is received. The fifth message includes: HDR*, HASHi, where HASHi is the hash payload of the initiator. Then, a sixth message is sent to the sender. The sixth message includes: HDR*, HASHr, where HASHr is the hash payload of the responder.
[0106] After receiving the sixth message from the responder, the initiator generates the negotiation key for the first phase based on the quantum key, the post-quantum shared key, and the temporary shared key from the first phase. Similarly, after sending the sixth message, the responder generates the negotiation key for the first phase based on the quantum key, the post-quantum shared key, and the temporary shared key from the first phase.
[0107] In the second phase of key negotiation, after the initiator sends the third message of the second phase, it generates the negotiation key of the initiator in the second phase based on the quantum key, the post-quantum shared key and the temporary shared key of the second phase. Similarly, after receiving the third message of the second phase, the responder generates the negotiation key of the responder in the second phase based on the quantum key, the post-quantum shared key and the temporary shared key of the second phase.
[0108] In summary, this application provides a key negotiation method based on a hybrid algorithm of post-quantum and national cryptographic methods, applied to the responder. The method includes: receiving a first message from the initiator at each stage of key negotiation, the first message of each stage including: a first payload message for each stage, the first payload message of each stage including: mode indication information to indicate whether the initiator supports the quantum negotiation mode at each stage; when the responder determines that the initiator supports the quantum negotiation mode at each stage, obtaining the quantum key for each stage from the quantum key distribution (QKD) system; sending a second message to the initiator at each stage, the second message of each stage including: a second payload message for each stage, the second payload message of each stage including: information about the quantum key for each stage; the second payload message of each stage is used to enable the initiator to obtain the quantum key for each stage from the QKD system based on the information about the quantum key for each stage. The process involves: generating the quantum key for each stage; using a pre-defined post-quantum algorithm to generate the post-quantum shared key and its encapsulation information for each stage; using a pre-defined national cryptographic algorithm to generate the temporary shared key and its national cryptographic ciphertext for each stage; generating the initiator's negotiation key for each stage based on the quantum key, post-quantum shared key, and temporary shared key for each stage; receiving the third message sent by the initiator for each stage, which includes the third payload message for each stage, including the encapsulation information of the post-quantum shared key and its national cryptographic ciphertext for each stage; decrypting the encapsulation information and national cryptographic ciphertext of the post-quantum shared key for each stage to obtain the post-quantum shared key and temporary shared key for each stage; and generating the responder's negotiation key for each stage based on the quantum key, post-quantum shared key, and temporary shared key for each stage.
[0109] The method in this application integrates a post-quantum algorithm and a quantum key distribution system. On the one hand, the post-quantum algorithm is designed based on mathematical problems that are difficult to solve in quantum computing, which can resist potential attacks from quantum computers, ensure the security of the IKE protocol during the key negotiation phase, prevent the key from being cracked, and ensure that the subsequent communication content between the two parties is not stolen. The combination of the post-quantum algorithm and the national cryptographic algorithm can provide double protection for the national cryptographic algorithm while ensuring quantum resistance. On the other hand, quantum keys are generated using quantum state properties and have unconditional security. Their non-cloning and measurement collapse properties can prevent man-in-the-middle attacks and eavesdropping. Combined with the post-quantum algorithm, it can provide double security protection for IKE negotiation key calculation, greatly improve the security and reliability of network communication, and effectively safeguard information security in cyberspace.
[0110] This application also provides another possible implementation of a key negotiation method based on a hybrid post-quantum and national cryptographic algorithm. Figure 4 This is the fourth flowchart illustrating a key negotiation method based on a hybrid post-quantum and national cryptographic algorithm provided in this application. Figure 4As shown, the encapsulation information and national cryptographic ciphertext of the post-quantum shared key at each stage are decrypted to obtain the post-quantum shared key and temporary shared key at each stage, including: S401. Using the decapsulation algorithm in the preset post-quantum algorithm, the encapsulation information of the post-quantum shared key in each stage is decapsulated according to the preset post-quantum private key in the preset hybrid private key in each stage, so as to obtain the post-quantum shared key in each stage.
[0111] In this embodiment, the decapsulation algorithm in the preset post-quantum algorithm is the Kyber decapsulation algorithm. Based on the preset post-quantum private key (i.e., the Kyber private key) in the preset hybrid private key of each stage, the encapsulation information of the post-quantum shared key of each stage is decapsulated to obtain the post-quantum shared key (i.e., the Kyber shared key) of each stage.
[0112] S402. Using the decryption algorithm in the preset national cryptographic algorithm, the national cryptographic private key in the preset mixed private key of each stage is used to decrypt the national cryptographic ciphertext to obtain the temporary shared key of each stage.
[0113] Specifically, based on the national cryptographic private key (i.e., the SM2 private key) in the preset mixed public key at each stage, the national cryptographic ciphertext is decrypted using the SM2 decryption algorithm to obtain the temporary shared key for each stage.
[0114] This application also provides another possible implementation of a key negotiation method based on a hybrid post-quantum and national cryptographic algorithm. Figure 5 This is the fifth flowchart illustrating a key negotiation method based on a hybrid post-quantum and national cryptographic algorithm provided in this application. Figure 5 As shown, the negotiated keys for the responder at each stage are generated based on the quantum keys, post-quantum shared keys, and temporary shared keys at each stage, including: S501. Perform XOR operation on the post-quantum shared key and temporary shared key at each stage to obtain the responder's shared key at each stage.
[0115] S502. Based on the quantum keys of each stage and the shared key of the responder, generate the negotiated key of the responder at each stage.
[0116] In this embodiment, in the first stage of key negotiation, the negotiation key in the first stage is the working key. The hash algorithm hmac_sm3 is used to process the quantum key and the responder's shared key in the first stage to generate the responder's working key in the first stage.
[0117] Specifically, it is represented as: SKEYID=prf+(HASH(Ni_b|Nr_b)⊕ShareKey⊕QK,CKY-I|CKY-R), where ShareKey is the responder's shared key, QK is the quantum key, and SKEYID represents the responder's working key in the first stage.
[0118] The prrf algorithm can be the hash algorithm hmac_sm3, and the prrf+ algorithm process is represented as follows: prf+(K,S)=T1|T2|T3|T4|...|Tn T1=prf(K,S) T2=prf(K,T1|S) T3=prf(K,T2|S) T4=prf (K,T3|S) ... Tn=prf (K,Tn-1|S) The calculation continues until all required key material is of sufficient length. This can be understood as K being HASH(Ni_b|Nr_b)⊕ShareKey⊕QK; S being CKY-I|CKY-R, thus calculating the responder's working key for the first phase.
[0119] Optionally, the method further includes: Based on the responder's working key in the first phase, determine the authentication key and encryption key of the responder's working key in the first phase.
[0120] Specifically, it is expressed as follows: SKEYID_d=prf+(SKEYID⊕ShareKey⊕QK, CKY-I|CKY-R|0); SKEYID_a=prf+(SKEYID⊕ShareKey⊕QK, SKEYID_d|CKY-I|CKY-R|1); SKEYID_e=prf+(SKEYID⊕ShareKey⊕QK, SKEYID_a|CKY-I|CKY-R|2); Wherein, SKEYID_d represents the derived key of the session key, used to generate the session key; SKEYID_a represents the authentication key of the working key, used to authenticate the working key; and SKEYID_e represents the encryption key of the working key, used to encrypt the working key.
[0121] In the second phase of key negotiation, the negotiation key for the second phase is the session key. The hash algorithm hmac_sm3 is also used to process the quantum key of the second phase and the shared key of the responder to generate the session key of the responder in the second phase.
[0122] Optionally, the responder's working key for the first stage is generated based on the responder's quantum key and the responder's shared key in the first stage; and the responder's session key for the second stage is generated based on the responder's working key, quantum key, and responder's shared key in the first stage.
[0123] Specifically, it is expressed as follows: KEYMAT=prf+(SKEYID_d⊕ShareKey⊕QK, protocol|SPI|Ni_b|Nr_b); Here, KEYMAT represents the session key of the responder in the second phase.
[0124] In the method provided in this application embodiment, the post-quantum shared key and the temporary shared key at each stage are XORed to obtain the responder's shared key at each stage; based on the quantum key at each stage and the responder's shared key, the negotiation key of the responder at each stage is generated. Since the responder's shared key is obtained by using the post-quantum algorithm and the national cryptographic algorithm, the responder's shared key can be protected by both the post-quantum algorithm and the national cryptographic algorithm during the key negotiation process, ensuring the security of the key negotiation stage.
[0125] This application also explains the process of a key negotiation method based on a hybrid post-quantum and national cryptographic algorithm through two complete examples. Figure 6 This is the sixth flowchart illustrating a key negotiation method based on a hybrid post-quantum and national cryptographic algorithm provided in this application. Figure 6 As shown, in the first phase of key negotiation, the method includes: S601, The initiator sends the first message of the first phase to the responder. The first message of the first phase includes: the first payload message of the first phase, which includes: mode indication information used to indicate whether the initiator supports the quantum negotiation mode in the first phase.
[0126] S602. When the responder determines in the first phase that the initiator supports the quantum negotiation mode, it obtains the quantum key for the first phase from the quantum key distribution (QKD) system.
[0127] S603, The response direction sends the second message of the first phase to the initiator. The second message of the first phase includes: the second payload message of the first phase, which includes: information about the quantum key of the first phase.
[0128] S604. The initiator obtains the quantum key for the first stage from the QKD system based on the quantum key information in the second message of the first stage. S605. The initiator uses a preset post-quantum algorithm to generate the first-stage post-quantum shared key and its encapsulation information; and obtains the first-stage temporary shared key, and uses a preset national cryptographic algorithm to generate the national cryptographic ciphertext of the temporary shared key.
[0129] S606. The initiator sends the third message of the first phase to the responder. The third message of the first phase includes: the third payload message of the first phase, which includes: the encapsulation information of the post-quantum shared key of the first phase and the national cryptographic ciphertext.
[0130] S607. The responder decrypts the encapsulation information and national cryptographic ciphertext of the first-stage post-quantum shared key to obtain the first-stage post-quantum shared key and temporary shared key.
[0131] S608, The responder sends the fourth message of the first phase to the initiator.
[0132] S609, The initiator sends the fifth message of the first phase to the responder.
[0133] S610, The responder sends the sixth message of the first phase to the initiator.
[0134] S611. The initiator generates the working key for the first phase based on the quantum key, the post-quantum shared key, and the temporary shared key from the first phase.
[0135] S612. The responder generates the working key for the first stage based on the quantum key, the post-quantum shared key, and the temporary shared key from the first stage.
[0136] In this embodiment, the specific contents of steps S601-S612 are described in detail in steps S101-S502 above, and will not be repeated here.
[0137] Figure 7 This is the seventh flowchart illustrating a key negotiation method based on a hybrid post-quantum and national cryptographic algorithm provided in this application. Figure 7 As shown, in the second phase of key negotiation, the method includes: S701, the initiator sends the first message of the second phase to the responder. The first message of the second phase includes: the first payload message of the second phase, which includes: mode indication information used to indicate whether the initiator supports the quantum negotiation mode in the second phase.
[0138] S702. When the responder determines in the second phase that the initiator supports the quantum negotiation mode, it obtains the quantum key for the second phase from the quantum key distribution (QKD) system.
[0139] S703, the response direction sends the second message of the second phase to the initiator, the second message of the second phase includes: the second payload message of the second phase, the second payload message of the second phase includes: the information of the quantum key of the second phase.
[0140] S704. The initiator obtains the quantum key for the second stage from the QKD system based on the quantum key information in the second message of the second stage. S705. The initiator uses a preset post-quantum algorithm to generate the second-stage post-quantum shared key and its encapsulation information; and obtains the second-stage temporary shared key, and uses a preset national cryptographic algorithm to generate the national cryptographic ciphertext of the temporary shared key.
[0141] S706. The initiator sends the third message of the second phase to the responder. The third message of the second phase includes: the third payload message of the second phase, which includes: the encapsulation information of the post-quantum shared key of the second phase and the national cryptographic ciphertext.
[0142] S707. The responder decrypts the encapsulation information of the second-stage post-quantum shared key and the national cryptographic ciphertext to obtain the second-stage post-quantum shared key and the temporary shared key.
[0143] S708. The initiator generates the session key for the second phase based on the quantum key, the post-quantum shared key, and the temporary shared key from the second phase.
[0144] S709. The responder generates the session key for the second phase based on the quantum key, the post-quantum shared key, and the temporary shared key from the second phase.
[0145] In this embodiment, the specific contents of steps S701-S709 are described in detail in steps S101-S502 above, and will not be repeated here.
[0146] The following continues to explain the key negotiation device based on the hybrid algorithm of post-quantum and national cryptography provided in any of the above embodiments of this application. Its specific implementation process and the resulting technical effects are the same as those in the corresponding method embodiments. For the sake of brevity, the parts not mentioned in this embodiment can be referred to the corresponding content in the method embodiment.
[0147] Figure 8 This is a functional module diagram of a key negotiation device based on a hybrid post-quantum and national cryptographic algorithm, provided as an embodiment of this application. Figure 8As shown, the key negotiation device 100 based on a hybrid post-quantum and national cryptographic algorithm, applied to the initiator, includes: The first sending module 110 is used to send a first message for each stage to the responder at each stage of key negotiation. The first message for each stage includes: a first payload message for each stage, which includes: mode indication information for indicating whether the initiator supports the quantum negotiation mode at each stage; and the first payload message for each stage for enabling the responder to obtain the quantum key for each stage from the quantum key distribution (QKD) system when the responder determines that the initiator supports the quantum negotiation mode at each stage. The first receiving module 120 is used to receive the second messages of each stage sent by the responder. The second messages of each stage include: the second payload messages of each stage, and the second payload messages of each stage include: information of the quantum key of each stage. The first acquisition module 130 is used to acquire the quantum key of each stage from the QKD system based on the information of the quantum key at each stage; The first generation module 140 is used to generate post-quantum shared keys for each stage and the encapsulation information of the post-quantum shared keys using a preset post-quantum algorithm. The first generation module 140 is also used to obtain the temporary shared key at each stage and generate the national cryptographic ciphertext of the temporary shared key using a preset national cryptographic algorithm. The first sending module 110 is used to send third messages for each stage to the responder. The third messages for each stage include: third payload messages for each stage. The third payload messages for each stage include: encapsulation information of the post-quantum shared key and national cryptographic ciphertext for each stage. The third payload messages for each stage are used to enable the responder to decrypt the encapsulation information of the post-quantum shared key and national cryptographic ciphertext for each stage to obtain the post-quantum shared key and temporary shared key for each stage, and to generate the negotiated key for the responder in each stage based on the quantum key, post-quantum shared key and temporary shared key for each stage. The first generation module 140 is also used to generate the negotiation key for the initiator at each stage based on the quantum key, the post-quantum shared key and the temporary shared key at each stage.
[0148] Optionally, the first generation module 140 is further configured to use the encapsulation algorithm in the preset post-quantum algorithm, combined with the preset post-quantum public key in the preset hybrid public key of each stage, to determine the post-quantum shared key and the encapsulation information of the post-quantum shared key of each stage; obtain the temporary shared key of each stage, and encrypt the temporary shared key of each stage using the national cryptographic public key in the preset hybrid public key of each stage, and the national cryptographic encryption algorithm in the preset national cryptographic algorithm, to obtain the national cryptographic ciphertext of each stage.
[0149] Optionally, the first generation module 140 is further configured to perform XOR processing on the post-quantum shared key and the temporary shared key of each stage to obtain the initiator's shared key at each stage; and generate the negotiation key of the initiator at each stage based on the quantum key and the initiator's shared key at each stage.
[0150] Optionally, each stage includes: a first stage; the negotiation key for the first stage is a working key; the first generation module 140 is further configured to determine the authentication key and the encryption key of the working key in the first stage based on the working key of the initiator in the first stage.
[0151] Optionally, each stage includes: a second stage; the negotiation key for the second stage is a session key; the first generation module 140 is further configured to generate the initiator's working key for the first stage based on the initiator's quantum key and the initiator's shared key for the first stage; and to generate the initiator's session key for the second stage based on the initiator's working key, quantum key, and initiator's shared key for the first stage.
[0152] Figure 9 A schematic diagram of the functional modules of another key negotiation device based on a hybrid post-quantum and national cryptographic algorithm provided in this application embodiment. Figure 9 As shown, the key negotiation device 200 based on a hybrid post-quantum and national cryptographic algorithm, applied to the responder, includes: The second receiving module 210 is used to receive the first message of each stage sent by the initiator at each stage of key negotiation. The first message of each stage includes: the first payload message of each stage, and the first payload message of each stage includes: mode indication information used to indicate whether the initiator supports the quantum negotiation mode at each stage. The second acquisition module 220 is used to acquire the quantum keys for each stage from the quantum key distribution (QKD) system when the responder determines that the initiator supports the quantum negotiation mode at each stage. The second sending module 230 is used to send second messages for each stage to the initiator. Each stage's second message includes a second payload message for each stage, and the second payload message for each stage includes information about the quantum key for each stage. The second payload message for each stage enables the initiator to obtain the quantum key for each stage from the QKD system based on the quantum key information for each stage. A preset post-quantum algorithm is used to generate a post-quantum shared key and its encapsulation information for each stage. A preset national cryptographic algorithm is used to generate a temporary shared key and its national cryptographic ciphertext for each stage. Based on the quantum key, the post-quantum shared key, and the temporary shared key for each stage, the initiator generates a negotiation key for each stage. The second receiving module 210 is also used to receive the third messages of each stage sent by the initiator. The third messages of each stage include: the third payload messages of each stage, and the third payload messages of each stage include: the encapsulation information of the post-quantum shared key and the national cryptographic ciphertext of each stage. The decryption module 240 is used to decrypt the encapsulation information and national cryptographic ciphertext of the post-quantum shared key at each stage to obtain the post-quantum shared key and temporary shared key at each stage. The second generation module 250 is used to generate the negotiated key for the responder at each stage based on the quantum key, the post-quantum shared key, and the temporary shared key at each stage.
[0153] Optionally, the decryption module 240 is also used to use the decapsulation algorithm in the preset post-quantum algorithm to decapsulate the encapsulation information of the post-quantum shared key in each stage according to the preset post-quantum private key in the preset mixed private key in each stage, so as to obtain the post-quantum shared key in each stage; and to use the decryption algorithm in the preset national cryptographic algorithm to decrypt the national cryptographic ciphertext according to the national cryptographic private key in the preset mixed private key in each stage, so as to obtain the temporary shared key in each stage.
[0154] Optionally, the second generation module 250 is further configured to perform XOR processing on the post-quantum shared key and the temporary shared key at each stage to obtain the responder's shared key at each stage; and generate the negotiated key for the responder at each stage based on the quantum key and the responder's shared key at each stage.
[0155] Optionally, each stage includes: a first stage; the negotiation key for the first stage is a working key; and a second generation module 250 is further configured to determine the authentication key and the encryption key of the working key in the first stage based on the working key of the responder in the first stage.
[0156] Optionally, each stage includes: a second stage; the negotiation key for the second stage is a session key; the second generation module 250 is further configured to generate a working key for the responder in the first stage based on the quantum key and the shared key of the responder in the first stage; and to generate a session key for the responder in the second stage based on the working key, the quantum key, and the shared key of the responder in the first stage.
[0157] The above-described device is used to execute the method provided in the foregoing embodiments, and its implementation principle and technical effect are similar, so they will not be described again here.
[0158] These modules can be one or more integrated circuits configured to implement the above methods, such as one or more Application Specific Integrated Circuits (ASICs), one or more microprocessors, or one or more Field Programmable Gate Arrays (FPGAs). Alternatively, when a module is implemented using processing element scheduler code, the processing element can be a general-purpose processor, such as a Central Processing Unit (CPU) or other processor capable of calling program code. Furthermore, these modules can be integrated together as a system-on-a-chip (SOC).
[0159] The above are merely specific embodiments of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A key negotiation method based on a hybrid algorithm of post-quantum and national cryptography, characterized in that, Applied to the initiator, the method includes: At each stage of key negotiation, a first message for each stage is sent to the responder. The first message for each stage includes: a first payload message for each stage, which includes: mode indication information for indicating whether the initiator supports the quantum negotiation mode at each stage; the first payload message for each stage is used to enable the responder to obtain the quantum key for each stage from the quantum key distribution (QKD) system when the responder determines that the initiator supports the quantum negotiation mode at each stage. The responder receives the second messages for each stage, each second message including: the second payload message for each stage, each second payload message including: information about the quantum key for each stage; Based on the quantum key information of each stage, obtain the quantum key of each stage from the QKD system; A preset post-quantum algorithm is used to generate the post-quantum shared key for each stage and the encapsulation information of the post-quantum shared key; Obtain the temporary shared key for each stage, and generate the national cryptographic ciphertext of the temporary shared key using a preset national cryptographic algorithm; The responder sends a third message for each stage, the third message for each stage including: a third payload message for each stage, the third payload message for each stage including: encapsulation information of the post-quantum shared key and the national cryptographic ciphertext for each stage, the third payload message for each stage being used to enable the responder to decrypt the encapsulation information of the post-quantum shared key and the national cryptographic ciphertext for each stage to obtain the post-quantum shared key and the temporary shared key for each stage, and generate the negotiated key for the responder in each stage based on the quantum key, the post-quantum shared key and the temporary shared key for each stage; Based on the quantum key, the post-quantum shared key, and the temporary shared key of each stage, the initiator generates the negotiation key for each stage.
2. The method according to claim 1, characterized in that, The process of generating the post-quantum shared key for each stage and the encapsulation information of the post-quantum shared key using a preset post-quantum algorithm includes: By employing the encapsulation algorithm in the preset post-quantum algorithm and combining it with the preset post-quantum public key in the preset hybrid public key of each stage, the post-quantum shared key and the encapsulation information of the post-quantum shared key in each stage are determined. The step of obtaining the temporary shared key for each stage and generating the national cryptographic ciphertext of the temporary shared key using a preset national cryptographic algorithm includes: Obtain the temporary shared key for each stage, and encrypt the temporary shared key for each stage using the national cryptographic public key in the preset mixed public key for each stage, and use the national cryptographic encryption algorithm in the preset national cryptographic algorithm to obtain the national cryptographic ciphertext for each stage.
3. The method according to claim 1, characterized in that, The step of generating the negotiation key for the initiator at each stage based on the quantum key, the post-quantum shared key, and the temporary shared key at each stage includes: The post-quantum shared key and the temporary shared key at each stage are XORed to obtain the initiator's shared key at each stage. Based on the quantum keys of each stage and the shared key of the initiator, the negotiation key of the initiator in each stage is generated.
4. The method according to claim 3, characterized in that, The stages include: a first stage; the negotiation key for the first stage is the working key; The method further includes: Based on the working key of the initiator in the first stage, determine the authentication key and the encryption key of the working key of the initiator in the first stage.
5. The method according to claim 3, characterized in that, The stages include: a second stage; the negotiation key for the second stage is a session key; The step of generating the negotiation key for the initiator at each stage based on the quantum key at each stage and the initiator's shared key includes: Based on the quantum key and the shared key of the initiator in the first stage, the working key of the initiator in the first stage is generated; Based on the initiator's working key in the first phase, the quantum key, and the initiator's shared key, a session key for the initiator in the second phase is generated.
6. A key negotiation method based on a hybrid algorithm of post-quantum and national cryptography, characterized in that, Applied to the responder, the method includes: In each stage of key negotiation, the initiator sends a first message for each stage, the first message for each stage including: the first payload message for each stage, the first payload message for each stage including: mode indication information for indicating whether the initiator supports quantum negotiation mode in each stage; When the responder determines that the initiator supports the quantum negotiation mode at each stage, the responder obtains the quantum key for each stage from the quantum key distribution (QKD) system. The system sends second messages for each stage to the initiator, each second message including a second payload message for each stage, the second payload message including information about the quantum key for each stage; the second payload message for each stage is used to enable the initiator to obtain the quantum key for each stage from the QKD system based on the information about the quantum key for each stage; a preset post-quantum algorithm is used to generate the post-quantum shared key for each stage and the encapsulation information of the post-quantum shared key; a preset national cryptographic algorithm is used to generate the temporary shared key for each stage and the national cryptographic ciphertext of the temporary shared key; and based on the quantum key, the post-quantum shared key, and the temporary shared key for each stage, the system generates the negotiation key for the initiator in each stage; Receive the third message of each stage sent by the initiator, the third message of each stage includes: the third payload message of each stage, the third payload message of each stage includes: the encapsulation information of the post-quantum shared key of each stage and the national cryptographic ciphertext; The encapsulation information of the post-quantum shared key and the national cryptographic ciphertext at each stage are decrypted to obtain the post-quantum shared key and the temporary shared key at each stage; The respondent generates the negotiation key for each stage based on the quantum key, the post-quantum shared key, and the temporary shared key.
7. The method according to claim 6, characterized in that, The process of decrypting the encapsulation information of the post-quantum shared key and the national cryptographic ciphertext at each stage to obtain the post-quantum shared key and the temporary shared key at each stage includes: Using the decapsulation algorithm in the preset post-quantum algorithm, the encapsulation information of the post-quantum shared key in each stage is decapsulated according to the preset post-quantum private key in the preset hybrid private key in each stage, so as to obtain the post-quantum shared key in each stage. The national cryptographic algorithm is used to decrypt the national cryptographic ciphertext according to the national cryptographic private key in the preset mixed private key of each stage, so as to obtain the temporary shared key of each stage.
8. The method according to claim 6, characterized in that, The step of generating the negotiated key for the responder at each stage based on the quantum key, the post-quantum shared key, and the temporary shared key at each stage includes: The post-quantum shared key and the temporary shared key at each stage are XORed to obtain the responder's shared key at each stage. Based on the quantum keys of each stage and the shared key of the responder, the negotiation key of the responder in each stage is generated.
9. The method according to claim 8, characterized in that, The stages include: a first stage; the negotiation key for the first stage is the working key; The method further includes: Based on the responder's working key in the first phase, determine the authentication key and the encryption key of the responder's working key in the first phase.
10. The method according to claim 8, characterized in that, The stages include: a second stage; the negotiation key for the second stage is a session key; The step of generating the negotiated key for the responder at each stage based on the quantum key at each stage and the responder's shared key includes: Based on the quantum key and the shared key of the responder in the first stage, the working key of the responder in the first stage is generated; Based on the responder's working key in the first phase, the quantum key, and the responder's shared key, a session key for the responder in the second phase is generated.
Citation Information
Patent Citations
IPSec-based security protocol agility migration method, device and equipment
CN118381669A
Anti-quantum security enhancement method for national secret SSL VPN protocol
CN118540163A
