Quantum key transmission methods, devices and systems
By implementing two-way authentication between quantum devices and application devices and using post-quantum encryption algorithms, the security and reliability issues of quantum key transmission in classical networks are solved, and secure transmission of quantum keys is achieved.
Patent Information
- Application Number
- CN202210187877.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2022-02-14
- Filing Date
- 2022-02-28
- Publication Date
- 2025-11-14
- Estimated Expiration
- 2042-02-28
AI Technical Summary
How to securely and reliably transmit quantum keys in classical networks, resist quantum attacks, and ensure the confidentiality and integrity of quantum keys.
Secure transmission of quantum keys is achieved by performing two-way authentication between quantum devices and application devices, encrypting quantum keys using post-quantum encryption algorithms, and verifying message integrity and origin using message authentication codes.
It achieves secure and reliable transmission of quantum keys in classical networks, resists quantum attacks, and ensures key confidentiality and message integrity.
Smart Images

Figure CN116633530B_ABST
Abstract
Description
[0001] This application claims priority to Chinese Patent Application No. 202210132323.0, filed on February 14, 2022, entitled "A method, system and related apparatus for transmitting a key", the entire contents of which are incorporated herein by reference. Technical Field
[0002] This application relates to the field of network technology, and in particular to a quantum key transmission method, apparatus and system. Background Technology
[0003] With the development of quantum computers, quantum attacks pose a significant threat to currently widely used cryptographic systems. Quantum attacks are attack algorithms running on quantum computers capable of breaking widely used public-key cryptography algorithms such as RSA (Rift-Shamir-Adleman) and elliptic curve cryptography (ECC). Quantum computers are expected to be achievable within the next few decades. If an eavesdropper saves data encrypted using current encryption algorithms and transmitted over a network, and then uses a quantum attack to break the encryption algorithm of the saved data after quantum computers are implemented, they can obtain the decrypted plaintext data. This poses a huge threat to confidential information that needs to be stored long-term. Therefore, designing cryptographic technologies resistant to quantum attacks has become an urgent matter.
[0004] Quantum key distribution (QKD) is a secure key distribution technique that enables the secure transmission of keys between two geographically distant communication endpoints. The security of QKD is guaranteed by the fundamental principles of quantum mechanics. Therefore, in quantum networks, the transmission of quantum keys is theoretically unconditionally secure.
[0005] However, in scenarios where the application devices using quantum keys and the quantum devices distributing quantum keys are deployed in different security domains, the quantum devices need to transmit the quantum keys to the application devices through classical networks. Therefore, ensuring the security and reliability of quantum key transmission in classical networks is a pressing issue that needs to be addressed. Summary of the Invention
[0006] This application provides a quantum key transmission method, apparatus, and system that enables secure transmission of quantum keys in classical networks.
[0007] Firstly, a quantum key transmission method is provided. An application device sends a key request message to a quantum device. The key request message includes a user identifier corresponding to the application device, a first public key, and a first message authentication code value. The user identifier is used by the quantum device to obtain corresponding storage information. This storage information includes a shared key corresponding to the quantum device and the user identifier. The first public key is used by the quantum device to encrypt the quantum key information allocated to the application device. This quantum key information includes a quantum key. The first public key is the public key in the key pair obtained by the quantum key generation algorithm after the application device runs. The first message authentication code value is calculated by the application device based on the shared key and the first authentication information. The first authentication information includes the first public key. The application device receives a key response message corresponding to the key request message from the quantum device. This key response message includes a first ciphertext and a second message authentication code value. The application device verifies the second message authentication code value based on the shared key and the second authentication information. The second authentication information includes the first ciphertext. If the application device verifies the second message authentication code value successfully, the application device decrypts the first ciphertext using a first private key to obtain the quantum key information. The first private key is the private key in the key pair.
[0008] The user identifier is used to indicate the service recipient. This service recipient is the application device or the user account logged into the application device. If the key response message received by the application device confirms that it originates from the quantum device and has not been tampered with, the first ciphertext is obtained by the quantum device encrypting the quantum key information using the first public key. The second message authentication code is calculated by the quantum device based on the shared key and includes the first ciphertext.
[0009] Since the first public key used by the quantum device to encrypt quantum key information is obtained by the application device running the quantum key generation algorithm, the quantum device uses a post-quantum encryption algorithm to encrypt the quantum key and transmits it to the application device in ciphertext form, ensuring the confidentiality of the quantum key transmission. Furthermore, because the transmitted ciphertext is obtained using a post-quantum encryption algorithm, it is resistant to quantum attacks, preventing the quantum computer from cracking the ciphertext and causing the quantum key leakage. The first message authentication code value can be used by the quantum device to authenticate the application device (i.e., verify the reliability of the source of the key request message) and also by the quantum device to verify the message integrity of the key request message. The second message authentication code value can be used by the application device to authenticate the quantum device (i.e., verify the reliability of the source of the key response message) and also by the application device to verify the message integrity of the key response message. Therefore, in this application, the application device and the quantum device can perform bidirectional authentication and can also verify the message integrity of their respective received messages, while ensuring the confidentiality of the quantum key transmission. This achieves the security and reliability of quantum key transmission in classical networks. In addition, the process of an application device requesting a quantum key from a quantum device only requires one round of message exchange between the two parties to complete the transmission of the quantum key and the authentication of both parties, making the interaction process simple.
[0010] Optionally, the user identifier corresponding to the application device is the device identifier of the application device. In this case, the shared key between the quantum device and the user identifier is the shared key between the quantum device and the application device. Alternatively, the user identifier corresponding to the application device is the user account logged into the application device. In this case, the shared key between the quantum device and the user identifier is the shared key between the quantum device and the user account.
[0011] Optionally, the key request message also includes a first statistical value. Before the application device sends the key request message to the quantum device, the application device obtains the historical number of key request messages, including the user identifier. The application device increments a predetermined value by the historical number of messages to obtain the first statistical value.
[0012] In this application, a first statistical value is included in the key request message sent by the application device to assist the quantum device in detecting replay attacks.
[0013] Optionally, the key response message also includes a second statistical value. This second statistical value is the number of times the key request message, including the user identifier, has been sent, as recorded by the quantum device. After the application device receives the key response message corresponding to the key request message, if the second statistical value is not equal to the first statistical value, the application device stops the quantum key transmission process.
[0014] Since the quantum device updates its stored statistics based on the received key request messages, the number of key request messages sent should theoretically equal the number of key request messages sent recorded by the application device. If the statistics carried in the key response message do not equal the statistics recorded by the application device, it indicates that the key response message may have been repeatedly sent by an attacker, i.e., it may be a replay attack message. This achieves replay attack detection on the application device side. Optionally, if the statistics carried in the key response message are not equal to the statistics recorded by the application device, the application device also outputs an alarm. This alarm indicates that the key request is abnormal, helping relevant personnel to handle the anomaly in a timely manner.
[0015] Optionally, the first authentication information may also include one or more of the quantum device's identifier, user identifier, or first statistical value. The more content included in the authentication information, the higher the reliability of the authentication in theory.
[0016] Optionally, before the application device sends a key request message to the sub-device, the application device uses a key derivation function to generate a derived key based on the target password, and the shared key is obtained based on the derived key.
[0017] In this application, a derived key is used instead of the target password to obtain the shared key. When the application device and the quantum device synchronize the shared key, the application device only needs to send the derived key obtained based on the target password to the quantum device. Even if the derived key is stolen during transmission or stored in the quantum device, the thief cannot recover the target password used by the service recipient, thus preventing the thief from impersonating the service recipient to request the quantum key from the quantum device.
[0018] Optionally, before the application device sends a key request message to the quantum device, in response to receiving the input quantum key acquisition instruction, the application device runs a quantum key generation algorithm to generate a key pair. The quantum key acquisition instruction includes the target password. The application device calculates the first message authentication code value based on the first authentication information of the shared key pair.
[0019] In this application, whenever the application device receives a quantum key acquisition command, it runs a post-quantum key generation algorithm to generate a temporary key pair. This ensures that each time the application device requests a quantum key, the quantum device uses the public key temporarily generated by the application device to encrypt and protect the quantum key information, rather than using the quantum device's private key. This prevents the leakage of the private key used by the quantum device over a long period, thus ensuring the security of quantum key information transmitted between the quantum device and the application device during previous communications. This safeguards the security of the quantum keys historically acquired by the application device, thereby guaranteeing the security of the application device's historical communications.
[0020] Optionally, before sending a key request message to the quantum device, the application device sends a registration request message to the quantum device. The application device receives a registration response message corresponding to the registration request message from the quantum device. This registration response message includes the quantum device's certificate, which includes a second public key. If the application device verifies the certificate successfully, it uses the second public key to encrypt the registration information to obtain a second ciphertext, which includes a derived key and a user identifier. The application device then sends a registration message to the quantum device. This registration message includes the second ciphertext.
[0021] In this application, during the registration phase, the quantum device's authentication relies on a certificate, while the application device's authentication relies on a derived key obtained based on a password. The application device and the quantum device achieve mutual authentication. Furthermore, the registration information is transmitted in encrypted form, ensuring the confidentiality of the transmitted information.
[0022] Optionally, the registration request message indicates the cryptographic algorithms supported by the application device. The registration response message further indicates the target cryptographic algorithm selected by the quantum device from the cryptographic algorithms supported by the application device. The target cryptographic algorithm includes one or more of the following: a first message authentication code value generation algorithm, a second message authentication code value generation algorithm, or a shared key generation algorithm.
[0023] Optionally, the registration response message also includes key derivation function parameter values. These parameter values include a random salt value and / or the number of iterations. After receiving the registration response message corresponding to the registration request message, the application device obtains the user identifier and the target password. The application device then uses the key derivation function to generate a derived key based on the target password and the key derivation function parameter values.
[0024] Optionally, the registration message may also include the device identifier of the application device. The registration information may also include the hash value of the device identifier of the application device.
[0025] In this application, by carrying the device identifier of the application device in the registration message sent by the application device, and by making the registration information include the hash value of the device identifier of the application device, the quantum device side is assisted in realizing message integrity verification of the message sent by the application device to the quantum device.
[0026] Optionally, the registration information also includes a first random number generated by the application device. The application device receives a registration success response message from the quantum device. This registration success response message indicates that the user identifier has been successfully registered. The registration success response message includes a second random number. If the second random number is the same as the first random number, the application device determines that the user identifier has been successfully registered.
[0027] If the messages transmitted between the quantum device and the application device have not been tampered with, then the first random number and the second random number should be the same. This enables the application device to verify the message integrity of messages from the quantum device.
[0028] Optionally, the implementation method for the application device to verify the second message authentication code value based on the shared key and the second authentication information includes: the application device calculating a third message authentication code value based on the shared key and the second authentication information. If the third message authentication code value is the same as the second message authentication code value, the application device determines that the verification of the second message authentication code value has passed.
[0029] Optionally, the aforementioned application devices communicate with quantum devices via classical networks.
[0030] Secondly, a quantum key transmission method is provided. A quantum device receives a key request message from an application device. This key request message includes a user identifier corresponding to the application device, a first public key, and a first message authentication code value. The quantum device obtains first authentication information and stored information corresponding to the user identifier based on the key request message. This stored information includes a shared key corresponding to the quantum device and the user identifier. The first authentication information includes the first public key. The quantum device verifies the first message authentication code value based on the shared key and the first authentication information. If the quantum device verifies the first message authentication code value successfully, it encrypts the quantum key information using the first public key to obtain first ciphertext. The quantum key information includes the quantum key. The quantum device calculates a second message authentication code value based on the shared key and second authentication information. The second authentication information includes the first ciphertext. The quantum device sends a key response message corresponding to the key request message to the application device. The key response message includes the first ciphertext and the second message authentication code value.
[0031] The user identifier is used to indicate the service recipient. This service recipient is the application device or the user account logged into the application device. If the key request message received by the quantum device is confirmed to originate from the application device and has not been tampered with, then the first public key is the public key in the key pair obtained by the quantum key generation algorithm after the application device runs. The first message authentication code is calculated by the application device based on the first authentication information of the shared key pair.
[0032] Optionally, the user identifier corresponding to the application device is the device identifier of the application device. Alternatively, the user identifier corresponding to the application device is the user account logged into the application device.
[0033] Optionally, the key request message also includes a first statistical value. The first statistical value is the number of key request messages containing a user identifier sent, as recorded by the application device. The stored information corresponding to the user identifier includes a second statistical value. The second statistical value is the number of key request messages containing a user identifier sent, as recorded by the quantum device. After the quantum device obtains the stored information corresponding to the user identifier, if the second statistical value is greater than or equal to the first statistical value, the quantum device stops the quantum key transmission process. If the second statistical value is less than the first statistical value, the quantum device updates the second statistical value so that the updated second statistical value is equal to the first statistical value.
[0034] Since the number of key request messages sent recorded by the quantum device should be less than the number of key request messages sent recorded by the application device before updating the stored statistical values based on the received key request messages, if the first statistical value carried in the key request message is less than or equal to the second statistical value stored by the quantum device, it indicates that the key request message may have been repeatedly sent by an attacker, that is, the key request message may be a replay attack message, thus realizing replay attack detection on the quantum device side. Optionally, if the second statistical value is greater than or equal to the first statistical value, the quantum device also outputs an alarm message, which is used to indicate that this key request is abnormal, helping relevant personnel to handle abnormal situations in a timely manner.
[0035] Optionally, the key response message may also include an updated second statistic.
[0036] In this application, by carrying an updated second statistical value in the key response message sent by the quantum device, the application device side is assisted in realizing replay attack detection.
[0037] Optionally, the second authentication information may also include one or more of the quantum device's device identifier, user identifier, or updated second statistical value.
[0038] Optionally, the quantum device receives a registration request message from the application device. The quantum device then sends a registration response message to the application device. This response message includes the quantum device's certificate. The certificate includes a second public key. The second public key is the public key in the key pair obtained by the quantum key generation algorithm after the quantum device runs. If the quantum device receives a registration message containing a second ciphertext from the application device, the quantum device decrypts the second ciphertext using its second private key to obtain registration information. This registration information includes a derived key and a user identifier corresponding to the application device. The second private key is the private key in the key pair. The quantum device stores the storage information corresponding to the user identifier. This storage information includes a shared key obtained based on the derived key and the user identifier.
[0039] In this application, since the second public key used by the application device to encrypt the registration information is obtained by running a quantum key generation algorithm on the quantum device, the application device will use a post-quantum encryption algorithm to encrypt the registration information and transmit it to the quantum device in ciphertext form, thus ensuring the confidentiality of the registration information transmission. Furthermore, since the second ciphertext is obtained using a post-quantum encryption algorithm, it is resistant to quantum attacks, preventing the second ciphertext from being cracked by a quantum computer and causing the leakage of registration information.
[0040] Optionally, the registration request message indicates the cryptographic algorithms supported by the application device. The registration response message further indicates the target cryptographic algorithm selected by the quantum device from the cryptographic algorithms supported by the application device. The target cryptographic algorithm includes one or more of the following: a first message authentication code value generation algorithm, a second message authentication code value generation algorithm, or a shared key generation algorithm.
[0041] Optionally, the registration response message also includes a first key derivation function parameter value. The first key derivation function parameter value includes a random salt value and / or the number of iterations. The registration information also includes a second key derivation function parameter value. After the quantum device decrypts the second ciphertext using the second private key to obtain the registration information, the quantum device compares the first key derivation function parameter value with the second key derivation function parameter value. If the first key derivation function parameter value and the second key derivation function parameter value are the same, the quantum device stores the storage information corresponding to the user identifier.
[0042] Since the second key derivation function parameter value carried by the application device in the registration message comes from the first key derivation function parameter value in the registration response message received by the application device, the first key derivation function parameter value and the second key derivation function parameter value should be the same. If, after receiving the registration message, the quantum device finds that the second key derivation function parameter value carried in the registration message from the application device is different from the first key derivation function parameter value carried in the registration response message sent by the quantum device, it indicates that the registration message and / or the registration response message has been tampered with during transmission. This application, by comparing the first key derivation function parameter value and the second key derivation function parameter value using the quantum device, can achieve message integrity verification of bidirectional transmission messages between the quantum device and the application device.
[0043] Optionally, the registration message also includes the device identifier of the application device. The registration information also includes a first hash value of the device identifier of the application device. After the quantum device decrypts the second ciphertext using a second private key to obtain the registration information, the quantum device calculates a second hash value of the device identifier of the application device. The quantum device compares the first hash value with the second hash value. If the first hash value and the second hash value are the same, the quantum device stores the storage information corresponding to the user identifier.
[0044] If the first hash value carried in the registration message received by the quantum device differs from the second hash value calculated by the quantum device, it indicates that the registration message has been tampered with during transmission. This application enables message integrity verification of messages sent by the application device to the quantum device by comparing the first and second hash values using a quantum device.
[0045] Optionally, the registration information also includes a random number generated by the application device. After the quantum device stores the information corresponding to the user identifier, it sends a registration success response message to the application device. This registration success response message indicates that the user identifier has been successfully registered. The registration success response message includes the random number.
[0046] In this application, by carrying a random number from the registration information in the registration success response message sent by the quantum device, the application device is assisted in verifying the message integrity of the message from the quantum device.
[0047] Optionally, the implementation method for the quantum device to verify the first message authentication code value based on the shared key and the first authentication information includes: the quantum device calculating a fourth message authentication code value based on the shared key and the first authentication information. If the fourth message authentication code value is the same as the first message authentication code value, the quantum device determines that the verification of the first message authentication code value has passed.
[0048] Alternatively, the application device communicates with the quantum device via a classical network.
[0049] Thirdly, an application device is provided. The application device includes multiple functional modules that interact to implement the methods described in the first aspect and its various embodiments. The multiple functional modules can be implemented based on software, hardware, or a combination of both, and can be arbitrarily combined or divided based on specific implementations.
[0050] Fourthly, a quantum device is provided. The quantum device includes multiple functional modules that interact to implement the methods described in the second aspect and its various embodiments. The multiple functional modules can be implemented based on software, hardware, or a combination of both, and can be arbitrarily combined or divided based on specific implementations.
[0051] Fifthly, an application device is provided, comprising: a memory, a network interface, and at least one processor. The memory stores program instructions, and the at least one processor, after reading the program instructions stored in the memory, causes the application device to execute the methods described in the first aspect and its various embodiments.
[0052] In a sixth aspect, a quantum device is provided, comprising: a memory, a network interface, and at least one processor. The memory stores program instructions, and the at least one processor, after reading the program instructions stored in the memory, causes the application device to execute the methods described in the second aspect and its various embodiments.
[0053] A seventh aspect provides a quantum key transfer system, comprising: an application device and a quantum device. The application device is used to perform the methods described in the first aspect and its embodiments. The quantum device is used to perform the methods described in the second aspect and its embodiments.
[0054] Eighthly, a quantum key transmission system is provided, comprising: a first application device and a first quantum device. The first application device sends a key request message to the first quantum device. The key request message includes a user identifier corresponding to the first application device, a first public key, and a first message authentication code value. The first public key is the public key in the key pair obtained by the quantum key generation algorithm after the first application device runs. The first message authentication code value is calculated by the first application device based on the shared key pair between the quantum device and the user identifier, and the first authentication information includes the first public key. The first quantum device obtains the first authentication information and storage information corresponding to the user identifier based on the key request message. The storage information includes the shared key. The first quantum device verifies the first message authentication code value based on the shared key and the first authentication information. If the first quantum device verifies the first message authentication code value successfully, the first quantum device encrypts the quantum key information using the first public key to obtain first ciphertext. The quantum key information includes the quantum key. The first quantum device calculates a second message authentication code value based on the shared key and second authentication information. The second authentication information includes the first ciphertext. The first quantum device sends a key response message corresponding to a key request message to the first application device. The key response message includes a first ciphertext and a second message authentication code value. The first application device obtains second authentication information based on the key response message. The first application device verifies the second message authentication code value based on the shared key and the second authentication information. If the first application device verifies the second message authentication code value successfully, the first application device decrypts the first ciphertext using a first private key, which is the private key in the key pair, to obtain the quantum key information.
[0055] Optionally, the quantum key information also includes a key identifier for the quantum key. The system also includes a second application device and a second quantum device. The first quantum device is further used to send quantum key information to the second quantum device. The first application device is also used to send the key identifier to the second application device. The second application device is used to send a key acquisition request to the second quantum device, the key acquisition request including the key identifier. The second quantum device is used to send the quantum key to the second application device based on the key identifier. The first application device and the second application device communicate based on the quantum key.
[0056] Optionally, the first quantum device communicates with the second quantum device via a quantum network. The first quantum device communicates with the first application device via a classical network. The second quantum device communicates with the second application device via a classical network. The first application device communicates with the second application device via a classical network.
[0057] In a ninth aspect, a computer-readable storage medium is provided, wherein instructions are stored thereon, which, when executed by a processor of an application device, implement the methods of the first aspect and its embodiments described above; or, when executed by a processor of a quantum device, implement the methods of the second aspect and its embodiments described above.
[0058] In a tenth aspect, a computer program product is provided, comprising a computer program that, when executed by a processor of an application device, implements the methods described in the first aspect and its embodiments; or, when executed by a processor of a quantum device, implements the methods described in the second aspect and its embodiments.
[0059] In an eleventh aspect, a chip is provided, the chip including programmable logic circuitry and / or program instructions, which, when the chip is running, implement the methods of the first aspect and its embodiments described above, or the methods of the second aspect and its embodiments described above. Attached Figure Description
[0060] Figure 1 This is a schematic diagram of an application scenario provided by an embodiment of this application;
[0061] Figure 2 This is a schematic diagram illustrating the implementation process of a quantum key transmission method provided in an embodiment of this application;
[0062] Figure 3 This is a schematic diagram illustrating the implementation process of another quantum key transmission method provided in this application embodiment;
[0063] Figure 4 This is a schematic diagram of the structure of a key manager in an application device provided in an embodiment of this application;
[0064] Figure 5This is a schematic diagram of the structure of a key manager in a quantum device provided in an embodiment of this application;
[0065] Figure 6 This is a schematic diagram of the structure of a quantum key transmission system provided in an embodiment of this application;
[0066] Figure 7 This is a schematic diagram of the hardware structure of an application device provided in an embodiment of this application;
[0067] Figure 8 This is a schematic diagram of the hardware structure of a quantum device provided in an embodiment of this application;
[0068] Figure 9 This is a schematic diagram of the structure of an application device provided in an embodiment of this application;
[0069] Figure 10 This is a schematic diagram of the structure of a quantum device provided in an embodiment of this application. Detailed Implementation
[0070] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.
[0071] To facilitate readers' understanding of this application, some terms will be explained below.
[0072] 1. Classical computer: A physical device that uses binary (0 or 1) to store and process data. The application device involved in this application belongs to the category of classical computers.
[0073] 2. Quantum Computer: A quantum computer is a physical device that processes information according to the laws of quantum mechanics and the principles of quantum computing. Quantum computers use qubits to store and process data. Qubits have more states than binary digits. Quantum computers possess the capabilities of classical computers. Quantum computers can solve certain problems that are difficult for classical computers to solve more efficiently. The quantum device involved in this application belongs to the category of quantum computers.
[0074] 3. Classical network: A communication network composed of classical computers.
[0075] 4. Quantum Networks: These are novel secure communication networks that utilize quantum entanglement and quantum teleportation to bring true security to the network, representing a qualitative leap in computing and science. Communication between nodes via a quantum network can be understood as the sharing of quantum keys between nodes using quantum key distribution technology, and communication based on these quantum keys. During quantum key distribution, the quantum key is transmitted in the form of a quantum state. Because quantum communication lines cannot be eavesdropped on or intercepted, any eavesdropping will alter the quantum state, thus changing the communication content and preventing the original message from being detected. Therefore, secure transmission of quantum keys is possible. Quantum computers can communicate with each other via quantum networks.
[0076] 5. Quantum attack: refers to attack algorithms that run on quantum computers, such as Shor's algorithm and Grover's algorithm, which can efficiently crack certain passwords.
[0077] 6. Quantum Key Distribution (QKD): This is a secure key distribution technology that utilizes the Heisenberg uncertainty principle and the no-cloning theorem of quantum states in quantum mechanics. In the quantum key distribution process, a quantum device generates a quantum key and transmits it to another quantum device through a quantum network, thus forming a shared quantum key between the two quantum devices.
[0078] 7. Asymmetric Cryptography Algorithms: These are algorithms where the sender and receiver use different keys for encryption and decryption, also known as public-key cryptography. In asymmetric cryptography, there is a key pair: a private key and a public key. The private key is kept secret by the key pair owner and cannot be published. The public key is published by the key pair holder. Data encrypted with the public key can only be decrypted using the corresponding private key. Data signed with the private key can only be verified using the corresponding public key. Commonly used asymmetric cryptography algorithms include RSA and ECC.
[0079] 8. Post-quantum cryptography (PQC): A public-key cryptosystem that includes key generation, encryption, and decryption algorithms. The algorithms included in a PQC system are collectively referred to as post-quantum cryptographic algorithms. PQC algorithms are asymmetric cryptographic algorithms that can run on classical computers. They possess quantum resistance, meaning they are resistant to quantum attacks and cannot be broken by quantum computers. This quantum resistance does not rely on quantum mechanics but is based on mathematical problems that are currently unbreakable by quantum computers. PQC algorithms include subcategories such as those based on lattices, encoding, homology, or multiple variables.
[0080] 9. Digital Signature (or Signature for short): A method of protecting the sender's data. The sender uses their private key to sign the message. No third party without the private key can forge the signature. Any third party possessing the public key corresponding to the sender's private key can verify the signature to confirm the message's origin and integrity.
[0081] 10. Signature Verification (or Signature Check): After receiving the data, the recipient uses the public key to verify the signature, outputting a Boolean value indicating whether the signature is valid (verification passed) or invalid (verification failed). If the verification passes, it means the data has not been tampered with. If the verification fails, it means the data has been tampered with. Signature verification can be used to verify the integrity of data (untampered) and the reliability of the data source (not fake or forged data).
[0082] 11. Digital Certificate (or simply Certificate): A certificate serves as an identity document for a device, user, or application in the digital world. A certificate contains applicant information and the certificate authority's (CA) signature on the applicant's information. The applicant information includes the public key in the key pair held by the applicant. Optionally, the applicant information may also include the applicant's identity information. For example, if the applicant is a device, the applicant's identity information is a device identifier that uniquely identifies the device. Optionally, a device identifier may include, but is not limited to, one or more of the following: device serial number, device Media Access Control (MAC) address, or device Internet Protocol (IP) address. After receiving the certificate from the sender, the recipient verifies the certificate signature using the public key in the certificate authority's "unified key pair" (also known as the CA root certificate) to confirm whether the public key in the certificate originated from the sender.
[0083] 12. Message Authentication Code (MAC): Used to verify message integrity (untampered) and the reliability of the message source (not fake or forged data). The authentication principle of MAC is as follows: The sender and receiver pre-agree on a shared key. The sender uses the shared key to generate a MAC value for a message of arbitrary length and then transmits the message and the MAC value to the receiver. The receiver uses the shared key to generate the MAC value for the message and compares its generated MAC value with the MAC value received from the sender. If the MAC values match, the receiver determines that the message indeed came from the sender and has not been tampered with (verification passed). Conversely, if the MAC values do not match, the receiver can determine that the message did not come from the sender or has been tampered with during transmission (verification failed).
[0084] Quantum keys are generated and distributed by quantum devices. In scenarios where application devices and quantum devices are deployed in different security domains, if the application device needs to use the quantum key, the quantum key must be transmitted from the quantum device to the application device via a classical network. In this case, to enable secure communication based on quantum keys, the "last mile" problem of quantum key transmission must first be solved, namely, ensuring the security and reliability of quantum key transmission within the classical network. To ensure the security and reliability of quantum key transmission within the classical network, the following three issues need to be addressed.
[0085] First, there's the issue of authentication. The quantum key needs to be delivered to the correct target user, who then needs to verify the key's origin. Therefore, the quantum device and the application device need to be able to authenticate each other to resist spoofing attacks during interaction. Spoofing attacks include, for example, malicious applications impersonating legitimate applications to interact with the quantum device and steal the quantum key.
[0086] Second, there is the issue of confidentiality during transmission. Quantum keys need to be transmitted in ciphertext form over classical networks. Therefore, quantum devices require encryption algorithms to protect the quantum keys. Furthermore, the chosen encryption algorithm must be quantum-resistant to prevent the quantum computer from cracking it and causing the quantum keys to be leaked.
[0087] Third, there is the issue of message integrity. Both application devices and quantum devices need to ensure that received messages are tamper-proof. Therefore, both quantum devices and application devices need to be able to verify the integrity of received message content.
[0088] Based on this, this application proposes a technical solution for transmitting quantum keys. The application device and the quantum device cooperate to implement this technical solution. The application device sends a key request message to the quantum device, which includes a user identifier corresponding to the application device, a first public key, and a first message authentication code value. If the quantum device verifies the first message authentication code value, the quantum device sends a key response message to the application device, which includes a first ciphertext and a second message authentication code value. If the application device verifies the second message authentication code value, the application device uses its first private key to decrypt the first ciphertext to obtain the quantum key information allocated to the application device by the quantum device.
[0089] In this system, the first public key and the first private key are a key pair obtained by the quantum key generation algorithm after the application device runs. The first ciphertext is obtained by the quantum device encrypting the quantum key information allocated to the application device using the first public key. The quantum key information includes the quantum key itself. Since the first public key used by the quantum device to encrypt the quantum key information is obtained by the quantum key generation algorithm after the application device runs, the quantum device uses a post-quantum encryption algorithm to encrypt the quantum key and transmits it to the application device in ciphertext form, ensuring the confidentiality of the quantum key transmission. Furthermore, because the transmitted ciphertext is encrypted using a post-quantum encryption algorithm, it is resistant to quantum attacks, preventing the quantum computer from cracking the ciphertext and causing the quantum key to be leaked.
[0090] The first message authentication code value is calculated by the application device based on the shared key corresponding to the quantum device and the user identifier, and the first authentication information includes the first public key. After receiving a key request message from the application device, the quantum device obtains the first authentication information and the stored information corresponding to the user identifier in the key request message, which includes the shared key corresponding to the quantum device and the user identifier. Then, the quantum device verifies the first message authentication code value based on the obtained shared key and the first authentication information. If the quantum device verifies the first message authentication code value successfully, it indicates that the key request message comes from the other party holding the shared key, and the content carried by the key request message in the first authentication information (including the first public key) has not been tampered with during transmission. Therefore, the first message authentication code value can be used by the quantum device to authenticate the application device (i.e., verify the reliability of the source of the key request message), and it can also be used by the quantum device to verify the message integrity of the key request message.
[0091] The second message authentication code value is calculated by the quantum device based on the shared key corresponding to the quantum device and the user identifier, and the second authentication information includes the first ciphertext. After receiving the key response message from the quantum device, the application device obtains the second authentication information based on the key response message. Then, the application device verifies the second message authentication code value based on the shared key corresponding to the quantum device and the user identifier and the second authentication information. If the application device verifies the second message authentication code value successfully, it indicates that the key response message comes from the other party holding the shared key, and the content carried by the key response message in the second authentication information (including the first ciphertext) has not been tampered with during transmission. Therefore, the second message authentication code value can be used by the application device to authenticate the quantum device (i.e., verify the reliability of the source of the key response message), and it can also be used by the application device to verify the message integrity of the key response message.
[0092] Based on the above discussion, it is clear that by implementing this technical solution to transmit quantum keys, bidirectional authentication can be performed between the application device and the quantum device, and message integrity verification can be performed on the messages received by each device, while also ensuring the confidentiality of quantum key transmission. This achieves both security and reliability in transmitting quantum keys within classical networks.
[0093] The quantum key transfer method provided in this application has two implementation scenarios. In one scenario, a specific application device is the service target, and the quantum device is used to allocate quantum keys to that application device. In this scenario, the user identifier corresponding to the application device is the device identifier of the application device. The shared key corresponding to the quantum device and the user identifier is a shared key between the quantum device and the specific application device; that is, the party holding the shared key is the quantum device, and the other party is the specific application device. In another scenario, a user account is the service target, and the quantum device is used to allocate quantum keys to the application device logged into by the user account. In this scenario, the user identifier corresponding to the application device is the user account logged into the application device. The shared key corresponding to the quantum device and the user identifier is a shared key between the quantum device and the user account; the party holding the shared key is the quantum device, and the other party is any application device logged into by the user account.
[0094] The following section provides a detailed introduction to this technical solution from multiple perspectives, including application scenarios, methodology, functional modules, system, hardware devices, and software devices.
[0095] The following are examples illustrating the application scenarios of embodiments of this application.
[0096] For example, Figure 1 This is a schematic diagram illustrating an application scenario provided in an embodiment of this application. For example... Figure 1 As shown, this application scenario mainly involves two types of devices: application devices and quantum devices. Optionally, a quantum device is used to provide quantum services to one or more application devices; that is, a quantum device can allocate quantum keys to one or more application devices. Optionally, the quantum device and the application device communicate through a classical network. For example, the quantum device and the application device communicate based on Transmission Control Protocol / Internet Protocol (TCP / IP).
[0097] Optionally, the application device includes, but is not limited to, network devices such as routers, switches, or firewalls. Alternatively, the application device may be a terminal device such as a computer, mobile phone, or Internet of Things (IoT) terminal. Or, the application device may be other devices with communication needs, such as servers or cloud platforms. The quantum device is a quantum computer capable of generating or storing quantum keys. The quantum device in the embodiments of this application may also be referred to as a quantum key distribution device.
[0098] The method flow of the embodiments of this application is illustrated below.
[0099] For example, Figure 2 This is a schematic diagram illustrating the implementation flow of a quantum key transmission method 200 provided in an embodiment of this application. Figure 2 As shown, method 200 includes steps 201 to 208. Optionally, the quantum device in method 200 is... Figure 1 The quantum device in method 200. Figure 1 Any application device in the process.
[0100] Step 201: The application device sends a key request message to the sub-device. The key request message includes the user identifier corresponding to the application device, the first public key, and the first message authentication code value.
[0101] The user identifier corresponding to the application device in the key request message is used to indicate the service object of the quantum device, enabling the quantum device to obtain the storage information corresponding to that service object. That is, the user identifier corresponding to the application device is used by the quantum device to obtain the corresponding storage information. This storage information includes a shared key corresponding to the quantum device and the user identifier. Optionally, if the user identifier corresponding to the application device is the device identifier of the application device, then the shared key corresponding to the quantum device and the user identifier is a shared key between the quantum device and the application device. In this case, the shared key is pre-stored in the application device, and the application device can directly obtain the stored shared key. Alternatively, if the user identifier corresponding to the application device is a user account logged into the application device, then the shared key corresponding to the quantum device and the user identifier is a shared key between the quantum device and the user account. In this case, the shared key is bound to the user account, and after the user account logs in on the application device, the application device can obtain the shared key bound to that user account.
[0102] The first public key in the key request message is used by the quantum device to encrypt the quantum key information assigned to the application device that sent the key request message. The quantum key information includes the quantum key. Optionally, the quantum key information also includes a key identifier for the quantum key. In this embodiment, the private key corresponding to the first public key is referred to as the first private key. The first public key and the first private key are the public key and private key in the key pair obtained by the quantum key generation algorithm after the application device runs.
[0103] The first message authentication code value in the key request message is calculated by the application device based on the shared key corresponding to the quantum device and the user identifier, against the first authentication information. The first authentication information includes the first public key. Optionally, the first authentication information also includes the device identifier of the quantum device and / or the user identifier carried in the key request message. The first message authentication code value is used by the quantum device to authenticate the application device and to authenticate the message integrity of the key request message.
[0104] Optionally, a quantum device is used to distribute quantum keys to one or more service objects. Different service objects use different passwords for authentication by the quantum device. Optionally, the shared key between the quantum device and the user identifier is obtained based on a target password, which is the password used by the service object indicated by the user identifier.
[0105] Optionally, before executing step 201, in response to receiving the input quantum key acquisition instruction, the application device runs the quantum key generation algorithm to generate a key pair. The quantum key acquisition instruction includes a target password. Then, the application device calculates a first message authentication code value based on the first authentication information containing the first public key in the shared key pair. For example, when a user enters a target password on the application device, the application device determines that it has received the quantum key acquisition instruction. Optionally, when the number of incorrect password inputs on the application device reaches a preset threshold, the application device locks the password input interface. This embodiment of the application limits the number of attempts an attacker can make by limiting the number of incorrect password inputs, thus resisting online dictionary attacks.
[0106] Optionally, the first message authentication code value is the Hash Message Authentication Code (HMAC) value.
[0107] In this embodiment, whenever the application device receives a quantum key acquisition command, it runs a post-quantum key generation algorithm to generate a temporary key pair. This ensures that each time the application device requests a quantum key, the quantum device uses the public key temporarily generated by the application device to encrypt and protect the quantum key information, rather than using the quantum device's private key. This prevents the leakage of the private key used by the quantum device over a long period, thus ensuring the security of quantum key information transmitted between the quantum device and the application device during previous communications. This safeguards the security of previously acquired quantum keys by the application device, thereby protecting the security of the application device's historical communications.
[0108] Alternatively, when an application device requests a quantum key, it uses a fixed key pair. This eliminates the need for the application device to generate its own key pair upon receiving the quantum key retrieval command, thus improving the efficiency of quantum key acquisition. For example, when the service recipient is an application device, the application device pre-generates and stores a key pair. Upon receiving the quantum key retrieval command, the application device directly retrieves the public key from the stored key pair and calculates the message authentication code value. When the service recipient is a user account, the user account is pre-bound to a key pair. Upon receiving the quantum key retrieval command, the application device logged into that user account directly retrieves the public key from the key pair bound to that user account and calculates the message authentication code value.
[0109] Optionally, before executing step 201, the application device uses a key derivation function (KDF) to generate a derived key based on the target password. The key derivation function is used to derive one or more keys from a secret value using a pseudo-random function. The secret value is the original key, and the derived key is the derived key. For example, the use of a key derivation function is represented as: DK = KDF(Key, Salt, Iterations). Where DK is the derived key. KDF is the key derivation function. Key is the original key. Salt is a random number used as a cryptographic salt (hereinafter referred to as the random salt value). Iterations refers to the number of iterations. The random salt value and the number of iterations can be collectively referred to as the key derivation function parameter values. In this embodiment, the target password is used as part or all of the original key used by the key derivation function. The shared key corresponding to the quantum device and the user identifier is obtained based on this derived key. Optionally, the shared key being obtained based on the derived key includes: the shared key being the derived key, or the shared key being the hash value of the derived key.
[0110] In this embodiment, a derived key is used instead of the target password to obtain the shared key. When the application device and the quantum device synchronize the shared key, the application device only needs to send the derived key obtained based on the target password to the quantum device. Even if the derived key is stolen during transmission or stored in the quantum device, the thief cannot recover the target password used by the service recipient, thus preventing the thief from impersonating the service recipient to request the quantum key from the quantum device.
[0111] Optionally, the key derivation function used by the application device includes, but is not limited to, hash functions or password-based key derivation function 2 (PBKDF2). For example, if the application device uses PBKDF2 as the key derivation function, the target password is denoted as pwd, the random salt value is denoted as salt, and the number of iterations is denoted as i, then the derived key UK obtained based on the target password satisfies: UK = PBKDF2(pwd||secret, salt, i). Here, "secret" is a secret generated and maintained by the application device itself. In the embodiments of this application, the symbol "||" represents "and" or "union". By using pwd and secret together as the original key to generate the derived key, the application device can reduce the possibility of cracking and restoring the target password based on the derived key, and to a certain extent, resist offline dictionary attacks, thereby further improving the confidentiality and security of the target password.
[0112] Step 202: After receiving the key request message from the application device, the quantum device obtains the first authentication information and the storage information corresponding to the user identifier based on the key request message. The storage information includes the shared key between the quantum device and the user identifier.
[0113] The quantum device obtains first authentication information based on a key request message, including obtaining a first public key from the key request message. Optionally, the quantum device stores storage information corresponding to one or more user identifiers. The storage information corresponding to each user identifier includes a shared key between the quantum device and the user identifier, as well as the user identifier itself. The quantum device obtains the storage information corresponding to the user identifier based on the key request message; that is, the quantum device obtains the storage information corresponding to the user identifier carried in the key request message.
[0114] Step 203: The quantum device verifies the first message authentication code value based on the shared key and the first authentication information.
[0115] The first authentication information in step 203 is the authentication information obtained by the quantum device in step 202 based on the received key request message. If the key request message sent by the application device in step 201 has not been tampered with during transmission, then the first authentication information obtained by the quantum device in step 202 is consistent with the content of the first authentication information used by the application device in step 201 to calculate the first message authentication code value. Optionally, step 203 is implemented as follows: the quantum device calculates the fourth message authentication code value based on the shared key using the first authentication information. If the fourth message authentication code value is the same as the first message authentication code value, the quantum device determines that the verification of the first message authentication code value has passed. Conversely, if the fourth message authentication code value is different from the first message authentication code value, the quantum device determines that the verification of the first message authentication code value has failed.
[0116] If the quantum device successfully verifies the first message authentication code value, it indicates that the key request message received by the quantum device comes from the other party holding the shared key, and the content carried in the key request message in the first authentication information (including at least the first public key) has not been tampered with during transmission. In this case, the quantum device provides the quantum key to the requester. If the quantum device fails to verify the first message authentication code value, it indicates that the key request message received by the quantum device does not come from the other party holding the shared key, or the content carried in the key request message in the first authentication information has been tampered with during transmission. In this case, the quantum device does not provide the quantum key to the requester. In this embodiment, by carrying the first message authentication code value in the key request message sent by the application device, the quantum device can authenticate the application device (i.e., verify the reliability of the source of the key request message) and verify the message integrity of the key request message.
[0117] Step 204: If the quantum device verifies the first message authentication code value, the quantum device uses the first public key to encrypt the quantum key information to obtain the first ciphertext.
[0118] The quantum key information includes the quantum key. Optionally, the quantum key information also includes the key identifier of the quantum key.
[0119] Since the first public key used by the quantum device to encrypt quantum key information is obtained by the application device running the quantum key generation algorithm, the quantum device uses a post-quantum encryption algorithm to encrypt the quantum key and transmits it to the application device in ciphertext form, ensuring the confidentiality of the quantum key transmission. Furthermore, because the first ciphertext is obtained using the post-quantum encryption algorithm, it is resistant to quantum attacks, preventing the quantum computer from cracking the first ciphertext and causing the quantum key to be leaked.
[0120] Optionally, after determining the quantum key information assigned to the application device, the quantum device adds the quantum key information to the storage information corresponding to the user identifier of the application device, so that when other application devices need to communicate with the application device based on the quantum key, the quantum device can directly or indirectly provide the quantum key used by the application device to other application devices, thereby realizing secure communication between application devices.
[0121] Step 205: The quantum device calculates the second message authentication code value based on the shared key pair of the second authentication information, the second authentication information including the first ciphertext.
[0122] Optionally, the second authentication information may also include the device identifier of the quantum device and / or the user identifier carried in the key request message. Optionally, the second message authentication code value is a hash message authentication code (HMAC) value.
[0123] Step 206: The quantum device sends a key response message corresponding to the key request message to the application device. The key response message includes a first ciphertext and a second message authentication code value.
[0124] Step 207: After receiving the key response message from the quantum device, the application device verifies the second message authentication code value based on the shared key and the second authentication information.
[0125] The second authentication information in step 207 is the authentication information obtained by the application device based on the received key response message. If the key response message sent by the quantum device in step 206 has not been tampered with during transmission, then the authentication information obtained by the application device based on the key response message is consistent with the content of the second authentication information used by the application device in step 205 to calculate the second message authentication code value. Optionally, step 207 can be implemented as follows: the application device calculates the third message authentication code value based on the shared key using the second authentication information. If the third message authentication code value is the same as the second message authentication code value, the application device determines that the verification of the second message authentication code value has passed. Conversely, if the third message authentication code value is different from the second message authentication code value, the application device determines that the verification of the second message authentication code value has failed.
[0126] If the application device verifies the second message authentication code value, it indicates that the key response message received by the application device comes from the other party holding the shared key, and the content carried by the key response message in the second authentication information (including at least the first ciphertext) has not been tampered with during transmission. In this case, it indicates that the quantum key information carried in the key response message is reliable, and the application device further extracts the quantum key information carried in the key response message. If the application device fails to verify the second message authentication code value, it indicates that the key response message received by the application device does not come from the other party holding the shared key, or the content carried by the key response message in the second authentication information has been tampered with during transmission. In this case, it indicates that the quantum key information carried in the key response message is unreliable, and the application device no longer processes the information in the key response message. In this embodiment, by carrying the second message authentication code value in the key response message sent by the quantum device, the application device can authenticate the quantum device (i.e., verify the reliability of the source of the key response message) and verify the message integrity of the key response message.
[0127] Step 208: If the application device verifies the second message authentication code value, the application device uses the first private key to decrypt the first ciphertext to obtain the quantum key information.
[0128] Optionally, the stored information corresponding to the user identifier in the quantum device includes a second statistical value, which is the number of times the quantum device records the transmission of key request messages including the user identifier. The key request message also includes a first statistical value, which is the number of times the application device records the transmission of key request messages including the user identifier. Optionally, the first authentication information also includes the first statistical value. If the service target is an application device, the first statistical value is the number of times the application device sends key request messages including its device identifier (user identifier). Specifically, a counter is set in the application device to record the number of key request message transmissions. Each time the application device sends a key request message, the counter is incremented by a set increment value. If the service target is a user account, the first statistical value is the number of times all application devices logged into by the user account send key request messages including the user account (user identifier).
[0129] Optionally, before the application device sends a key request message including the user identifier to the quantum device (i.e., before executing step 201), the application device obtains the historical transmission count of the key request message including the user identifier. The application device adds a predetermined increment to this historical transmission count to obtain a first statistical value. That is, the first statistical value calculated by the application device includes the key request message sent this time. Optionally, the increment is set to 1. Accordingly, after receiving the key request message, if the second statistical value in the stored information corresponding to the obtained user identifier is greater than or equal to the first statistical value, the quantum device stops the quantum key transmission process. If the second statistical value is less than the first statistical value, the quantum device updates the second statistical value so that the updated second statistical value is equal to the first statistical value. Before the quantum device updates the stored statistical value based on the received key request message, the number of key request message transmissions recorded should be less than the number of key request message transmissions recorded by the application device. If the first statistical value carried in the key request message is less than or equal to the second statistical value stored in the quantum device, it indicates that the key request message may have been repeatedly sent by an attacker, meaning it may be a replay attack message. This achieves replay attack detection on the quantum device side. Optionally, if the second statistical value in the stored information corresponding to the obtained user identifier is greater than or equal to the first statistical value, the quantum device also outputs an alarm. This alarm indicates that the key request is abnormal, helping relevant personnel to handle the anomaly in a timely manner.
[0130] Optionally, if the quantum device determines that the second statistical value is less than the first statistical value, it then verifies the first message authentication code value (i.e., performs step 203).
[0131] Optionally, the key response message also includes an updated second statistical value. Optionally, the second authentication information also includes an updated second statistical value. After receiving the key response message, if the statistical value (updated second statistical value) carried in the key response message is not equal to the statistical value (first statistical value) recorded by the application device, the application device stops the quantum key transmission process. After the quantum device updates the stored statistical value based on the received key request message, the number of key request messages sent should be equal to the number of key request messages sent recorded by the application device. If the statistical value carried in the key response message is not equal to the statistical value recorded by the application device, it indicates that the key response message may have been repeatedly sent by an attacker, that is, the key response message may be a replay attack message, thus realizing replay attack detection on the application device side. Optionally, if the statistical value carried in the key response message is not equal to the statistical value recorded by the application device, the application device also outputs an alarm prompt, which is used to indicate that this key request is abnormal, helping relevant personnel to handle abnormal situations in a timely manner.
[0132] Optionally, if the updated second statistical value is equal to the first statistical value, the application device will then verify the second message authentication code value (i.e., perform step 207).
[0133] The quantum key transmission method provided in this application embodiment enables bidirectional authentication between the application device and the quantum device during the process of the application device requesting a quantum key from the quantum device. It also allows for message integrity verification of each device's received messages, while ensuring the confidentiality of the quantum key transmission. This achieves the security and reliability of quantum key transmission in classical networks. Furthermore, the process of the application device requesting a quantum key from the quantum device requires only one round of message interaction (key request message and key response message) to complete the quantum key transmission and mutual authentication, simplifying the interaction process. Additionally, in this application embodiment, the bidirectional authentication and message integrity verification between the application device and the quantum device are based on message authentication codes. In contrast, existing authentication key exchange schemes based on the certificates of both communicating parties, such as Transport Layer Security (TLS) bidirectional authentication, require one communicating party to sign the message using its private key during the handshake phase, and the other party to verify the signature using its corresponding public key, to ensure the legitimacy of the message source and the integrity of its content. On the one hand, since the computational efficiency of message authentication codes is higher than that of signatures, the application device will obtain keys more efficiently than existing authentication key exchange schemes. On the other hand, since primitives such as message authentication codes are resistant to quantum attacks, while the signature algorithms used by existing communicators are generally not quantum resistant, the reliability of the authentication of both parties and message integrity verification in this application scheme is higher than that of existing authentication key exchange schemes.
[0134] Optionally, the technical solution of this application is divided into two implementation stages: a registration stage and a quantum key acquisition stage. In the registration stage, the service object completes registration on the quantum device to establish initial mutual trust with the quantum device. This registration includes synchronizing the shared key between the service object and the quantum device. In the quantum key acquisition stage, the service object completes mutual authentication with the quantum device and transmits the quantum key. For example, method 200 described above outlines the implementation process of the quantum key acquisition stage. The registration stage and the quantum key acquisition stage are independent of each other. After completing one registration, the service object can request the quantum key from the quantum device multiple times. For example, if the service object is an application device, after registering on the quantum device, the application device can execute the quantum key acquisition process multiple times to obtain the quantum key from the quantum device. As another example, if the service object is a user account, the user account logs into an application device to complete registration on the quantum device. Afterward, the user account can log into that application device or other application devices multiple times, enabling each logged-in application device to execute the quantum key acquisition process to obtain the quantum key from the quantum device. It is worth noting that when the service target is an application device, the application device that completes the registration process with the quantum device and the application device requesting the quantum key from the quantum device can only be the same application device. In this case, the application device in method 200 above and the application device in method 300 below are the same application device. When the service target is a user account, the application device that completes the registration process with the quantum device and the application device requesting the quantum key from the quantum device can be the same application device logged into the same user account or different application devices. In this case, the application device in method 200 above and the application device in method 300 below are application devices logged into the same user account (the same device or different devices).
[0135] The following embodiments of this application illustrate the implementation process of the registration phase. For example, Figure 3 This is a schematic diagram illustrating the implementation flow of a quantum key transmission method 300 provided in this application embodiment. Method 300 only shows the implementation flow of the registration phase. After the application device completes registration on the quantum device, the process of requesting a quantum key from the quantum device can refer to the above-described method 200, and will not be repeated here. Figure 3 As shown, method 300 includes steps 301 to 310.
[0136] Step 301: The application device sends a registration request message to the quantum device.
[0137] The registration request message is used to initiate a registration process for a quantum device. Optionally, the registration request message indicates the cryptographic algorithms supported by the application device. For example, the registration request message indicates the message authentication code generation algorithm, key derivation function algorithm, or post-quantum cryptography algorithm supported by the application device.
[0138] Step 302: After receiving the registration request message from the application device, the quantum device sends a registration response message to the application device. The registration response message includes the certificate of the quantum device, which includes a second public key.
[0139] The second public key is the public key in the key pair held by the quantum device. In this embodiment, the private key corresponding to the second public key is referred to as the second private key. The second public key and the second private key are the public key and private key in the key pair obtained by the quantum key generation algorithm after the quantum device runs.
[0140] Optionally, the registration response message also instructs the quantum device to select a target cryptographic algorithm from the cryptographic algorithms supported by the application device. The target cryptographic algorithm includes one or more of the following: a first message authentication code value generation algorithm (i.e., the algorithm used by the application device to calculate the first message authentication code value in step 201 above), a second message authentication code value generation algorithm (i.e., the algorithm used by the quantum device to calculate the second message authentication code value in step 205 above), or a shared key generation algorithm (i.e., the algorithm for obtaining the shared key based on the derived key in step 201 above). Optionally, the target key algorithm also includes a post-quantum cryptographic algorithm used by the application device to generate the first public key and the first private key (step 201), and / or, a post-quantum cryptographic algorithm used by the quantum device to generate the second public key and the second private key (step 302). This enables the application device to encrypt and decrypt ciphertext using a matching post-quantum encryption algorithm or a post-quantum decryption algorithm.
[0141] Step 303: After the application device receives the registration response message corresponding to the registration request message from the quantum device, if the application device verifies the certificate of the quantum device successfully, the application device obtains the user identifier and target password.
[0142] The certificate for the quantum device also includes a signature from a third-party certification authority (such as a CA). The application device authenticates the quantum device based on this certificate. Successful verification of the quantum device's certificate by the application device means that the application device has verified the certificate signature using the public key provided by the third-party certification authority. This allows the application device to confirm that the public key in the certificate indeed originates from the quantum device, thus preventing spoofing attacks. The target password obtained by the application device is the password corresponding to the user identifier obtained by the application device. In this embodiment, the password corresponding to the user identifier is used as the access password for the service object indicated by the user identifier to request services from the quantum device.
[0143] Optionally, if the registration request message is used to request the application device that sent the registration request message to be used as a service object, the application device will use its own device identifier as the user identifier. If the registration request message is used to request the registration of a user account as a service object, the application device will create a user account after receiving the registration response message and use the created user account as the user identifier.
[0144] Optionally, the target password is entered by the user. After receiving the registration response message, the application device displays a password input interface to prompt the user to enter a password. The application device then uses the user's input as the target password.
[0145] Step 304: The application device uses a key derivation function to generate a derived key based on the target password.
[0146] Optionally, the registration response message also includes a key derivation function parameter value, which includes a random salt value and / or the number of iterations. The quantum device, by carrying the key derivation function parameter value in the registration response message, indicates to the application device the random salt value and / or the number of iterations used when generating the derived key using the key derivation function. In this case, step 304 is implemented as follows: the application device uses the key derivation function to generate the derived key based on the target password and the key derivation function parameter value in the registration response message. The specific implementation of step 304 can be found in the relevant description in step 201 above, and will not be repeated here.
[0147] Step 305: The application device uses the second public key to encrypt the registration information to obtain the second ciphertext, which includes the derived key and the user identifier.
[0148] Optionally, if the registration response message includes a key derivation function parameter value, the application device will use the key derivation function parameter value obtained from the registration response message as part of the registration information; that is, the registration information includes the key derivation function parameter value. For ease of description, this embodiment refers to the key derivation function parameter value in the registration response message as the first key derivation function parameter value, and the key derivation function parameter value in the registration information as the second key derivation function parameter value.
[0149] Since the second public key used by the application device to encrypt registration information is obtained by running a quantum key generation algorithm on the quantum device, the application device will use a post-quantum encryption algorithm to encrypt the registration information and transmit it to the quantum device in ciphertext form, ensuring the confidentiality of the registration information transmission. Furthermore, because the second ciphertext is obtained using a post-quantum encryption algorithm, it is resistant to quantum attacks, preventing the second ciphertext from being cracked by a quantum computer and causing the leakage of registration information.
[0150] Optionally, the registration information may also include one or more of the following: key derivation function parameter value, device identifier of the quantum device, hash value of device identifier of the application device, or random number generated by the application device.
[0151] Step 306: The application device sends a registration message to the quantum device. The registration message includes a second ciphertext.
[0152] Optionally, the registration message may also include the device identifier of the application device. The registration information may also include a first hash value of the device identifier of the application device.
[0153] Step 307: After receiving the registration message from the application device, the quantum device uses the second private key to decrypt the second ciphertext to obtain the registration information.
[0154] Step 308: The quantum device stores the storage information corresponding to the user identifier.
[0155] The user identifier in step 308 is the user identifier obtained by the quantum device from the registration information decrypted in step 307. The stored information corresponding to the user identifier includes the user identifier and the shared key corresponding to the user identifier. This shared key is obtained based on the derived key in the registration information. For example, the quantum device uses the derived key in the registration information as the shared key corresponding to the user identifier in the registration information. Alternatively, the quantum device uses the hash value of the derived key in the registration information as the shared key corresponding to the user identifier in the registration information. It is only necessary to ensure that the processing method for obtaining the shared key based on the derived key is the same for both the application device and the quantum device. Optionally, the stored information corresponding to the user identifier in the registration information also includes some or all of the content in the registration information other than the user identifier. For example, the stored information corresponding to the user identifier stored in the quantum device includes the user identifier, the shared key corresponding to the user identifier, the random salt value and the number of iterations used by the application device to calculate the derived key, and the number of times the key request message including the user identifier was sent, as recorded by the quantum device. The initial value of this number of transmissions is 0.
[0156] Optionally, when the registration response message includes a first key derivation function parameter value and the registration information includes a second key derivation function parameter value, the quantum device first compares the first key derivation function parameter value with the second key derivation function parameter value. If the first key derivation function parameter value and the second key derivation function parameter value are the same, the quantum device stores the storage information corresponding to the user identifier in the registration information.
[0157] Since the second key derivation function parameter value carried by the application device in the registration message comes from the first key derivation function parameter value in the registration response message received by the application device, the first key derivation function parameter value and the second key derivation function parameter value should be the same. If, after receiving the registration message, the quantum device finds that the second key derivation function parameter value carried in the registration message from the application device is different from the first key derivation function parameter value carried in the registration response message sent by the quantum device, it indicates that the registration message and / or the registration response message has been tampered with during transmission. This embodiment of the application, by comparing the first key derivation function parameter value and the second key derivation function parameter value using the quantum device, can achieve message integrity verification of bidirectional transmission messages between the quantum device and the application device.
[0158] Optionally, when the registration message includes the device identifier of the application device and the registration information includes a first hash value of the device identifier of the application device, the quantum device, after obtaining the registration information, calculates a second hash value of the device identifier of the application device in the registration information. Then, the quantum device compares the first hash value carried in the registration message with the calculated second hash value. If the first hash value and the second hash value are the same, the quantum device stores the storage information corresponding to the user identifier.
[0159] If the first hash value carried in the registration message received by the quantum device is different from the second hash value calculated by the quantum device, it indicates that the registration message has been tampered with during transmission. This embodiment of the application, by comparing the first and second hash values using a quantum device, can verify the message integrity of messages sent by the application device to the quantum device.
[0160] Optionally, the registration information also includes a first random number generated by the application device. After storing the information corresponding to the user identifier in the registration information in the quantum device, the following steps 309 to 310 are then executed.
[0161] Step 309: The quantum device sends a registration success response message to the application device. The registration success response message is used to indicate that the user identifier in the registration information has been successfully registered. The registration success response message includes a second random number, which comes from the registration information.
[0162] After obtaining a first random number from the registration information, the quantum device carries this first random number in the registration success response message. For ease of description, this embodiment refers to the random number in the registration information as the first random number and the random number in the registration success response message as the second random number. If the messages transmitted between the quantum device and the application device are not tampered with, then the first random number and the second random number should be the same.
[0163] Step 310: After receiving the registration success response message from the quantum device, if the second random number is the same as the first random number generated by the application device, the application device determines that the user identifier has been successfully registered.
[0164] The application device determines that the user identifier has been successfully registered, that is, the application device determines that the service object indicated by the user identifier has been registered on the quantum device.
[0165] In this embodiment, the application device's authentication is based on a password. The quantum device's authentication during the registration phase relies on a certificate, while during the quantum key acquisition phase, it relies on a derived key obtained from the password. Both the application device and the quantum device perform mutual authentication, ensuring the security and reliability of quantum key transmission. Furthermore, during the registration phase, the application device encrypts the registration information using the public key obtained from the quantum encryption algorithm run by the quantum device, and transmits the registration information to the quantum device in ciphertext. During the quantum key acquisition phase, the quantum device encrypts the quantum key using the public key obtained from the quantum key generation algorithm run by the application device, and transmits the quantum key to the application device in ciphertext. This ensures the confidentiality of message transmission between the quantum device and the application device, and the transmitted ciphertext is resistant to quantum attacks, thus reducing the risk of message leakage.
[0166] The order of steps in the quantum key transfer method provided in this application can be adjusted appropriately, and steps can be added or removed as needed. Any variations that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the protection scope of this application.
[0167] The functional modules of quantum devices and application devices are illustrated below.
[0168] Both the quantum device and the application device provided in this application embodiment are equipped with a key manager. The core functions of the solution in this application are implemented by the key managers of the quantum device and the application device, respectively.
[0169] For example, Figure 4 This is a schematic diagram of the structure of a key manager in an application device provided in an embodiment of this application. For example... Figure 4As shown, the key manager in the application device includes a quantum service registration module and a quantum key request module. The quantum service registration module is responsible for registering the quantum device as a service recipient and providing the necessary identity materials to the quantum device, specifically executing steps 301, 303 to 306, and 310 as described above. The quantum key request module includes an identity authentication module and a quantum key decapsulation module. The identity authentication module is responsible for authenticating the interacting quantum device during the quantum key acquisition process, specifically executing step 207 as described above. The quantum key decapsulation module is responsible for decapsulating the quantum key information sent by the quantum device to extract the actual quantum key, specifically executing step 208 as described above.
[0170] For example, Figure 5 This is a schematic diagram of the structure of a key manager in a quantum device provided in an embodiment of this application. Figure 5 As shown, the key manager in the quantum device includes a registration request processing module and a quantum key request processing module. The registration request processing module handles registration requests from application devices, specifically executing steps 302 and 307 to 309 as described above. The quantum key request processing module includes an authentication module and a quantum key encapsulation module. The authentication module is responsible for authenticating the interacting application devices, specifically executing step 203 as described above. The quantum key request processing module is responsible for encapsulating quantum key information, specifically executing step 204 as described above, to ensure the confidentiality of quantum key transmission in the classical network.
[0171] The following are examples illustrating the systems involved in the embodiments of this application.
[0172] This application also provides a quantum key transfer system, including an application device and a quantum device. The application device interacts with the quantum device, enabling the application device to obtain a quantum key from the quantum device. For detailed operation of the application device and the quantum device, please refer to the implementation flow of the quantum key acquisition stage described in method 200 above. For example, the application device is used to execute steps 201 and steps 207 to 208 in method 200 above. The quantum device is used to execute steps 202 to 206 in method 200 above.
[0173] Optionally, the application device also interacts with the quantum device, enabling the application device to register service objects on the quantum device. For detailed instructions on the operation of the application device and the quantum device, please refer to the implementation flow of the registration phase described in method 300 above. For example, the application device executes steps 301, 303 through 306, and 310 of method 300 above. The quantum device executes steps 302 and 307 through 309 of method 300 above.
[0174] For example, Figure 6 This is a schematic diagram of the structure of a quantum key transmission system provided in an embodiment of this application. Figure 6 As shown, the system includes a first application device and a first quantum device. The first application device registers itself on the first quantum device, or the user account logged into the first application device registers itself on the first quantum device; the specific registration process can be found in the description of method 300 above. The first quantum device can provide quantum services to the first application device. Optionally, when the first application device is the communication initiator, it requests a quantum key from the first quantum device. The process by which the first application device requests a quantum key from the first quantum device can be found in the description of method 200 above.
[0175] For example, a first application device sends a key request message to a first quantum device. This key request message includes a user identifier corresponding to the first application device, a first public key, and a first message authentication code value. The first public key is the public key in the key pair obtained by the quantum key generation algorithm after the first application device runs. The first message authentication code value is calculated by the first application device based on the shared key pair corresponding to the quantum device and the user identifier, representing first authentication information. The first authentication information includes the first public key. The first quantum device obtains the first authentication information and the storage information corresponding to the user identifier based on the key request message. This storage information includes the shared key. The first quantum device verifies the first message authentication code value based on the shared key and the first authentication information. If the first quantum device verifies the first message authentication code value successfully, it encrypts the quantum key information using the first public key to obtain first ciphertext. This quantum key information includes the quantum key. The first quantum device calculates a second message authentication code value based on the shared key and second authentication information. The second authentication information includes the first ciphertext. The first quantum device sends a key response message corresponding to the key request message to the first application device. This key response message includes the first ciphertext and the second message authentication code value. The first application device is used to obtain the second authentication information based on the key response message. The first application device is used to verify the second message authentication code value based on the shared key and the second authentication information. If the first application device successfully verifies the second message authentication code value, the first application device uses the first private key to decrypt the first ciphertext to obtain the quantum key information. The first private key is the private key in the key pair obtained by the quantum key generation algorithm after the first application device runs. The first private key is the private key corresponding to the first public key.
[0176] Optionally, the quantum key information assigned by the first quantum device to the first application device may also include the key identifier of the quantum key.
[0177] Optionally, please continue to see Figure 6The system also includes a second application device and a second quantum device. The second application device registers itself on the second quantum device, or the user account logged into the second application device registers itself on the second quantum device; the specific registration process can be found in the description of method 300 above. The second quantum device can provide quantum services to the second application device. Optionally, when the second application device is the communication receiver, it requests the quantum key of the communication initiator from the second quantum device.
[0178] For example, the first quantum device is also used to send quantum key information to the second quantum device. The first application device is also used to send a key identifier to the second application device. The second application device is used to send a key acquisition request to the second quantum device, the key acquisition request including the key identifier. The second quantum device is used to send a quantum key to the second application device based on the key identifier. The first application device and the second application device are used to communicate based on the quantum key.
[0179] The method by which the second application device sends a key acquisition request to the second quantum device can refer to the method in method 200 where the application device sends a key request message to the quantum device, and the specific process can refer to step 201 in method 200. For example, the key acquisition request includes a key identifier, which instructs the second quantum device to acquire the quantum key indicated by the key identifier, compared to the key request message. The method by which the second quantum device processes the key acquisition request can refer to the method by which the quantum device processes the key request message in method 200, and the specific process can refer to steps 202 to 206 in method 200. The difference is that the encryption object of the second quantum device here is the quantum key indicated by the key identifier. Correspondingly, the method by which the second application device processes the ciphertext obtained from encrypting the quantum key from the second quantum device can refer to the method by which the application device processes the key response message in method 200, and the specific process can refer to steps 207 to 208 in method 200.
[0180] Optionally, please continue to see Figure 6 The first quantum device communicates with the second quantum device via a quantum network. The first quantum device communicates with the first application device via a classical network. The second quantum device communicates with the second application device via a classical network. The first application device communicates with the second application device via a classical network.
[0181] Figure 6 The system illustrated uses an example where the quantum device providing quantum services to the first application device (the first quantum device) and the quantum device providing quantum services to the second application device (the second quantum device) are different. If the first application device and the second application device are provided with quantum services by the same quantum device, then the step of synchronizing quantum key information between the two quantum devices is omitted when implementing the technical solution.
[0182] The quantum key transmission system provided in this application embodiment enables secure and reliable transmission of quantum keys from quantum devices across security domains to application devices. When two application devices communicating via a classical network need to communicate using quantum keys, the initiator obtains the quantum key and key identifier from the corresponding quantum device. Then, the initiator synchronizes the key identifier with the receiver via the classical network. If the initiator and receiver are provided with quantum services by different quantum devices, the quantum device corresponding to the initiator also synchronizes the quantum key and key identifier with the quantum device corresponding to the receiver. In this way, the receiver can request the quantum key corresponding to the key identifier from the corresponding quantum device, enabling communication between the two parties based on the quantum key. Since the process of transmitting the quantum key from the quantum device to the application device is secure and reliable, and the transmission of the quantum key through the quantum network is always secure, and what is transmitted between the two application devices is the key identifier of the quantum key, not the quantum key itself, an eavesdropper cannot steal the quantum key during the communication between the two application devices. Therefore, the entire process of both parties obtaining the quantum key is secure and reliable, thereby improving communication security and reliability.
[0183] The following example illustrates the basic hardware structure of a quantum device.
[0184] For example, Figure 7 This is a schematic diagram of the hardware structure of an application device provided in an embodiment of this application. For example... Figure 7 As shown, the application device 700 includes a processor 701 and a memory 702, and the memory 701 and memory 702 are connected via a bus 703. Figure 7 The processor 701 and memory 702 are described independently. Alternatively, the processor 701 and memory 702 are integrated together. Alternatively, they are combined... Figure 1 Let's take a look. Figure 7 The application device 700 is Figure 1 Any of the application devices shown.
[0185] The memory 702 is used to store computer programs, including the operating system and program code. The memory 702 can be various types of storage media, such as read-only memory (ROM), random access memory (RAM), electrically erasable programmable read-only memory (EEPROM), compact disc read-only memory (CD-ROM), flash memory, optical storage, registers, optical disc storage, disk storage, or other magnetic storage devices.
[0186] The processor 701 is a general-purpose processor or a special-purpose processor. The processor 701 may be a single-core processor or a multi-core processor. The processor 701 includes at least one circuit to perform the actions executed by the application device in the methods 200 or 300 provided in the embodiments of this application.
[0187] Optionally, the application device 700 also includes a network interface 704, which is connected to the processor 701 and the memory 702 via a bus 703. The network interface 704 enables the application device 700 to communicate with the quantum device or other application devices. The processor 701 can interact with the quantum device through the network interface 704 to register service objects and obtain quantum keys, as well as communicate with other application devices.
[0188] Optionally, the application device 700 also includes an input / output (I / O) interface 705, which is connected to the processor 701 and the memory 702 via a bus 703. The processor 701 can receive input commands or data through the I / O interface 705. The I / O interface 705 is used for the application device 700 to connect input devices, such as a keyboard and mouse. Optionally, in some possible scenarios, the network interface 704 and the I / O interface 705 described above are collectively referred to as a communication interface.
[0189] Optionally, the application device 700 also includes a display 706, which is connected to the processor 701 and the memory 702 via a bus 703. The display 706 can be used to display intermediate and / or final results generated by the processor 701 executing the above methods, such as displaying alarm prompts. In one possible implementation, the display 706 is a touch screen to provide a human-machine interface.
[0190] Wherein, bus 703 can be any type of communication bus used to interconnect internal devices of application device 700. For example, a system bus. This embodiment of the application uses the interconnection of the aforementioned devices inside application device 700 via bus 703 as an example. Optionally, the aforementioned devices inside application device 700 can communicate with each other using connection methods other than bus 703, such as interconnecting the aforementioned devices inside application device 700 via internal logic interfaces of application device 700.
[0191] The aforementioned devices can be disposed on separate chips, or at least partially or entirely on the same chip. Whether to dispose of the devices independently on different chips or integrate them on one or more chips often depends on the needs of the product design. This application does not limit the specific implementation of the aforementioned devices.
[0192] Figure 7 The application device 700 shown is merely an example. In the implementation process, the application device 700 includes other components, which will not be listed one by one in this article. Figure 7 The application device 700 shown can transmit quantum keys by performing all or part of the steps of the method provided in the above embodiments.
[0193] The following example illustrates the basic hardware structure of the application device.
[0194] For example, Figure 8 This is a schematic diagram of the hardware structure of a quantum device provided in an embodiment of this application. Figure 8 As shown, the quantum device 800 includes a processor 801 and a memory 802, with the memory 801 and memory 802 connected via a bus 803. Figure 8 The processor 801 and memory 802 are described independently. Alternatively, the processor 801 and memory 802 are integrated together. Alternatively, they are combined... Figure 1 Let's take a look. Figure 8 The quantum device 800 is Figure 1 The quantum device shown.
[0195] The memory 802 is used to store computer programs, including the operating system and program code. The memory 802 can be various types of storage media, such as ROM, RAM, EEPROM, CD-ROM, flash memory, optical storage, registers, optical disc storage, disk storage, or other magnetic storage devices.
[0196] The processor 801 is a general-purpose processor or a special-purpose processor. The processor 801 may be a single-core processor or a multi-core processor. The processor 801 includes at least one circuit to perform the actions performed by the quantum device in the methods 200 or 300 described in the embodiments of this application.
[0197] Optionally, the quantum device 800 also includes a network interface 804, which is connected to the processor 801 and the memory 802 via a bus 803. The network interface 804 enables the quantum device 800 to communicate with application devices or other quantum devices. The processor 801 can interact with application devices through the network interface 804 to register service objects and provide quantum keys, and interact with other quantum devices to synchronize quantum key information.
[0198] Optionally, the quantum device 800 also includes an I / O interface 805, which is connected to the processor 801 and the memory 802 via a bus 803. The processor 801 can receive input commands or data through the I / O interface 805. The I / O interface 805 is used for the quantum device 800 to connect input devices, such as a keyboard and mouse. Optionally, in some possible scenarios, the network interface 804 and the I / O interface 805 described above are collectively referred to as the communication interface.
[0199] Optionally, the quantum device 800 also includes a display 806, which is connected to the processor 801 and the memory 802 via a bus 803. The display 806 can be used to display intermediate and / or final results generated by the processor 801 executing the above methods, such as displaying alarm prompts. In one possible implementation, the display 806 is a touch screen to provide a human-machine interface.
[0200] Wherein, bus 803 can be any type of communication bus used to interconnect the internal devices of quantum device 800. For example, a system bus. This embodiment of the application illustrates the interconnection of the aforementioned devices inside quantum device 800 via bus 803 as an example. Optionally, the aforementioned devices inside quantum device 800 may communicate with each other using connection methods other than bus 803, such as interconnecting the aforementioned devices inside quantum device 800 via internal logic interfaces.
[0201] The aforementioned devices can be disposed on separate chips, or at least partially or entirely on the same chip. Whether to dispose of the devices independently on different chips or integrate them on one or more chips often depends on the needs of the product design. This application does not limit the specific implementation of the aforementioned devices.
[0202] Figure 8 The quantum device 800 shown is merely an example. In its implementation, the quantum device 800 includes other components, which will not be listed here. Figure 8 The quantum device 800 shown can transmit quantum keys by performing all or part of the steps of the methods provided in the above embodiments.
[0203] The following describes an example of a virtual device in an embodiment of this application.
[0204] Figure 9 This is a schematic diagram of the structure of an application device provided in an embodiment of this application. It has... Figure 9 The application device with the structure shown implements the functions of the application device in the above embodiment. Optionally, Figure 9 The application device shown is Figure 1 or Figure 6 Any application device in the application scenario shown Figure 4 The application device shown or Figure 7 The application device shown performs Figure 2 or Figure 3 The functions of the application device described in the illustrated embodiment. For example... Figure 9 As shown, the application device 900 includes a transmitting module 901, a receiving module 902, and a processing module 903.
[0205] The sending module 901 is used to send a key request message to the quantum device. The key request message includes a user identifier corresponding to the application device, a first public key, and a first message authentication code value. The user identifier is used by the quantum device to obtain corresponding storage information. The storage information includes a shared key corresponding to the quantum device and the user identifier. The first public key is used by the quantum device to encrypt the quantum key information allocated to the application device. The quantum key information includes a quantum key. The first public key is the public key in the key pair obtained by the quantum key generation algorithm after the application device runs. The first message authentication code value is calculated by the application device based on the first authentication information of the shared key pair. The first authentication information includes the first public key.
[0206] The receiving module 902 is used to receive a key response message corresponding to a key request message from a quantum device. The key response message includes a first ciphertext and a second message authentication code value.
[0207] The processing module 903 is used to verify the value of the second message authentication code based on the shared key and the second authentication information, the second authentication information including the first ciphertext.
[0208] The processing module 903 is also used to, if the application device verifies the second message authentication code value, use the first private key to decrypt the first ciphertext to obtain quantum key information, wherein the first private key is the private key in the key pair.
[0209] Here, the detailed operation of the sending module 901, receiving module 902, and processing module 903 is described in the preceding method embodiments. For example, the sending module 901 sends a key request message to the quantum device using step 201 of method 200. The receiving module 902 receives a key response message from the quantum device using step 206 of method 200. The processing module 903 processes the key response message from the quantum device using steps 207 and 208 of method 200. The embodiments of this application will not be described again here.
[0210] Optionally, the user identifier corresponding to the application device is the device identifier of the application device, or the user identifier corresponding to the application device is the user account logged into the application device.
[0211] Optionally, the key request message also includes a first statistical value. The processing module 903 is further configured to obtain the historical transmission count of the key request message, including the user identifier, before sending the key request message to the sub-device. A set increment is added to the historical transmission count to obtain the first statistical value. For a detailed description of the operation of the processing module 903, please refer to the relevant description in method 200.
[0212] Optionally, the key response message also includes a second statistical value. The second statistical value is the number of times the key request message, including the user identifier, has been sent, as recorded by the quantum device. The processing module 903 is further configured to, upon receiving the key response message, stop the quantum key transmission process if the second statistical value is not equal to the first statistical value. The detailed operation of the processing module 903 can be found in the relevant description in method 200.
[0213] Optionally, the first authentication information may also include one or more of the quantum device's device identifier, user identifier, or first statistical value.
[0214] Optionally, the processing module 903 is further configured to generate a derived key based on the target password using a key derivation function before the sending module 901 sends the key request message to the sub-device, and obtain the shared key based on the derived key. For a detailed description of the operation of the processing module 903, please refer to the relevant description of step 201 in method 200.
[0215] Optionally, the processing module 903 is further configured to, in response to receiving an input quantum key acquisition instruction, run a quantum key generation algorithm to generate a key pair before the sending module 901 sends a key request message to the quantum device. The quantum key acquisition instruction includes a target password. A first message authentication code value is calculated based on the first authentication information of the shared key pair. For a detailed description of the operation of the processing module 903, please refer to the relevant description of step 201 in method 200.
[0216] Optionally, the sending module 901 is further configured to send a registration request message to the quantum device before sending a key request message to the quantum device. The receiving module 902 is further configured to receive a registration response message corresponding to the registration request message from the quantum device, the registration response message including the certificate of the quantum device, the certificate including a second public key. The processing module 903 is further configured to, if the application device verifies the certificate successfully, encrypt the registration information using the second public key to obtain a second ciphertext, the registration information including a derived key and a user identifier. The sending module 901 is further configured to send a registration message to the quantum device, the registration message including the second ciphertext. Here, the detailed operation of the sending module 901 can be referred to the relevant descriptions of steps 301 and 306 in method 300. The detailed operation of the receiving module 902 can be referred to the relevant descriptions of step 302 in method 300. The detailed operation of the processing module 903 can be referred to the relevant descriptions of step 305 in method 300.
[0217] Optionally, the registration request message indicates the cryptographic algorithms supported by the application device, and the registration response message further indicates the target cryptographic algorithm selected by the quantum device from the cryptographic algorithms supported by the application device. The target cryptographic algorithm includes one or more of the following: the algorithm for generating the first message authentication code value, the algorithm for generating the second message authentication code value, or the algorithm for generating the shared key.
[0218] Optionally, the registration response message also includes key derivation function parameter values, which include a random salt value and / or the number of iterations. The processing module 903 is further configured to, after the receiving module 902 receives the registration response message, obtain the user identifier and the target password, and generate a derived key based on the target password and the key derivation function parameter values using the key derivation function. The detailed operation of the processing module 903 can be found in the descriptions of steps 303 and 304 in method 300.
[0219] Optionally, the registration message may also include the device identifier of the application device. The registration information may also include the hash value of the device identifier of the application device.
[0220] Optionally, the registration information also includes a first random number generated by the application device. The receiving module 902 is further configured to receive a registration success response message from the quantum device, the registration success response message indicating that the user identifier has been successfully registered, and the registration success response message includes a second random number. The processing module 903 is further configured to determine that the user identifier has been successfully registered if the second random number is the same as the first random number. Here, the detailed operation of the receiving module 902 can be found in the relevant description of step 309 in method 300. The detailed operation of the processing module 903 can be found in the relevant description of step 310 in method 300.
[0221] Optionally, processing module 903 is used to calculate a third message authentication code value based on the shared key and the second authentication information. If the third message authentication code value is the same as the second message authentication code value, it is determined that the verification of the second message authentication code value has passed. Here, the detailed working process of processing module 903 can be found in the relevant description of step 207 in method 200.
[0222] Alternatively, the application device communicates with the quantum device via a classical network.
[0223] Figure 10 This is a schematic diagram of the structure of a quantum device provided in an embodiment of this application. It has... Figure 10 The quantum device with the structure shown implements the function of the quantum device in the scheme described in the above embodiments. Optionally, Figure 10 The quantum device shown is Figure 1 or Figure 6 Quantum devices in the application scenarios shown Figure 5 The quantum device shown or Figure 8 The quantum device shown performs Figure 2 or Figure 3 The functionality of the quantum device described in the illustrated embodiment. For example... Figure 10 As shown, the quantum device 1000 includes a receiving module 1001, a processing module 1002, and a transmitting module 1003.
[0224] The receiving module 1001 is used to receive a key request message from the application device. The key request message includes the user identifier corresponding to the application device, the first public key, and the first message authentication code value.
[0225] The processing module 1002 is used to obtain the first authentication information and the storage information corresponding to the user identifier based on the key request message. The storage information includes the shared key corresponding to the quantum device and the user identifier, and the first authentication information includes the first public key.
[0226] The processing module 1002 is also used to verify the first message authentication code value based on the shared key and the first authentication information.
[0227] The processing module 1002 is also used to encrypt the quantum key information using the first public key to obtain the first ciphertext if the quantum device verifies the first message authentication code value. The quantum key information includes the quantum key.
[0228] The processing module 1002 is also used to calculate the second message authentication code value based on the shared key pair of the second authentication information, the second authentication information including the first ciphertext.
[0229] The sending module 1003 is used to send a key response message corresponding to the key request message to the application device. The key response message includes a first ciphertext and a second message authentication code value.
[0230] Here, the detailed operation of the receiving module 1001, processing module 1002, and sending module 1003 is described in the preceding method embodiments. For example, the receiving module 1001 receives a key request message from the application device using step 201 of method 200. The processing module 1002 processes the key request message from the application device using steps 202 to 205 of method 200. The sending module 1003 sends a key response message to the application device using step 206 of method 200. The embodiments of this application will not be described again here.
[0231] Optionally, the user identifier corresponding to the application device is the device identifier of the application device, or the user identifier corresponding to the application device is the user account logged into the application device.
[0232] Optionally, the key request message also includes a first statistical value, which is the number of times the key request message including the user identifier has been sent, as recorded by the application device. The stored information includes a second statistical value, which is the number of times the key request message including the user identifier has been sent, as recorded by the quantum device. The processing module 1002 is further configured to, after obtaining the stored information corresponding to the user identifier, stop the quantum key transmission process if the second statistical value is greater than or equal to the first statistical value. If the second statistical value is less than the first statistical value, update the second statistical value so that the updated second statistical value is equal to the first statistical value. The detailed operation of the processing module 1002 can be found in the relevant description in method 200.
[0233] Optionally, the key response message may also include an updated second statistic.
[0234] Optionally, the second authentication information may also include one or more of the quantum device's device identifier, user identifier, or updated second statistical value.
[0235] Optionally, the receiving module 1001 is further configured to receive a registration request message from the application device. The sending module 1003 is further configured to send a registration response message to the application device. The registration response message includes a certificate of the quantum device, the certificate including a second public key, which is the public key in the key pair obtained by the quantum key generation algorithm after the quantum device runs. The processing module 1002 is further configured to, if the receiving module 1001 receives a registration message including a second ciphertext from the application device, decrypt the second ciphertext using the second private key to obtain registration information. The registration information includes a derived key and a user identifier corresponding to the application device. The second private key is the private key in the key pair. The processing module 1002 also stores storage information corresponding to the user identifier, including a shared key obtained based on the derived key and the user identifier. The detailed operation of the receiving module 1001 can be found in the descriptions of steps 301 and 306 in method 300. The detailed operation of the processing module 1002 can be found in the descriptions of steps 307 and 308 in method 300. For a detailed description of the operation of the sending module 1003, please refer to the relevant description of step 302 in method 300.
[0236] Optionally, the registration request message indicates the cryptographic algorithms supported by the application device, and the registration response message further indicates the target cryptographic algorithm selected by the quantum device from the cryptographic algorithms supported by the application device. The target cryptographic algorithm includes one or more of the following: the algorithm for generating the first message authentication code value, the algorithm for generating the second message authentication code value, or the algorithm for generating the shared key.
[0237] Optionally, the registration response message also includes a first key derivation function parameter value, which includes a random salt value and / or the number of iterations. The registration information also includes a second key derivation function parameter value. The processing module 1002 is further configured to, after obtaining the registration information, compare the first key derivation function parameter value with the second key derivation function parameter value. If the first key derivation function parameter value and the second key derivation function parameter value are the same, the storage information corresponding to the user identifier is stored. Here, the detailed working process of the processing module 1002 can be found in the relevant description of step 308 in method 300.
[0238] Optionally, the registration message also includes the device identifier of the application device, and the registration information also includes a first hash value of the device identifier of the application device. The processing module 1002 is further configured to, after obtaining the registration information, calculate a second hash value of the device identifier of the application device, compare the first hash value with the second hash value, and if the first hash value and the second hash value are the same, store the storage information corresponding to the user identifier. Here, the detailed working process of the processing module 1002 can be found in the relevant description of step 308 in method 300.
[0239] Optionally, the registration information also includes a random number generated by the application device. The sending module 1003 is further configured to send a registration success response message to the application device after the processing module 1002 stores the stored information corresponding to the user identifier. The registration success response message indicates that the user identifier has been successfully registered, and the registration success response message includes a random number. For a detailed description of the operation of the sending module 1003, please refer to the relevant description of step 309 in method 300.
[0240] Optionally, processing module 1002 is used to calculate a fourth message authentication code value based on the shared key and the first authentication information. If the fourth message authentication code value is the same as the first message authentication code value, it is determined that the verification of the first message authentication code value has passed. Here, the detailed working process of processing module 1002 can be found in the relevant description of step 203 in method 200.
[0241] Alternatively, the application device communicates with the quantum device via a classical network.
[0242] This application also provides a computer-readable storage medium storing instructions that, when executed by a processor of an application device, implement the steps of method 200 or method 300 described above. Alternatively, when executed by a processor of a quantum device, the instructions implement the steps of method 200 or method 300 described above.
[0243] This application also provides a computer program product, including a computer program that, when executed by a processor of an application device, implements the steps of method 200 or method 300 performed by the application device. Alternatively, when executed by a processor of a quantum device, the computer program implements the steps of method 200 or method 300 performed by the quantum device.
[0244] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.
[0245] In the embodiments of this application, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.
[0246] In this application, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, the character " / " in this document generally indicates that the preceding and following related objects have an "or" relationship.
[0247] It should be noted that all information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, stored data, displayed data, etc.), and signals involved in this application have been authorized by the user or fully authorized by all parties, and the collection, use, and processing of related data must comply with the relevant laws, regulations, and standards of the relevant countries and regions. For example, the quantum key information and registration information involved in this application were obtained with full authorization.
[0248] The above description is merely an optional embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the concept and principles of this application should be included within the protection scope of this application.
Claims
1. A quantum key transmission method, characterized in that, The method includes: An application device sends a key request message to a quantum device. The key request message includes a user identifier corresponding to the application device, a first public key, and a first message authentication code value. The user identifier is used by the quantum device to obtain corresponding storage information. The storage information includes a shared key between the quantum device and the user identifier. The first public key is used by the quantum device to encrypt quantum key information allocated to the application device. The quantum key information includes a quantum key. The first public key is the public key in the key pair obtained by the quantum key generation algorithm after the application device runs. The first message authentication code value is calculated by the application device based on the first authentication information of the shared key pair. The first authentication information includes the first public key. The application device receives a key response message corresponding to the key request message from the quantum device. The key response message includes a first ciphertext and a second message authentication code value. The application device verifies the second message authentication code value based on the shared key and the second authentication information, wherein the second authentication information includes the first ciphertext; If the application device verifies the second message authentication code value, the application device uses the first private key to decrypt the first ciphertext to obtain quantum key information, where the first private key is the private key in the key pair.
2. The method according to claim 1, characterized in that, The user identifier corresponding to the application device is the device identifier of the application device, or the user identifier corresponding to the application device is the user account that logs into the application device.
3. The method according to claim 1 or 2, characterized in that, The key request message also includes a first statistical value. Before the application device sends the key request message to the sub-device, the method further includes: The application device obtains the historical number of key request messages including the user identifier; The application device adds a predetermined increment to the historical transmission count to obtain the first statistical value.
4. The method according to claim 3, characterized in that, The key response message further includes a second statistical value, which is the number of times the key request message including the user identifier has been sent, as recorded by the quantum device. After the application device receives the key response message corresponding to the key request message, the method further includes: If the second statistical value is not equal to the first statistical value, the application device stops the quantum key transmission process.
5. The method according to claim 3 or 4, characterized in that, The first authentication information also includes one or more of the device identifier of the quantum device, the user identifier, or the first statistical value.
6. The method according to any one of claims 1 to 5, characterized in that, Before the application device sends a key request message to the sub-device, the method further includes: The application device uses a key derivation function to generate a derived key based on the target password, and the shared key is obtained based on the derived key.
7. The method according to claim 6, characterized in that, Before the application device sends a key request message to the sub-device, the method further includes: In response to receiving an input quantum key acquisition instruction, the application device runs the post-quantum key generation algorithm to generate the key pair, and the quantum key acquisition instruction includes the target password; The application device calculates the first message authentication code value based on the shared key and the first authentication information.
8. The method according to claim 6 or 7, characterized in that, Before the application device sends a key request message to the sub-device, the method further includes: The application device sends a registration request message to the quantum device; The application device receives a registration response message corresponding to the registration request message from the quantum device. The registration response message includes the certificate of the quantum device, and the certificate includes a second public key. If the application device verifies the certificate, the application device uses the second public key to encrypt the registration information to obtain a second ciphertext, the registration information including the derived key and the user identifier; The application device sends a registration message to the quantum device, the registration message including the second ciphertext.
9. The method according to claim 8, characterized in that, The registration request message indicates the cryptographic algorithms supported by the application device, and the registration response message further indicates the target cryptographic algorithm selected by the quantum device from the cryptographic algorithms supported by the application device. The target cryptographic algorithm includes one or more of the algorithm for generating the first message authentication code value, the algorithm for generating the second message authentication code value, or the algorithm for generating the shared key.
10. The method according to claim 8 or 9, characterized in that, The registration response message also includes a key derivation function parameter value, which includes a random salt value and / or an iteration count. After the application device receives the registration response message corresponding to the registration request message, the method further includes: The application device acquires the user identifier and the target password; The application device uses a key derivation function to generate a derived key based on the target password, including: The application device uses the key derivation function to generate the derived key based on the target password and the parameter values of the key derivation function.
11. The method according to any one of claims 8 to 10, characterized in that, The registration message also includes the device identifier of the application device, and the registration information also includes the hash value of the device identifier of the application device.
12. The method according to any one of claims 8 to 11, characterized in that, The registration information also includes a first random number generated by the application device, and the method further includes: The application device receives a registration success response message from the quantum device. The registration success response message indicates that the user identifier has been successfully registered. The registration success response message includes a second random number. If the second random number is the same as the first random number, the application device determines that the user identifier has been successfully registered.
13. The method according to any one of claims 1 to 12, characterized in that, The application device verifies the second message authentication code value based on the shared key and the second authentication information, including: The application device calculates the third message authentication code value based on the shared key and the second authentication information. If the third message authentication code value is the same as the second message authentication code value, the application device determines that the second message authentication code value has been verified.
14. The method according to any one of claims 1 to 13, characterized in that, The application device communicates with the quantum device via a classical network.
15. A quantum key transfer method, characterized in that, The method includes: The quantum device receives a key request message from the application device, the key request message including the user identifier corresponding to the application device, the first public key and the first message authentication code value; The quantum device obtains first authentication information and storage information corresponding to the user identifier based on the key request message. The storage information includes a shared key between the quantum device and the user identifier, and the first authentication information includes the first public key. The quantum device verifies the first message authentication code value based on the shared key and the first authentication information; If the quantum device verifies the first message authentication code value, the quantum device uses the first public key to encrypt the quantum key information to obtain the first ciphertext, wherein the quantum key information includes the quantum key; The quantum device calculates a second message authentication code value based on the shared key and the second authentication information, wherein the second authentication information includes the first ciphertext. The quantum device sends a key response message corresponding to the key request message to the application device. The key response message includes the first ciphertext and the second message authentication code value.
16. The method according to claim 15, characterized in that, The user identifier corresponding to the application device is the device identifier of the application device, or the user identifier corresponding to the application device is the user account that logs into the application device.
17. The method according to claim 15 or 16, characterized in that, The key request message further includes a first statistical value, which is the number of times the key request message including the user identifier has been sent, as recorded by the application device. The storage information includes a second statistical value, which is the number of times the key request message including the user identifier has been sent, as recorded by the quantum device. After the quantum device obtains the storage information corresponding to the user identifier, the method further includes: If the second statistical value is greater than or equal to the first statistical value, the quantum device stops the quantum key transmission process; If the second statistical value is less than the first statistical value, the quantum device updates the second statistical value so that the updated second statistical value is equal to the first statistical value.
18. The method according to claim 17, characterized in that, The key response message also includes the updated second statistical value.
19. The method according to claim 17 or 18, characterized in that, The second authentication information also includes one or more of the device identifier of the quantum device, the user identifier, or the updated second statistical value.
20. The method according to any one of claims 15 to 19, characterized in that, The method further includes: The quantum device receives a registration request message from the application device; The quantum device sends a registration response message to the application device. The registration response message includes the certificate of the quantum device. The certificate includes a second public key, which is the public key in the key pair obtained by the quantum key generation algorithm after the quantum device runs. If the quantum device receives a registration message containing a second ciphertext from the application device, the quantum device uses a second private key to decrypt the second ciphertext to obtain registration information. The registration information includes a derived key and a user identifier corresponding to the application device. The second private key is the private key in the key pair. The quantum device stores storage information corresponding to the user identifier, and the storage information includes the shared key obtained based on the derived key and the user identifier.
21. The method according to claim 20, characterized in that, The registration request message indicates the cryptographic algorithms supported by the application device, and the registration response message further indicates the target cryptographic algorithm selected by the quantum device from the cryptographic algorithms supported by the application device. The target cryptographic algorithm includes one or more of the algorithm for generating the first message authentication code value, the algorithm for generating the second message authentication code value, or the algorithm for generating the shared key.
22. The method according to claim 20 or 21, characterized in that, The registration response message further includes a first key derivation function parameter value, which includes a random salt value and / or the number of iterations. The registration information also includes a second key derivation function parameter value. After the quantum device decrypts the second ciphertext using a second private key to obtain the registration information, the method further includes: The quantum device compares the parameter values of the first key derivation function with the parameter values of the second key derivation function; The quantum device stores the storage information corresponding to the user identifier, including: If the parameter value of the first key derivation function is the same as the parameter value of the second key derivation function, the quantum device stores the storage information corresponding to the user identifier.
23. The method according to any one of claims 20 to 22, characterized in that, The registration message also includes the device identifier of the application device, and the registration information also includes a first hash value of the device identifier of the application device. After the quantum device decrypts the second ciphertext using a second private key to obtain the registration information, the method further includes: The quantum device calculates a second hash value for the device identifier of the application device; The quantum device compares the first hash value with the second hash value; The quantum device stores the storage information corresponding to the user identifier, including: If the first hash value is the same as the second hash value, the quantum device stores the storage information corresponding to the user identifier.
24. The method according to any one of claims 20 to 23, characterized in that, The registration information also includes a random number generated by the application device. After the quantum device stores the storage information corresponding to the user identifier, the method further includes: The quantum device sends a registration success response message to the application device. The registration success response message indicates that the user identifier has been successfully registered, and the registration success response message includes the random number.
25. The method according to any one of claims 15 to 24, characterized in that, The quantum device verifies the first message authentication code value based on the shared key and the first authentication information, including: The quantum device calculates the fourth message authentication code value based on the shared key and the first authentication information. If the fourth message authentication code value is the same as the first message authentication code value, the quantum device determines that the first message authentication code value has been verified.
26. The method according to any one of claims 15 to 25, characterized in that, The application device communicates with the quantum device via a classical network.
27. An application device, characterized in that, include: Memory, network interface, and at least one processor, The memory is used to store program instructions. After the at least one processor reads the program instructions stored in the memory, the application device causes the following operations: A key request message is sent to the quantum device. The key request message includes a user identifier corresponding to the application device, a first public key, and a first message authentication code value. The user identifier is used by the quantum device to obtain corresponding storage information. The storage information includes a shared key between the quantum device and the user identifier. The first public key is used by the quantum device to encrypt quantum key information allocated to the application device. The quantum key information includes a quantum key. The first public key is the public key in the key pair obtained by the quantum key generation algorithm after the application device runs. The first message authentication code value is calculated by the application device based on the first authentication information of the shared key pair. The first authentication information includes the first public key. Receive a key response message corresponding to the key request message from the quantum device, the key response message including a first ciphertext and a second message authentication code value; The second message authentication code value is verified based on the shared key and the second authentication information, wherein the second authentication information includes the first ciphertext; If the application device verifies the second message authentication code value, it uses the first private key to decrypt the first ciphertext to obtain quantum key information. The first private key is the private key in the key pair.
28. The application device according to claim 27, characterized in that, The user identifier corresponding to the application device is the device identifier of the application device, or the user identifier corresponding to the application device is the user account that logs into the application device.
29. The application device according to claim 27 or 28, characterized in that, The key request message also includes a first statistical value. After the program instructions are read by the at least one processor, the application device further performs the following operations: Before sending a key request message to the quantum device, obtain the historical number of key request messages sent, including the user identifier; The first statistical value is obtained by adding a predetermined increment to the historical number of transmissions.
30. The application device according to claim 29, characterized in that, The key response message also includes a second statistical value, which is the number of times the key request message including the user identifier has been sent, as recorded by the quantum device. After the program instructions are read by the at least one processor, the application device further performs the following operations: Upon receiving the key response message, if the second statistical value is not equal to the first statistical value, the quantum key transmission process is stopped.
31. The application device according to claim 29 or 30, characterized in that, The first authentication information also includes one or more of the device identifier of the quantum device, the user identifier, or the first statistical value.
32. The application device according to any one of claims 27 to 31, characterized in that, After the program instructions are read by the at least one processor, the application device further performs the following operations: Before sending a key request message to the quantum device, a derived key is generated based on the target password using a key derivation function, and the shared key is obtained based on the derived key.
33. The application device according to claim 32, characterized in that, After the program instructions are read by the at least one processor, the application device further performs the following operations: Before sending a key request message to the quantum device, in response to receiving an input quantum key acquisition instruction, the post-quantum key generation algorithm is run to generate the key pair, wherein the quantum key acquisition instruction includes the target password; The first message authentication code value is calculated based on the shared key and the first authentication information.
34. The application device according to claim 32 or 33, characterized in that, After the program instructions are read by the at least one processor, the application device further performs the following operations: Before sending a key request message to the quantum device, a registration request message is sent to the quantum device; Receive a registration response message corresponding to the registration request message from the quantum device, the registration response message including the certificate of the quantum device, the certificate including a second public key; If the application device verifies the certificate, it uses the second public key to encrypt the registration information to obtain a second ciphertext, wherein the registration information includes the derived key and the user identifier; A registration message is sent to the quantum device, the registration message including the second ciphertext.
35. The application device according to claim 34, characterized in that, The registration request message indicates the cryptographic algorithms supported by the application device, and the registration response message further indicates the target cryptographic algorithm selected by the quantum device from the cryptographic algorithms supported by the application device. The target cryptographic algorithm includes one or more of the algorithm for generating the first message authentication code value, the algorithm for generating the second message authentication code value, or the algorithm for generating the shared key.
36. The application device according to claim 34 or 35, characterized in that, The registration response message also includes a key derivation function parameter value, which includes a random salt value and / or the number of iterations. After the program instructions are read by the at least one processor, the application device further performs the following operations: After receiving the registration response message, obtain the user identifier and the target password; The derived key is generated using the key derivation function based on the target password and the parameter values of the key derivation function.
37. The application device according to any one of claims 34 to 36, characterized in that, The registration message also includes the device identifier of the application device, and the registration information also includes the hash value of the device identifier of the application device.
38. The application device according to any one of claims 34 to 37, characterized in that, The registration information also includes a first random number generated by the application device. After the program instructions are read by the at least one processor, the application device further performs the following operations: Receive a registration success response message from the quantum device, the registration success response message being used to indicate that the user identifier has been successfully registered, the registration success response message including a second random number; If the second random number is the same as the first random number, the user ID registration is confirmed to be successful.
39. The application device according to any one of claims 27 to 38, characterized in that, After the program instructions are read by the at least one processor, the application device performs the following operations: The third message authentication code value is calculated based on the shared key and the second authentication information. If the third message authentication code value is the same as the second message authentication code value, it is determined that the verification of the second message authentication code value has passed.
40. The application device according to any one of claims 27 to 39, characterized in that, The application device communicates with the quantum device via a classical network.
41. A quantum device, characterized in that, include: Memory, network interface, and at least one processor, The memory is used to store program instructions. After the at least one processor reads the program instructions stored in the memory, the quantum device performs the following operations: Receive a key request message from the application device, the key request message including the user identifier corresponding to the application device, the first public key and the first message authentication code value; Based on the key request message, first authentication information and storage information corresponding to the user identifier are obtained. The storage information includes the shared key between the quantum device and the user identifier, and the first authentication information includes the first public key. The first message authentication code value is verified based on the shared key and the first authentication information; If the quantum device verifies the first message authentication code value, it uses the first public key to encrypt the quantum key information to obtain the first ciphertext, wherein the quantum key information includes the quantum key; The second message authentication code value is calculated based on the shared key and the second authentication information, wherein the second authentication information includes the first ciphertext. Send a key response message corresponding to the key request message to the application device. The key response message includes the first ciphertext and the second message authentication code value.
42. The quantum device according to claim 41, characterized in that, The user identifier corresponding to the application device is the device identifier of the application device, or the user identifier corresponding to the application device is the user account that logs into the application device.
43. The quantum device according to claim 41 or 42, characterized in that, The key request message further includes a first statistical value, which is the number of times the key request message including the user identifier has been sent, as recorded by the application device. The stored information includes a second statistical value, which is the number of times the key request message including the user identifier has been sent, as recorded by the quantum device. After the program instructions are read by the at least one processor, the quantum device further performs the following operations: After obtaining the storage information corresponding to the user identifier, if the second statistical value is greater than or equal to the first statistical value, the quantum key transmission process is stopped. If the second statistical value is less than the first statistical value, update the second statistical value so that the updated second statistical value is equal to the first statistical value.
44. The quantum device according to claim 43, characterized in that, The key response message also includes the updated second statistical value.
45. The quantum device according to claim 43 or 44, characterized in that, The second authentication information also includes one or more of the device identifier of the quantum device, the user identifier, or the updated second statistical value.
46. The quantum device according to any one of claims 41 to 45, characterized in that, After the program instructions are read by the at least one processor, the quantum device further performs the following operations: Receive a registration request message from the application device; Send a registration response message to the application device. The registration response message includes the certificate of the quantum device. The certificate includes a second public key, which is the public key in the key pair obtained by the quantum key generation algorithm after the quantum device is running. If a registration message containing a second ciphertext is received from the application device, the second ciphertext is decrypted using the second private key to obtain registration information. The registration information includes a derived key and a user identifier corresponding to the application device. The second private key is the private key in the key pair. The storage information corresponding to the user identifier includes the shared key obtained based on the derived key and the user identifier.
47. The quantum device according to claim 46, characterized in that, The registration request message indicates the cryptographic algorithms supported by the application device, and the registration response message further indicates the target cryptographic algorithm selected by the quantum device from the cryptographic algorithms supported by the application device. The target cryptographic algorithm includes one or more of the algorithm for generating the first message authentication code value, the algorithm for generating the second message authentication code value, or the algorithm for generating the shared key.
48. The quantum device according to claim 46 or 47, characterized in that, The registration response message also includes a first key derivation function parameter value, which includes a random salt value and / or the number of iterations. The registration information also includes a second key derivation function parameter value. After the program instructions are read by the at least one processor, the quantum device further performs the following operations: After obtaining the registration information, the parameter values of the first key derivation function and the second key derivation function are compared. If the parameter value of the first key derivation function is the same as the parameter value of the second key derivation function, the storage information corresponding to the user identifier is stored.
49. The quantum device according to any one of claims 46 to 48, characterized in that, The registration message also includes the device identifier of the application device, and the registration information also includes a first hash value of the device identifier of the application device. After the program instructions are read by the at least one processor, the quantum device further performs the following operations: After obtaining the registration information, calculate the second hash value of the device identifier of the application device; Compare the first hash value with the second hash value; If the first hash value is the same as the second hash value, the storage information corresponding to the user identifier is stored.
50. The quantum device according to any one of claims 46 to 49, characterized in that, The registration information also includes a random number generated by the application device. After the program instructions are read by the at least one processor, the quantum device further performs the following operations: After storing the storage information corresponding to the user identifier, a registration success response message is sent to the application device. The registration success response message is used to indicate that the user identifier has been successfully registered, and the registration success response message includes the random number.
51. The quantum device according to any one of claims 41 to 50, characterized in that, After the program instructions are read by the at least one processor, the quantum device performs the following operations: The fourth message authentication code value is calculated based on the shared key and the first authentication information. If the fourth message authentication code value is the same as the first message authentication code value, it is determined that the first message authentication code value has been verified.
52. The quantum device according to any one of claims 41 to 51, characterized in that, The application device communicates with the quantum device via a classical network.
53. A quantum key transfer system, characterized in that, include: First application device and first quantum device; The first application device is used to send a key request message to the first quantum device. The key request message includes a user identifier corresponding to the first application device, a first public key, and a first message authentication code value. The first public key is the public key in the key pair obtained by the quantum key generation algorithm after the first application device runs. The first message authentication code value is calculated by the first application device based on the first authentication information of the shared key pair corresponding to the quantum device and the user identifier. The first authentication information includes the first public key. The first quantum device is used to obtain the first authentication information and the storage information corresponding to the user identifier based on the key request message, wherein the storage information includes the shared key; The first quantum device is used to verify the first message authentication code value based on the shared key and the first authentication information; If the first quantum device verifies the first message authentication code value, the first quantum device is used to encrypt the quantum key information using the first public key to obtain the first ciphertext, wherein the quantum key information includes the quantum key; The first quantum device is used to calculate a second message authentication code value based on the shared key and the second authentication information, wherein the second authentication information includes the first ciphertext; The first quantum device is used to send a key response message corresponding to the key request message to the first application device. The key response message includes the first ciphertext and the second message authentication code value. The first application device is used to obtain the second authentication information based on the key response message; The first application device is used to verify the second message authentication code value based on the shared key and the second authentication information; If the first application device verifies the second message authentication code value, the first application device is used to decrypt the first ciphertext using the first private key to obtain quantum key information, wherein the first private key is the private key in the key pair.
54. The system according to claim 53, characterized in that, The quantum key information also includes the key identifier of the quantum key, and the system also includes a second application device and a second quantum device; The first quantum device is also used to send the quantum key information to the second quantum device; The first application device is also used to send the key identifier to the second application device; The second application device is used to send a key acquisition request to the second quantum device, the key acquisition request including the key identifier; The second quantum device is used to send the quantum key to the second application device based on the key identifier; The first application device and the second application device are used to communicate based on the quantum key.
55. The system according to claim 54, characterized in that, The first quantum device communicates with the second quantum device via a quantum network, the first quantum device communicates with the first application device via a classical network, the second quantum device communicates with the second application device via a classical network, and the first application device communicates with the second application device via a classical network.
56. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores instructions that, when executed by a processor of an application device, implement the method as described in any one of claims 1 to 14; or, when executed by a processor of a quantum device, implement the method as described in any one of claims 15 to 26.
Citation Information
Patent Citations
Bidirectional identity authentication method and device
CN108282329A
Signature method and system based on quantum key
CN113868715A