A method and device for implementing a noise protocol based on an external quantum key
By introducing out-of-band quantum keys in the handshake phase of the noise protocol, quantum secure pre-shared keys are dynamically generated, which solves the shortcomings of traditional public key encryption algorithms under quantum computer attacks, improves the security and flexibility of the communication system, and maintains Improved noise protocol performance and simplicity.
Patent Information
- Application Number
- CN202410807075.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-21
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2044-06-21
AI Technical Summary
Traditional public-key encryption algorithms are difficult to withstand quantum computer attacks. Existing noise protocols suffer from reduced performance and increased complexity after integrating post-quantum security algorithms, and lack flexibility and efficiency.
By introducing out-of-band quantum keys in the handshake phase of the noise protocol, using the quantum key service provider to provide keys that are resistant to quantum attacks, and dynamically generating quantum-safe pre-shared keys, combined with the noise protocol, the security of the communication system is enhanced.
It improves the resistance of the communication system to quantum attacks, maintains the performance and simplicity of the noise protocol, enhances the flexibility and security of the key, and avoids the performance impact of post-quantum algorithms in the negotiation process.
Smart Images

Figure CN118381608B
Abstract
Description
Technical Field
[0001] The present application relates to the field of cryptography technology, and more particularly to a method and device for implementing a noise protocol based on an out-of-band quantum key. Background Art
[0002] The noise protocol framework is a series of cryptographic protocols used to establish a secure communication channel between two communication endpoints. It provides a simple, efficient and secure way of communication and has been widely used in various applications. The security of the noise protocol is based on Curve25519, which is a key exchange protocol based on elliptic curve cryptography that provides secure and reliable key exchange and authentication.
[0003] Currently, due to the development of quantum computers, traditional public key encryption algorithms, including key exchange algorithms such as Curve25519 elliptic curve cryptography, are at risk of being cracked. Post-quantum cryptography (PQC) algorithms are an important supplement to combat quantum computer attacks. The PQC algorithm is designed to resist quantum computing attacks and is being standardized by the National Institute of Standards and Technology (NIST). Integrating the PQC algorithm into the noise protocol can enhance its resistance to quantum computer attacks and maintain its security.
[0004] Therefore, a method is needed to simply and efficiently combine the anti-quantum attack properties obtained by anti-quantum attack algorithms such as the PQC algorithm with the noise protocol to enhance the security of the communication system. Summary of the invention
[0005] In order to solve the above problems, the present application proposes a noise protocol method, device, computer-readable storage medium and electronic device based on an out-of-band quantum key, which can simply and efficiently combine the anti-quantum attack property obtained by the PQC algorithm with the noise protocol to improve the security performance of the communication system.
[0006] In a first aspect, the present application provides a noise protocol method based on an out-of-band quantum key, the noise protocol supports a pre-shared key, the noise protocol is implemented by two communicating parties through a first communication link through negotiation, the method is applied to either of the two communicating parties, and the method includes:
[0007] In the handshake phase of the noise protocol, a key request message is sent to the first quantum key service provider;
[0008] Receiving the quantum key identifier fed back by the first quantum key service provider;
[0009] Through the exchange of messages in the handshake phase, the quantum key identifier is sent to the other party of the communication, so that the other party can obtain the quantum key corresponding to the quantum key identifier from the second quantum key service provider, and the quantum key is the pre-shared key of the noise protocol; the quantum key identifier and the quantum key are generated in advance by the first quantum key service provider and the second quantum key service provider through negotiation using the second communication link.
[0010] Therefore, the present application can simply and efficiently combine the quantum key with the noise protocol by obtaining a quantum key that is resistant to quantum attacks from an out-of-band quantum key service provider to enhance the security performance of the communication system.
[0011] In a second aspect, the present application provides a method for implementing a noise protocol based on an out-of-band quantum key, wherein the noise protocol supports a pre-shared key, and the noise protocol is implemented by negotiation between the communicating parties through a first communication link, and the method includes:
[0012] In the handshake phase of the noise protocol, the first party of the communication initiates a key request message to the first quantum key service provider;
[0013] The first quantum key service provider feeds back a quantum key identifier to the first party;
[0014] The first party sends the quantum key identifier to the second party in the communication through the exchange of messages in the handshake phase;
[0015] The second party sends a quantum key identifier to a second quantum key service provider;
[0016] The second quantum key service provider returns the quantum key corresponding to the quantum key identifier to the second party, and the quantum key is the pre-shared key of the noise protocol; the quantum key identifier and the quantum key are generated in advance by the first quantum key service provider and the second quantum key service provider through negotiation using the second communication link.
[0017] In a third aspect, the present application provides a noise protocol implementation device based on an out-of-band quantum key, the noise protocol supports a pre-shared key, the noise protocol is implemented by negotiation between the communicating parties through a first communication link, and the device is deployed on either of the communicating parties, and the device includes:
[0018] A sending module, used to initiate a key request message to the first quantum key service provider;
[0019] A receiving module, used to receive the quantum key identifier fed back by the first quantum key service provider;
[0020] The communication module is used to send a quantum key identifier to the other party of the communication so that the other party can obtain a quantum key from a second quantum key service provider, where the quantum key is a pre-shared key of a noise protocol; the quantum key identifier and the quantum key have a one-to-one correspondence, and the quantum key identifier and the quantum key are generated by negotiation between the first quantum key service provider and the second quantum key service provider using a second communication link.
[0021] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed in a computer, the computer is caused to execute the method described in the first aspect or any possible implementation of the first aspect.
[0022] In a fifth aspect, the present application provides an electronic device, comprising: at least one memory for storing programs; and at least one processor for executing the programs stored in the memory; wherein, when the programs stored in the memory are executed, the processor is used to execute the method described in the first aspect or any possible implementation of the first aspect, and execute the method described in the second aspect or any possible implementation of the second aspect.
[0023] It can be understood that the beneficial effects of the second to fifth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0025] Figure 1 This is a schematic diagram of the handshake phase of a noise protocol;
[0026] Figure 2 This is a flow chart of a noise protocol implementation method based on an out-of-band quantum key provided in an embodiment of the present application;
[0027] Figure 3 It is a schematic diagram of a noise protocol implementation method based on an out-of-band quantum key provided in an embodiment of the present application;
[0028] Figure 4 It is a schematic diagram of a noise protocol implementation device based on an out-of-band quantum key provided in an embodiment of the present application. DETAILED DESCRIPTION
[0029] In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0030] In the description of the embodiments of the present application, words such as "exemplary", "for example" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary", "for example" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary", "for example" or "for example" is intended to present related concepts in a concrete way.
[0031] In the description of the embodiments of the present application, the term "and / or" is merely a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B may represent: A exists alone, B exists alone, and A and B exist at the same time. In addition, unless otherwise specified, the term "multiple" means two or more. For example, multiple systems refers to two or more systems, and multiple screen terminals refers to two or more screen terminals.
[0032] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. The terms "include", "comprises", "has" and their variations all mean "including but not limited to", unless otherwise specifically emphasized.
[0033] The Noise Protocol is a lightweight transport layer security encryption protocol based on the Diffie-Hellman (DH) key exchange. DH is an algorithm that allows communicating parties to establish a secret key over an insecure public channel.
[0034] The noise protocol flow includes the following basic steps:
[0035] 1. Protocol initialization: The two parties in the agreement select the encryption suite and generate long-term identity keys and key pairs;
[0036] 2. Negotiate session key: The two communicating parties negotiate and generate session keys by exchanging handshake messages;
[0037] 3. Authentication: Both parties use a long-term identity key for authentication;
[0038] 4. Key confirmation: The communicating parties ensure the consistency of the key by mutually confirming the validity of the session key;
[0039] 5. Data encryption: The communicating parties use session keys to encrypt and decrypt communication data.
[0040] The core part of the noise protocol is the handshake protocol, based on which the session key is negotiated. The noise protocol supports 12 different negotiation modes to support different applications. These modes can be further combined with pre-shared-key (PSK), public key algorithm, symmetric encryption algorithm, hash algorithm, etc. to form hundreds of different protocol variables.
[0041] For example, Figure 1 A schematic diagram of the handshake phase of a noise protocol is shown.
[0042] like Figure 1 As shown, the two communicating parties are the initiator and responder of the handshake protocol, and a communication link is pre-established between the two communicating parties. The communication link is a public channel established based on physical media such as twisted pair, optical fiber and microwave.
[0043] During the handshake phase, the negotiation mode between the initiator and the responder is 1-RTT (round trip times), that is, the initiator and the receiver have the ability to send data streams only after completing the handshake communication including the first exchange information and the second exchange information (one round trip).
[0044] By setting different protocol variables in the first exchange message and the second exchange message, the algorithm represented by the protocol variables is used to record the fixed public key and temporary public key sent by the other end, and the temporary data is calculated through the DH algorithm.
[0045] When the entire handshake is completed, the communicating parties can generate a consistent session key based on the peer information, and each party can use this session key to send encrypted transmission messages.
[0046] In order to integrate quantum encryption algorithms into the noise protocol to enhance its resistance to quantum computer attacks, the current PQC algorithm modification for the noise protocol mainly uses the quantum-safe key encapsulation method (KEM) to replace or mix the elliptic curve key exchange algorithm (EDCH) based on the curve25519 elliptic curve. EDCH is an efficient and secure variant of DH, which is generated based on the DH exchange key combined with the elliptic curve puzzle.
[0047] However, this approach has two shortcomings:
[0048] 1. Impact on performance: Due to the high computational complexity of the PQC algorithm, encryption and decryption speeds may be slowed down, thus affecting the overall performance of the noise protocol;
[0049] 2. Impact on the complexity of the noise protocol. Integrating the PQC algorithm into the noise protocol framework will increase the overall complexity of the protocol.
[0050] In addition, the PSK variable can also be set in the exchange information during the handshake phase. The Noise Protocol framework currently has 59+ different protocols, of which 21 protocols support PSK. PSK is a mechanism for enhancing communication security. By pre-sharing a key between the communicating parties, the Noise Protocol can use this key when establishing encrypted communications to improve security and resist certain types of attacks, such as quantum computing attacks. However, at present, PSK is mainly manually entered by the user at the communication end, and needs to be pre-shared to the communicating parties for storage, so the security is relatively low; and due to the static setting process of pre-sharing PSK, the flexibility is poor.
[0051] In view of this, the noise protocol implemented in this scheme can dynamically generate quantum secure PSK by setting PSK variables in the exchanged information during the handshake phase to support PSK, and obtaining out-of-band quantum keys from quantum key service providers, thereby improving the flexibility and security of obtaining PSK. In addition, by setting PSK variables to achieve the anti-quantum attack properties of out-of-band quantum keys and combining them with the noise protocol, the system's ability to resist quantum attacks can be further improved.
[0052] Next, based on the above analysis, a noise protocol implementation method based on an out-of-band quantum key provided in an embodiment of the present application is introduced in detail.
[0053] Figure 2 A flow chart of a noise protocol implementation method based on an out-of-band quantum key provided by an embodiment of the present application is shown. The noise protocol supports a pre-shared key, which is implemented by negotiation between the two communicating parties through a first communication link. The noise protocol implementation method is applied to either of the two communicating parties, and mainly includes the following steps:
[0054] Step S201: Initiate a key request message to the first quantum key service provider during the handshake phase of the noise protocol.
[0055] In this embodiment, the first quantum key service provider is a provider of an out-of-band quantum key, and the out-of-band quantum key is a quantum key generated by the first quantum key service provider through a non-first communication link. The first quantum key service provider is a participant that can generate quantum keys based on national cryptographic algorithms (domestic cryptographic algorithms recognized by the State Cryptography Administration, such as SM1, SM2, SM3, SM4), PQC algorithms, quantum key distribution (QKD) algorithms, etc.
[0056] The key request message can be a request message based on identity authentication or a request message based on a virtual private network (VPN), as long as the identity authentication or data communication between the communication party and the first quantum key service provider can be achieved through the key request message. The communication party is any one of the two communication parties, such as Figure 1 The sender is shown.
[0057] Exemplarily, a network link is pre-established between the first quantum key service provider and the communication party that initiates the key request message for identity authentication or VPN formation. Based on the established network link, the communication party uses the representational state transfer API (REST API) provided by the first quantum key service provider to initiate a key request message to the first quantum key service provider. After generating the quantum key, the first quantum key service provider can provide key services to the outside world through the REST API. REST API is a software architecture style and communication protocol for building distributed systems, used for transmitting and exchanging data on the network, and can provide a flexible, scalable and easy-to-integrate way to access and operate remote resources.
[0058] The purpose of initiating a key request message to the first quantum key service provider in the communication direction is to obtain a quantum key identifier to obtain a target session key. Therefore, the execution timing of this embodiment is in the handshake stage of the noise protocol.
[0059] In one implementation, the communicating parties can execute a new round of noise protocol before each round of data transmission, and initiate a key request message to the first quantum key service provider during the handshake phase of the noise protocol to obtain a new quantum key identifier. Alternatively, the communicating parties establish a secure communication channel based on the noise protocol framework and design a timeout mechanism, such as executing a new round of noise protocol every 3 minutes.
[0060] In another implementation, the communication party can also execute a new round of noise protocol based on the key rotation mechanism of the noise protocol, and initiate a key request message to the first quantum key service provider during the handshake phase of the noise protocol to obtain a new quantum key identifier. The noise protocol includes a key rotation mechanism for replacing the session key. By opening an interface to the user, such as a rekey interface, the user of the communication party can call the interface provided by the noise protocol to set the key rotation flag after the noise protocol ends the handshake phase and enters the transmission phase, so as to prompt the noise protocol to update the session key and realize the rotation of the session key.
[0061] Therefore, by updating the quantum key each time a new noise protocol is executed or the user manually sets the key rotation, a new quantum secure PSK can be obtained to achieve key rotation, further improving the security of the system.
[0062] Step S202: receiving the quantum key identifier fed back by the first quantum key service provider.
[0063] In this embodiment, when the first quantum key service provider generates a quantum key, it also establishes a corresponding quantum key identifier for the quantum key. The generated quantum key is saved in the key library of the first quantum key service provider. And in the index table of the first quantum key service provider, the one-to-one correspondence between the quantum key identifier and the quantum key is saved. The corresponding quantum key can be found by querying the quantum key identifier in the index table.
[0064] Exemplarily, for a key request message initiated by a communication party, the first quantum key service provider randomly allocates a currently available quantum key identifier and sends it to the communication party. In addition, the first quantum key service provider may also simultaneously send a quantum key corresponding to the quantum key identifier to the communication party.
[0065] In one implementation, the first quantum key service provider dynamically updates the key library and the index table at a preset frequency to maintain currently available quantum keys and their corresponding quantum key identifiers.
[0066] In another implementation, the key library may also be updated in real time according to the manual operation of the user to maintain the currently available quantum keys and their corresponding quantum key identifiers, which is not limited here.
[0067] Step S203, through the exchange of messages in the handshake phase, the quantum key identifier is sent to the other party of the communication, so that the other party obtains the quantum key corresponding to the quantum key identifier from the second quantum key service provider, and the quantum key is the pre-shared key of the noise protocol. The quantum key identifier and the quantum key are pre-negotiated and generated by the first quantum key service provider and the second quantum key service provider using the second communication link.
[0068] In this embodiment, the quantum key identifier and the quantum key are generated by negotiation between the first quantum key service provider and the second quantum key service provider using the second communication link, and the quantum key identifier and the quantum key correspond one to one.
[0069] Similar to the first quantum key service provider, the second quantum key service provider can also be a participant that can generate quantum keys based on the national secret algorithm, PQC algorithm, quantum key distribution algorithm, etc. The second communication link is an out-of-band communication link different from the first communication link, that is, different communication links are used when generating out-of-band quantum keys and implementing noise protocols. The second communication link can also be a public channel established based on physical media such as twisted pair, optical fiber and microwave. The first quantum key service provider and the second quantum key service provider can use the second communication link to generate the same quantum key and its corresponding quantum key identifier that is resistant to quantum attacks based on the same encryption algorithm.
[0070] Exemplarily, the first quantum key service provider and the second quantum key service provider can use the second communication link to negotiate and generate a quantum key and its corresponding quantum key identifier based on the national secret algorithm. The second communication link can also be used to negotiate and generate a quantum key and its corresponding quantum key identifier based on the PQC algorithm, or the quantum key distribution algorithm, or any combination of at least two of the above algorithms. When using any combination of at least two or more algorithms, the symmetric keys negotiated based on different algorithms need to be subjected to a modulo-2 addition operation or a key-derivative operation to obtain the quantum key.
[0071] Specifically, based on the second communication link between the first quantum key service provider and the second quantum key service provider, an out-of-band key negotiation protocol is designed to flexibly support multiple parallel key negotiation methods, such as the national secret algorithm, the PQC algorithm, the quantum key distribution and other three methods, or any combination of at least two or more of them. Then the symmetric keys negotiated by these methods are mixed, and the mixing method can use an XOR operation or a key derivation algorithm. The final quantum key needs to be stored using a reliable and secure key management mechanism, and key services can be provided to the outside. It can be understood that the first quantum key service provider and the second quantum key service provider store the same quantum key and its corresponding quantum key identifier.
[0072] After receiving the quantum key identifier fed back by the first quantum key service provider, the communication party sends the quantum key identifier to the other party in the communication, so that the other party can obtain the quantum key from the second quantum key service provider. The quantum key is the pre-shared key of the noise protocol. The other party is the party in the communication that is opposite to the communication party, for example Figure 1 The recipient is shown.
[0073] Specifically, after receiving the quantum key identifier, the other party initiates a key request message specifying the quantum key identifier to the second quantum key service provider. After receiving the key request message, the second quantum key service provider feeds back the quantum key corresponding to the specified quantum key identifier to the other party. At this point, by transmitting the quantum key identifier over the first communication link, the communicating party and the other party can share the same quantum key. This quantum key is an out-of-band quantum key provided by the first quantum key service provider and the second quantum key service provider through external interfaces such as REST API.
[0074] Optionally, the communication party and the first quantum key service provider may be configured in a relatively closed internal network, such as a local area network. Equivalently, the other party and the second quantum key service provider may be configured in another relatively closed internal network.
[0075] Therefore, although the first communication link between the two communicating parties is usually an unsafe public channel, the security performance of the system can be improved by transmitting the quantum key identifier only on the first communication link so that the two communicating parties obtain the same quantum key. The quantum key is the pre-shared key of the noise protocol.
[0076] Furthermore, the communicating parties can also use the first communication link to negotiate and generate an EDCH exchange key based on the elliptic curve key exchange algorithm, and perform key derivation-based operations on the EDCH exchange key and the pre-shared key to generate a target session key for the communicating parties, which is used to encrypt data transmitted by the communicating parties.
[0077] Specifically, during the handshake phase of the noise protocol, the communicating parties will use a temporary chaining key, which is a symmetric key generated and updated multiple times during the handshake process. It is a fusion of multiple key materials, including static and temporary Diffie-Hellman keys (based on elliptic curves), and PSK. After the handshake is completed, the Chaining Key will be used to generate the final target session key for encrypting subsequent communications.
[0078] In addition, the Noise Protocol framework currently has 59+ different protocols, 21 of which support PSK. Different Noise Protocol variants that support PSK mode may place PSK in different locations in the protocol message and provide different levels of security capabilities. For example, depending on the mode modifier in the protocol:
[0079] psk0: indicates that a psk identification bit (pskID, used to store the acquired quantum key identification) is added at the beginning of the first exchange message, providing basic PSK verification.
[0080] psk1: indicates that a psk flag is added at the end of the first exchanged message, and the PSK is mixed with other random numbers to generate a new session key to prevent PSK leakage.
[0081] psk2: indicates that a psk flag is added at the end of the second exchanged message, and PSK is not used until the identity of the other party is verified. This provides a stronger ability to prevent man-in-the-middle attacks.
[0082] Taking IKpsk2 as an example, it means that the PSKID is added at the end of the second exchange message. When the pre-shared key conforms to the IKpsk2 protocol, the quantum key identifier is sent to the other party in the communication using the IKpsk2 protocol. For other psk0 or psk1 protocol variants, the position of the PSK ID in different exchange messages will be changed, as well as the specific timing and location when the PSK and other keys are integrated. However, the specific steps for obtaining the out-of-band quantum secure PSK remain the same, so corresponding adjustments can be made for specific variants, and no further details will be given.
[0083] Therefore, the noise protocol implemented in this scheme can dynamically generate quantum secure PSK by setting PSK variables in the exchanged information during the handshake phase to support PSK, and obtaining out-of-band quantum keys from quantum key service providers, thereby improving the flexibility and security of obtaining PSK. In addition, by setting PSK variables to achieve the combination of the anti-quantum attack properties of out-of-band quantum keys and the noise protocol, the system's ability to resist quantum attacks can be further improved.
[0084] Compared with the prior art, the solution involved in this application mainly includes the following advantages:
[0085] 1. It does not affect the performance of the original noise protocol. The calculation of the post-quantum algorithm with high computational complexity is completed in the out-of-band pre-negotiation stage, which has no impact on the negotiation of the noise protocol.
[0086] 2. It does not increase the complexity of the noise protocol itself. Only very minor changes are needed, such as obtaining the out-of-band PSK, transmitting the PSK ID, and performing key fusion on the PSK.
[0087] 3. It has high flexibility and can achieve out-of-band key negotiation by decoupling from the noise protocol, and more flexibly implement the combination of multiple quantum security technologies without making any additional modifications to the noise protocol.
[0088] Next, Figure 3 Taking a noise protocol implementation method based on an out-of-band quantum key provided in the embodiment of the present application as an example, the scheme used in the present application is described in detail.
[0089] like Figure 3 As shown, Figure 3 The upper middle part is the noise protocol, which adopts the IKpsk2 protocol mode, which is one of the 21 noise protocols supporting the PSK mode. The noise protocol initiator and the noise protocol responder are the communication party and the other party as shown in steps S201-S203.
[0090] Figure 3 The middle and lower parts are used for out-of-band quantum security key negotiation, and consist of two "quantum security key services A and quantum security key services B that support flexible combinations of national encryption, PQC, and QKD technologies" as the initiator and responder of generating quantum keys.
[0091] The process of out-of-band quantum secure key negotiation includes:
[0092] First, perform out-of-band quantum security key negotiation. The negotiation process supports flexible combinations of national encryption algorithms, PQC algorithms, and QKD technologies. For example, after the symmetric keys are obtained through negotiation using the national encryption algorithm sm2dh, the PQC algorithm Kyber, and QKD, the three pairs of symmetric keys are XORed or key-derived to obtain the final quantum key. After the quantum key is securely stored, key services can be provided to the outside through the REST API.
[0093] Next, the noise protocol process is performed. The IKpsk2 protocol adopted in this embodiment provides two-way authentication and confidentiality, and uses PSK to enhance security. The PSK length is 32 bytes, and the PSK mode mixes the PSK into the encryption key and the h value. The h value represents the handshake hash value, which is used to hash all the sent and received handshake data.
[0094] like Figure 3 As shown in , the static public keys of both ends of the communication required by the IKpsk2 protocol need to be pre-generated and configured in advance. Figure 3 There are two negotiation messages in the handshake phase. This solution does not involve any modification to the first exchange message. The main fields it contains are: the initiator's temporary public key, the encrypted initiator's static public key, the encrypted timestamp, etc., which are used for EDCH key negotiation and identity authentication of the communicating parties.
[0095] When the noise protocol responder is preparing to send the second exchange message, it will call the out-of-band quantum security key service A's interface to obtain the quantum key key (32 bytes) and quantum key identifier key_id, and put this quantum key identifier key_id as the PSK ID in the second exchange message and send it to the noise protocol initiator. The quantum key key is PSK. When the noise protocol initiator receives the PSK ID, it will call the quantum security key service B's interface to obtain the corresponding quantum key key by giving the PSK ID, that is, the quantum key identifier key_id. At this time, the quantum key key obtained by the noise protocol initiator and the noise protocol responder should be the same.
[0096] After the communicating parties obtain the PSK, they will use the PSK as one of the inputs of the derived key to generate the session key used by the communicating parties to ultimately encrypt subsequent data payloads. At this time, the final session key will have anti-quantum attack characteristics.
[0097] Based on the above content, the embodiment of the present application further provides a noise protocol method based on an out-of-band quantum key, the noise protocol supports a pre-shared key, the noise protocol is implemented by the communicating parties through a first communication link negotiation, the method is applied to either of the communicating parties, and the method mainly includes the following steps:
[0098] 1. In the handshake phase of the noise protocol, a key request message is sent to the first quantum key service provider.
[0099] 2. Receive the quantum key identifier fed back by the first quantum key service provider;
[0100] 3. Through the exchange of messages in the handshake phase, the quantum key identifier is sent to the other party of the communication, so that the other party can obtain the quantum key corresponding to the quantum key identifier from the second quantum key service provider, and the quantum key is the pre-shared key of the noise protocol. The quantum key identifier and the quantum key are pre-negotiated and generated by the first quantum key service provider and the second quantum key service provider using the second communication link.
[0101] Its specific implementation principle and details are shown in the above-mentioned steps S201-S203, which will not be repeated here. It should be noted that although in the above-mentioned embodiment, the operation of the method of the embodiment of the present application is described in a specific order, this does not require or imply that these operations must be performed in this specific order, or that all the operations shown must be performed to achieve the desired result. On the contrary, the steps depicted in the flow chart can change the execution order. Additionally or alternatively, some steps can be omitted, multiple steps can be merged into one step for execution, and / or one step can be decomposed into multiple steps for execution.
[0102] Based on the method in the above embodiment, illustratively, Figure 4The schematic diagram of a noise protocol implementation device based on an out-of-band quantum key provided by an embodiment of the present application is shown. The noise protocol supports a pre-shared key, and the noise protocol is implemented by negotiation between the two communicating parties through a first communication link, and the device is deployed on either of the two communicating parties. Figure 4 As shown, the noise protocol implementation device 400 includes:
[0103] A sending module 410 is used to initiate a key request message to a first quantum key service provider;
[0104] A receiving module 420 is used to receive a quantum key identifier fed back by a first quantum key service provider;
[0105] The communication module 430 is used to send the quantum key identifier to the other party of the communication so that the other party can obtain the quantum key from the second quantum key service provider, and the quantum key is the pre-shared key of the noise protocol; the quantum key identifier and the quantum key have a one-to-one correspondence, and the quantum key identifier and the quantum key are generated by the first quantum key service provider and the second quantum key service provider through negotiation using the second communication link.
[0106] Based on the method in the above embodiment, an embodiment of the present application provides an electronic device. The electronic device may include: at least one memory for storing a program; at least one processor for executing the program stored in the memory. Wherein, when the program stored in the memory is executed, the processor is used to execute the method described in the above embodiment. Exemplarily, the electronic device may be a mobile phone, a tablet computer, a desktop computer, a laptop computer, a handheld computer, a notebook computer, a server, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook, and a cellular phone, a personal digital assistant (personal digital assistant, PDA), an augmented reality (augmented reality, AR) device, a virtual reality (virtual reality, VR) device, an artificial intelligence (artificial intelligence, AI) device, a wearable device, a vehicle-mounted device, a smart home device and / or a smart city device. The embodiment of the present application does not impose any special restrictions on the specific type of the electronic device.
[0107] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from one website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid state disk (SSD)), etc.
[0108] It is understood that the various numerical numbers involved in the embodiments of the present application are only for the convenience of description and are not used to limit the scope of the embodiments of the present application. It should be understood that in the embodiments of the present application, the size of the sequence number of the above-mentioned processes does not mean the order of execution, and the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0109] The specific implementation methods described above further illustrate the purpose, technical solutions and beneficial effects of the present application in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present application. Any modifications, equivalent substitutions, improvements, etc. made on the basis of the technical solutions of the present application should be included in the scope of protection of the present application.
Claims
1. A method for implementing a noise protocol based on an out-of-band quantum key, wherein the noise protocol supports a pre-shared key PSK, and the noise protocol is implemented by two communicating parties through a first communication link through negotiation, comprising: In the quantum security key negotiation phase that is conducted in advance, the first quantum key service provider and the second quantum key service provider negotiate to obtain symmetric keys through the national secret algorithm, the post-quantum cryptography PQC algorithm, and the quantum key distribution QKD method, and then obtain the final quantum key by XORing or key derivation of the three pairs of symmetric keys; each quantum key service provider saves the generated quantum key in its key library, and saves the one-to-one correspondence between the quantum key identifier and the quantum key in the index table; During the handshake phase of the noise protocol: The first party of the communicating parties initiates a key request message to the first quantum key service provider; The first quantum key service provider randomly allocates a currently available quantum key identifier from the key library and sends it to the first party; The first party receives the quantum key identifier fed back by the first quantum key service provider; The first party sends the quantum key identifier to the second party of the communicating parties by setting a PSK variable in the exchange message of the handshake phase; The second party sends the quantum key identifier to a second quantum key service provider; The second quantum key service provider searches the index table for the quantum key identifier, finds the corresponding quantum key and returns it to the second party; The second party receives the corresponding quantum key from the second quantum key service provider as a pre-shared key of the noise protocol.
2. According to the method of claim 1, the first quantum key service provider also feeds back the quantum key; The method further comprises: The communicating parties negotiate and generate an exchange key using the first communication link based on an elliptic curve key exchange algorithm; The communicating parties respectively perform key derivation-based operations on the exchange key and the pre-shared key to generate the target session key of the communicating parties, and the target session key is used to encrypt data transmitted by the communicating parties.
3. According to the method of claim 1, the initiating a key request message to the first quantum key service provider comprises: Before each round of data transmission between the communicating parties, a key request message is sent to the first quantum key service provider; or Based on the key rotation mechanism of the noise protocol, a key request message is sent to the first quantum key service provider.
4. According to the method of claim 1, the initiating a key request message to the first quantum key service provider comprises: Use the representational state transfer application interface provided by the first quantum key service provider to initiate a key request message to the first quantum key service provider.
5. The method according to claim 1, wherein the pre-shared key complies with the IKpsk2 protocol, The sending the quantum key identifier to the other of the two communicating parties comprises: The quantum key identification is sent to the other party of the communication using the IKpsk2 protocol.
6. A system for implementing a noise protocol based on an out-of-band quantum key, characterized in that: The noise protocol supports a pre-shared key PSK, and the noise protocol is implemented by negotiation between two communicating parties through a first communication link. The system includes: a first quantum key service provider and a second quantum key service provider, as the first party and the second party of the communicating parties; wherein: The first quantum key service provider and the second quantum key service provider are used to obtain the final quantum key by XORing or key derivation of the three pairs of symmetric keys in the quantum security key negotiation phase performed in advance through the national secret algorithm, the post-quantum cryptography PQC algorithm, and the quantum key distribution QKD method, and save the generated quantum key in the key library, and save the one-to-one correspondence between the quantum key identifier and the quantum key in the index table; The first party is used to initiate a key request message to the first quantum key service provider during the handshake phase of the noise protocol; The first quantum key service provider is further configured to randomly allocate a currently available quantum key identifier from the key library and send the identifier to the first party; The first party is further configured to receive a quantum key identifier fed back by the first quantum key service provider; The first party is further configured to send the quantum key identifier to the second party by setting a PSK variable in an exchange message in the handshake phase; The second party is used to send the quantum key identifier to a second quantum key service provider; The second quantum key service provider is further configured to query the quantum key identifier in the index table, find the corresponding quantum key and return it to the second party; The second party is also used to receive a corresponding quantum key from a second quantum key service party as a pre-shared key of the noise protocol.
7. An electronic device, characterized in that: include: at least one memory for storing a program; At least one processor, configured to execute the program stored in the memory; wherein, when the program stored in the memory is executed, the processor is configured to execute the method according to any one of claims 1 to 5.
Citation Information
Patent Citations
A secure mobile electronic payment system where only the bank has the key, distributed key handshakes, one way and two way authentication distributed key processes and setting up a dynamic distributed key server
CA2886849A1
Negotiation system and negotiation method based on quantum truly random number negotiation secret key
CN106612176A
End-to-end encryption key acquisition method and device of WhatsApp, and related medium
CN115767518A
Key negotiation method and device based on preset key group, and communication system
CN116132025A
Encrypted communication based on quantum key
WO2020260751A1
