Communication method based on quantum key and related equipment
By adopting a one-time pad encryption method in quantum key distribution and communication, and including the identification information of the key block and the information of the target encryption method in the communication message, the problem of insufficient security of encryption processing in the existing technology is solved. , achieving high-security level communication.
Patent Information
- Application Number
- CN202411908011.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-23
- Publication Date
- 2025-01-21
- Estimated Expiration
- 2044-12-23
AI Technical Summary
The prior art is difficult to realize high security level encryption processing in quantum key distribution and communication, especially when the amount of keys is insufficient or the amount of communication information is large.
By determining whether the one-time pad method is supported between the first device and the second device, if supported, the one-time pad method is used for encryption processing, and the communication message includes the identification information of the key block and the target encryption. method information so that the other party can decrypt it.
It realizes encryption processing based on a one-time pad method when the amount of keys stored in the first device is sufficient, and does not rely on cryptographic algorithms. It is suitable for high-security communication scenarios, such as voice communication, video communication, etc., effectively improving Communication security.
Smart Images

Figure CN119341746A_ABST
Abstract
Description
Background Art
[0002] Quantum information technology is transitioning from scientific research to industrialization, mainly covering quantum computing, quantum communication, and quantum measurement. Among them, quantum communication, especially quantum key distribution (QKD) technology, has entered the large-scale industrial stage. QKD technology encodes information based on quantum states. Its security is based on the principles of quantum physics rather than the requirements and assumptions of mathematical calculation complexity. It has high security and is not affected by quantum computing.
[0003] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention
[0004] The present disclosure provides a communication method based on quantum key, a communication device based on quantum key, an electronic device, a computer-readable storage medium and a computer program product.
[0005] Other features and advantages of the present disclosure will become apparent from the following detailed description, or may be learned in part by the practice of the present disclosure.
[0006] According to one aspect of the present disclosure, a communication method based on quantum key is provided, the method being executed by a first device, the method comprising: determining whether the key amount of the first device supports a one-time pad method; if the key amount of the first device supports the one-time pad method, taking the one-time pad method as a target encryption method; based on the target encryption method, encrypting communication information using the quantum key of the first device to obtain a communication message; the communication message comprises identification information of a key block and information of the target encryption method, the identification information of the key block being used to locate the starting position of the quantum key used for encryption processing; sending the communication message to a second device, and receiving a message decryption result sent by the second device; the message decryption result is obtained by the second device decrypting the communication message according to the identification information of the key block and information of the target encryption method.
[0007] According to another aspect of the present disclosure, a communication method based on quantum key is also provided, which is executed by a second device, and the method includes: receiving a communication message sent by a first device; the communication message is obtained by the first device, based on a target encryption method, by encrypting the communication information using the quantum key of the first device; in the case where the key amount of the first device supports a one-time pad method, the target encryption method is the one-time pad method; the communication message includes identification information of a key block and information of the target encryption method, and the identification information of the key block is used to locate the starting position of the quantum key used for encryption processing; decrypting the communication message according to the identification information of the key block and information of the target encryption method to obtain a message decryption result; and sending the message decryption result to the first device.
[0008] According to another aspect of the present disclosure, a communication device based on quantum key is also provided, which is applied to a first device, and the device includes: an encryption module, configured to determine whether the key amount of the first device supports the one-time pad method; if the key amount of the first device supports the one-time pad method, the one-time pad method is used as the target encryption method; based on the target encryption method, the communication information is encrypted using the quantum key of the first device to obtain a communication message; the communication message includes identification information of the key block and information of the target encryption method, and the identification information of the key block is used to locate the starting position of the quantum key used for encryption processing; a first communication module, configured to send the communication message to a second device, and receive a message decryption result sent by the second device; the message decryption result is obtained by the second device decrypting the communication message according to the identification information of the key block and information of the target encryption method.
[0009] According to another aspect of the present disclosure, a communication device based on quantum key is also provided, and the device is applied to a second device, and the device includes: a second communication module, configured to receive a communication message sent by a first device; the communication message is obtained by the first device, based on a target encryption method, by encrypting the communication information using the quantum key of the first device; in the case where the key amount of the first device supports a one-time pad method, the target encryption method is the one-time pad method; the communication message includes identification information of a key block and information of the target encryption method, and the identification information of the key block is used to locate the starting position of the quantum key used for encryption processing; a decryption module, configured to decrypt the communication message according to the identification information of the key block and information of the target encryption method to obtain a message decryption result; the second communication module is also configured to send the message decryption result to the first device.
[0010] According to another aspect of the present disclosure, an electronic device is also provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute any one of the above-mentioned quantum key-based communication methods by executing the executable instructions.
[0011] According to another aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the quantum key-based communication method described in any one of the above is implemented.
[0012] According to another aspect of the present disclosure, a computer program product is also provided, including: a computer program or instructions, which, when executed by a processor, implements any of the above-mentioned quantum key-based communication methods.
[0013] The quantum key-based communication method provided by the embodiment of the present disclosure is that the first device first determines whether its key quantity supports the one-time one-pass method. If it supports the one-time one-pass method, the one-time one-pass method is used as the target encryption method, and then based on the target encryption method, the communication information is encrypted using the stored quantum key to obtain a communication message; after obtaining the communication message, the first device sends the communication message to the second device. Since the communication message includes the identification information of the key block and the information of the target encryption method, and the identification information of the key block is used to locate the starting position of the quantum key used for encryption processing, the second device can decrypt the communication message according to the identification information of the key block and the information of the target encryption method in the communication message, obtain the message decryption result and send it to the first device. In this way, if the first device supports the one-time one-pass method, encryption processing can be performed based on the one-time one-pass method, which does not rely on the cryptographic algorithm, is suitable for communication scenarios with high security levels, such as voice communication, video communication and other scenarios, and effectively improves the security of communication.
[0014] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification are used to explain the principles of the present disclosure. Obviously, the accompanying drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without creative work.
[0016] Figure 1 A schematic diagram of an exemplary application system architecture to which the quantum key-based communication method in the embodiments of the present disclosure can be applied is shown; Figure 2 A flow chart showing a communication method based on quantum keys in an embodiment of the present disclosure is shown; Figure 3 A flowchart showing a communication message obtained by performing encryption processing based on a one-time pad method in an embodiment of the present disclosure; Figure 4 A flowchart showing another communication method based on quantum keys in an embodiment of the present disclosure is shown; Figure 5 A flowchart showing a method of performing decryption processing based on a one-time pad method to obtain a message decryption result in an embodiment of the present disclosure is shown; Figure 6 A schematic diagram showing a scenario in which two communicating parties interact with each other in an embodiment of the present disclosure; Figure 7 A schematic diagram showing another scenario of interaction between two communicating parties in an embodiment of the present disclosure; Figure 8 A flowchart of encrypted communication between two communicating parties in an embodiment of the present disclosure is shown; Fig. 9 A flowchart showing another method of encrypted communication between two communicating parties in an embodiment of the present disclosure is shown; Fig.10 A block diagram showing a structure of a communication device based on quantum key in an embodiment of the present disclosure is shown; Fig.11 A structural block diagram showing another communication device based on quantum key in an embodiment of the present disclosure; and Fig.12 A structural block diagram of an electronic device in an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0017] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that the disclosure will be more comprehensive and complete and to fully convey the concepts of the example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
[0018] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.
[0019] It should be noted that the acquisition, storage, use, and processing of data in the technical solution disclosed in this disclosure are in compliance with the relevant provisions of national laws and regulations, and various types of data such as personal identity data, operation data, behavioral data, etc. related to individuals, customers, and groups obtained in the embodiments of this disclosure have all been authorized.
[0020] For ease of understanding, before introducing the embodiments of the present disclosure, several terms involved in the embodiments of the present disclosure are first explained as follows: Quantum Key Distribution (QKD): A method in which both communicating parties generate symmetric keys by transmitting quantum states, which has information-theoretic security at the theoretical protocol level.
[0021] One-Time Pad (OTP) is an encryption method and one of the most secure encryption methods in theory. Its basic principle is to use a randomly generated key with the same length as the plaintext to encrypt the plaintext. The same key will not be reused after each use, hence the name "one-time pad".
[0022] Stream Cipher: It is a symmetric encryption algorithm that encrypts each bit (or byte) in the plaintext to generate the corresponding ciphertext bit (or byte). The main feature of a stream cipher is that it uses a pseudo-random number generator (PRNG) to generate a key stream, and then performs a bitwise exclusive OR (XOR) operation on the key stream and the plaintext to obtain the ciphertext. Similarly, the decryption process also restores the plaintext by performing a bitwise exclusive OR operation on the key stream and the ciphertext.
[0023] Block Cipher: A type of symmetric cipher that divides plaintext into multiple blocks of equal length. Such data blocks are called groups. Each group is encrypted and decrypted using the same processing and the same key.
[0024] Key Derivation Function (KDF): A function that converts a password (variable length) or key into one or more keys.
[0025] The specific implementation of the embodiment of the present disclosure is described in detail below with reference to the accompanying drawings.
[0026] Figure 1 FIG. 1 shows an exemplary application system architecture diagram to which the communication method based on quantum key in the embodiment of the present disclosure can be applied. Figure 1 As shown, the system architecture may include a first device 101 , a network 102 , and a second device 103 .
[0027] The network 102 is used as a medium for providing a communication link between the first device 101 and the second device 103 , and may be a wired network or a wireless network.
[0028] Optionally, the wireless network or wired network described above uses standard communication technology and / or protocols. The network is typically the Internet, but may also be any network, including but not limited to a local area network (LAN), a metropolitan area network (MAN), a wide area network (WAN), a mobile, wired or wireless network, a private network or any combination of a virtual private network). In some embodiments, technologies and / or formats including Hyper Text Mark-up Language (HTML), Extensible Markup Language (XML), etc. are used to represent data exchanged over the network. In addition, conventional encryption technologies such as Secure Socket Layer (SSL), Transport Layer Security (TLS), Virtual Private Network (VPN), Internet Protocol Security (IP Sec) and the like may be used to encrypt all or some links. In other embodiments, customized and / or dedicated data communication technologies may also be used to replace or supplement the above data communication technologies.
[0029] The first device 101 and the second device 103 are integrated communication and secret devices with quantum key distribution function, that is, devices integrating quantum key distribution function with communication devices, including but not limited to servers, routers, switches, network security devices, Internet of Things devices, vehicle-mounted communication devices, smart phones, tablet computers, laptops, desktop computers, etc. It should be noted that the specific type of integrated communication and secret devices is not limited in the embodiments of the present invention.
[0030] Those skilled in the art will know that Figure 1 The number of devices and networks in the embodiment is only for illustration, and any number of devices and networks may be provided according to actual needs. The embodiments of the present disclosure are not limited to this.
[0031] Under the above system architecture, a communication method based on quantum key is provided in an embodiment of the present disclosure, and the method can be executed by any electronic device with computing and processing capabilities.
[0032] In some embodiments of the present disclosure, the quantum key-based communication method provided in the embodiments of the present disclosure may be executed by the first device of the above-mentioned system architecture; in other embodiments of the present disclosure, the quantum key-based communication method provided in the embodiments of the present disclosure may be executed by the second device of the above-mentioned system architecture; in other embodiments of the present disclosure, the quantum key-based communication method provided in the embodiments of the present disclosure may be implemented by the first device and the second device in the above-mentioned system architecture through interaction.
[0033] Figure 2 A flow chart of a communication method based on quantum keys in an embodiment of the present disclosure is shown. Figure 2 The execution subject of the method provided in the embodiment is a first device, which may also be referred to as a sender or a sending device. Figure 2 The quantum key-based communication method provided in the embodiment of the present disclosure includes the following steps.
[0034] Step S210, determining whether the key quantity of the first device supports a one-time pad method.
[0035] In the disclosed embodiment, the first device and the second device are both integrated communication and secret devices with a quantum key distribution function, that is, the first device and the second device have a quantum key distribution function and a communication function.
[0036] In the disclosed embodiment, the key amount of the first device refers to the remaining quantum key amount stored in the first device, that is, the unused quantum key amount stored in the first device, which can also be understood as the quantum key amount currently available in the first device. The principle of the one-time pad method is to use a randomly generated key with the same length as the plaintext to encrypt the plaintext, and the same key will not be reused after each use.
[0037] In this step, the first device determines whether the remaining quantum key amount stored by the first device is sufficient to support the one-time pad method. Exemplarily, it is determined whether the remaining quantum key amount stored by the first device is greater than or equal to the length of the communication information to be sent. If it is greater than or equal to, it is determined that the key amount of the first device supports the one-time pad method; if it is less than, it is determined that the key amount of the first device does not support the one-time pad method.
[0038] Step S220: If the key quantity of the first device supports the one-time pad method, the one-time pad method is used as the target encryption method.
[0039] In the disclosed embodiment, the target encryption method refers to the encryption method used by the first device to perform encryption processing.
[0040] In this step, if the first device determines that the remaining quantum key amount stored in it is sufficient to support the one-time pad method, that is, the key amount of the first device supports the one-time pad method, the first device uses the one-time pad method as the target encryption method, and subsequently performs encryption processing based on the one-time pad method.
[0041] Step S230, based on the target encryption method, the communication information is encrypted using the quantum key of the first device to obtain a communication message; the communication message includes identification information of the key block and information of the target encryption method, and the identification information of the key block is used to locate the starting position of the quantum key used for encryption processing.
[0042] In the disclosed embodiment, the quantum key of the first device refers to the remaining quantum key stored in the first device, that is, the unused quantum key stored in the first device, which can also be understood as the currently available quantum key in the first device. Communication information refers to the communication content that the first device needs to perform.
[0043] In this step, after determining the target encryption method, the first device will use the remaining quantum key stored therein to encrypt the communication information based on the determined target encryption method to obtain a communication message.
[0044] The communication message includes identification information of the key block, and the identification information of the key block is used to locate the starting position of the quantum key used for encryption processing.
[0045] Exemplarily, the identification information of the key block includes a unique identifier of the key block used for encryption processing, such as an index of the key block, which is used to locate the key block used for encryption processing, or a serial number of the key block, which is used to quickly find the key block used for encryption processing based on the serial number.
[0046] In addition, the identification information of the key block also includes the unique identification of the quantum key used for encryption processing, such as the index of the quantum key used, which is used to locate the quantum key used for encryption processing, and the serial number of the quantum key used, which is used to quickly find the quantum key used for encryption processing according to the serial number.
[0047] The communication message also includes information about a target encryption method, and the target encryption method information is used to indicate the encryption method used by the first device for encryption processing.
[0048] In the embodiments of the present disclosure, the encryption method may include not only the one-time pad method but also other encryption methods, such as stream cipher encryption, block cipher encryption and encryption based on a key derivation function, which is not limited in the embodiments of the present disclosure.
[0049] Table 1 is an example table of encryption methods. As shown in Table 1, the name of the one-time pad method is OPT, and the value is 00x0; the name of the stream cipher encryption is STREAM, and the value is 0x01; the name of the block key encryption is BLOCK, and the value is 0x02; the name of the encryption based on the key derivation function is KDF, and the value is 0x03.
[0050]
[0051] Exemplarily, the target encryption method information in the communication message is the name of the target encryption method, or the target encryption method information is the value of the target encryption method. Of course, the target encryption method information can also be other information, such as the abbreviation of the target encryption method, which is not limited in the embodiments of the present disclosure.
[0052] Table 2 is a message structure table of a communication message. As shown in Table 2, a communication message includes a message header and message content, wherein the message header includes original message header information, identification information of a key block and information of an encryption method.
[0053]
[0054] In the disclosed embodiment, since the communication message includes identification information of the key block, the second device can accurately find the corresponding quantum key according to the identification information of the key block during the decryption process, and use the corresponding quantum key to perform decryption processing; since the communication message includes information on the target encryption method, the second device uses the same decryption method to perform decryption processing.
[0055] Step S240, sending a communication message to the second device, and receiving a message decryption result sent by the second device; the message decryption result is obtained by the second device decrypting the communication message according to the identification information of the key block and the information of the target encryption method.
[0056] After the first device encrypts the communication information to obtain a communication message, it sends the communication message to the second device. After receiving the communication message, the second device decrypts the communication message according to the identification information of the key block in the communication message and the information of the target encryption method, obtains the message encryption result, and then sends the message decryption result to the first device. In this way, the first device receives the message decryption result sent by the second device.
[0057] In the communication method based on quantum key provided by the embodiment of the present disclosure, the first device first determines whether its key quantity supports the one-time one-pad method. If it supports the one-time one-pad method, the one-time one-pad method is used as the target encryption method, and then based on the target encryption method, the communication information is encrypted using the quantum key stored therein to obtain a communication message; after obtaining the communication message, the first device sends the communication message to the second device. Since the communication message includes the identification information of the key block and the information of the target encryption method, and the identification information of the key block is used to locate the starting position of the quantum key used for encryption processing, the second device can decrypt the communication message according to the identification information of the key block and the information of the target encryption method in the communication message, obtain the message decryption result and send it to the first device. In this way, when the key quantity stored in the first device is sufficient, encryption processing is performed based on the one-time one-pad method, which does not rely on the cryptographic algorithm, is suitable for communication scenarios with high security levels, such as voice communication, video communication and other scenarios, and effectively improves the security of communication.
[0058] In some embodiments of the present disclosure, before obtaining a communication message by encrypting communication information using the quantum key of the first device based on a target encryption method, the method further includes: if the key quantity of the first device does not support a one-time pad method, determining whether encryption using a non-one-time pad method is allowed; if encryption using a non-one-time pad method is allowed, determining the target encryption method from a preset encryption method; the preset encryption method includes at least one of a stream cipher algorithm, a block cipher algorithm, and a key derivation function.
[0059] If the first device determines that the remaining quantum key amount stored in it is insufficient to support the one-time pad method, that is, the key amount of the first device does not support the one-time pad method, the first device determines whether to allow encryption using a non-one-time pad method, that is, the first device determines whether the security level requirement allows it. If the first device determines that a non-one-time pad method is allowed, the first device selects a target encryption method from the preset encryption methods. If the first device determines that a non-one-time pad method is not allowed, the first device does not communicate with the second device.
[0060] In the disclosed embodiment, the preset encryption method includes at least one of a stream cipher algorithm, a block cipher algorithm, and a key derivation function. Exemplarily, the stream cipher algorithm and the block cipher algorithm use a 128-bit or 256-bit key, and the 128-bit or 256-bit key uses a quantum key stored in the first device; the key derivation function uses the quantum key stored in the first device, such as 128 bits, as an input of the key derivation function, generates a key string through the key derivation function, and then encrypts the key string and the communication message.
[0061] After selecting a target encryption method from a stream cipher algorithm, a block cipher algorithm, and a key derivation function, based on the target encryption method, the communication information is encrypted using the quantum key stored in the first device to obtain a communication message.
[0062] The quantum key-based communication method provided by the embodiments of the present disclosure can optionally utilize a stream cipher algorithm, a block cipher algorithm, or a key derivation function to encrypt communication information when the amount of keys stored in the first device is insufficient. This increases the flexibility of the encryption process, reduces the consumption of quantum keys, and can adapt to communication scenarios with different key amounts and security levels.
[0063] In some embodiments of the present disclosure, the method further includes: performing quantum key distribution with a second device to obtain a quantum key; storing the quantum key, and managing first identification information of the quantum key.
[0064] In the disclosed embodiment, the first device and the second device (i.e., the communicating parties) generate and share quantum keys using quantum key distribution technology, and store quantum keys.
[0065] Exemplarily, the first device includes a first quantum key distribution module and a first quantum key storage module, and the second device includes a second quantum key distribution module and a second quantum key storage module. The first quantum key distribution module of the first device and the second quantum key distribution module of the second device perform quantum key distribution, generate and share quantum keys, and then the first quantum key storage module of the first device and the second quantum key storage module of the second device store quantum keys respectively.
[0066] In the quantum key-based communication method provided by the embodiment of the present disclosure, the first device and the second device perform quantum key distribution, generate and share quantum keys. In this way, the first device and the second device have quantum key distribution, key storage, and communication encryption functions, which reduces the space occupied by the devices in the computer room and reduces the number of devices that need to be deployed and managed and maintained.
[0067] In some embodiments of the present disclosure, quantum key distribution is performed with a second device to obtain a quantum key, including: if the distance between the first device and the second device is less than or equal to a preset distance threshold, establishing a connection between the first device and the second device, performing quantum key distribution based on the connection, and obtaining a quantum key; if the distance between the first device and the second device is greater than the preset distance threshold, performing quantum key distribution using a quantum key distribution network to obtain a quantum key.
[0068] In the disclosed embodiment, the preset distance threshold is set according to the performance of the quantum key distribution technology and the physical distance between the communicating parties (ie, the first device and the second device).
[0069] If the distance between the first device and the second device is less than or equal to a preset distance threshold, it means that the distance between the first device and the second device is relatively close, and a connection is directly established between the first device and the second device, such as an optical fiber connection, and then quantum key distribution is performed, which can reduce transmission losses and potential security risks.
[0070] If the distance between the first device and the second device is greater than a preset distance threshold, indicating that the distance between the first device and the second device is far, a quantum key distribution network is used for quantum key distribution. Exemplarily, the first device accesses a quantum key distribution network, and the second device accesses a quantum key distribution network, and then the quantum key distribution network is used for quantum key distribution, so that the coverage of quantum key distribution for the first device and the second device can be expanded through the quantum key distribution network, so that the first device and the second device can share keys securely.
[0071] In the disclosed embodiment, the quantum key includes one or more key blocks, that is, the first device and the second device both store the quantum key in the form of key blocks, so that the quantum key can be managed more efficiently.
[0072] In the disclosed embodiment, the first device also manages the first identification information of the quantum key. The first identification information of the quantum key includes a first key block index and first identification information of each key block in one or more key blocks. The first key block index is used to indicate the key block currently used by the first device. Through the first key block index, the first device can quickly locate the key block currently used. The first identification information of each key block includes a key block identifier of the key block, a key block length of the key block, and a first key index of the key block.
[0073] The key block identifier is a unique identifier of the key block, which is used to distinguish different key blocks. The key block length indicates the size of the key block, that is, the number of key bits contained. The first key index of the key block is used to record the length of the key block that has been used in the first device. Through the first key index, the first device can track the used key part in the key block to ensure that the unused key part is used in each communication.
[0074] In the disclosed embodiment, the first device and the second device perform quantum key distribution to generate a quantum key, and both the first device and the second device store the quantum key and maintain identification information of the quantum key. In order to distinguish, the first device maintains the first identification information of the quantum key, that is, the use of the quantum key in the first device, and the second device maintains the second identification information of the quantum key, that is, the use of the quantum key in the second device.
[0075] Table 3 is a storage example table of quantum keys in the first device. As shown in Table 3, the first key block index is 1, indicating that the first device currently uses key block 1. The key block length of key block 1 is 1024, indicating that there are 1024 quantum keys in key block 1, and the first key index of key block 1 is 24, indicating that 24 quantum keys in key block 1 have been used by the first device. The key block length of key block 2 is 1024, indicating that there are 1024 quantum keys in key block 2, and the first key index of key block 2 is 0, indicating that the quantum keys in key block 2 are not used. The key block length of key block 3 is 1024, indicating that there are 1024 quantum keys in key block 3, and the first key index of key block 3 is 0, indicating that the quantum keys in key block 3 are not used.
[0076]
[0077] In the quantum key-based communication method provided by the embodiments of the present disclosure, the first device stores the quantum key in the form of a key block, which can manage the quantum key more efficiently; the first device also maintains first identification information of the quantum key, and the first identification information includes a first key block index to indicate the key block currently used by the first device. The first identification information of the quantum key includes first identification information of each key block, including each key block identification, length and first key index. The first key index is used to record the length of the key block that has been used in the first device, so as to facilitate tracking and identifying the use of the key block.
[0078] Figure 3 The flowchart of obtaining a communication message by encrypting it based on a one-time pad method in the embodiment of the present disclosure is shown. Figure 3 In the case where the target encryption method is a one-time pad method, step S230 encrypts the communication information based on the target encryption method using the quantum key of the first device to obtain a communication message, including the following steps.
[0079] Step S310: Obtain a first key block index, and determine an encryption key block of a first device according to the first key block index.
[0080] In the disclosed embodiment, the first device stores the quantum key and maintains the first identification information of the quantum key, wherein the first identification information includes the first key block index and the first identification information of each key block, and the first identification information of each key block includes the identification, length and first key index of the key block.
[0081] The first device obtains a first key block index from the first identification information of the quantum key maintained by the first device, that is, determines the key block currently being used by the first device, uses the key block currently being used as the encryption key block, and subsequently uses the encryption key block for encryption processing.
[0082] Step S320: Locate the starting position of the first key in the encryption key block according to the first key index of the encryption key block.
[0083] In the embodiment of the present disclosure, the first key starting position in the encryption key block refers to the starting position of the unused quantum key in the first device.
[0084] The first device obtains the first key index of the encryption key block from the first identification information of the quantum key maintained by it. Since the first key index of the encryption key block is used to record the key length used by the encryption key block, the starting position of the unused quantum key in the first device is located according to the first key index of the encryption key block. Taking Table 3 as an example, the first device first determines that the encryption key block is key 1, and according to the first key index 24 of key block 1, the starting position of the first key is located as the 25th key of key block 1, that is, encryption processing starts from the 25th key of key block 1.
[0085] Step S330, starting from the starting position of the first key, using the quantum key in the encryption key block, encrypts the communication information based on a one-time pad method.
[0086] After locating the first key starting position, the communication information is read bit by bit starting from the first key starting position and encrypted using the quantum key in the encryption key block.
[0087] Step S340: If the unused key length of the encryption key block during the encryption process is sufficient to support encrypted communication information, a communication message is obtained.
[0088] During the encryption process, the first device will continuously monitor the length of the unused key of the encryption key block. If the unused key length is long enough to cover the encryption requirements of the entire communication information, the encryption process will be completed and a communication message will be generated.
[0089] Step S350, if the unused key length of the encryption key block during the encryption process is insufficient to support the encryption of communication information, the next key block of the encryption key block is used as a new encryption key block, and the encryption process is continued using the new encryption key block until the encryption process of the communication information is completed and the communication message is obtained.
[0090] If the length of the unused key of the encryption key block is not enough to support the encryption operation, that is, the length of the unused key of the encryption key block cannot cover the encryption requirements of the entire communication information, then after the quantum key in the encryption key block is used up, the first device will automatically switch to the next key block of the encryption key block and use it as a new encryption key block, and then use the new encryption key block to continue encryption processing from the first unencrypted position in the communication information. This process will be repeated until the entire communication information is encrypted and finally a communication message is generated.
[0091] In some embodiments of the present disclosure, the method further includes: determining the first key block index as identification information of the key block and adding it to a message header of the communication message. During the encryption process, the first device uses the first key block index as identification information of the key block in the message header.
[0092] In some embodiments of the present disclosure, the method further includes: determining the first key block index and the first key index of the encryption key block as identification information of the key block, and adding the identification information to the message header of the communication message. During the encryption process, in addition to using the first key block index as identification information of the key block of the message header, the first device also uses the first key index of the encryption key block as identification information of the key block of the message header. It should be noted that the encryption key block here refers to the encryption key block determined by the first device according to the first key block index before encryption processing.
[0093] In some embodiments of the present disclosure, the method further includes: after completing the encryption processing of the communication information, updating the first key block index and the first key index of the key block used for the encryption processing. After the first device encrypts the communication information using the quantum key, the first key block index is updated so that the updated first key block index indicates the key block being used by the first device. In addition, the first device updates the first key index of the key block used in the encryption processing. In the embodiment of the present disclosure, if the quantum key in the encryption key block is used up, the encryption key block is deleted.
[0094] Taking Table 3 as an example, the first device performs encryption processing using the quantum key shown in Table 3, and updates the first key block index and the first key index of the key block used for encryption processing after the encryption processing, to obtain the storage example table of the quantum key updated by the first device shown in Table 4.
[0095]
[0096] In Table 4, the first key block index is 2, indicating that the first device currently uses key block 2. There is no information about key block 1 in Table 4, indicating that key block 1 has been used and deleted. The key block length of key block 2 is 1024, indicating that there are 1024 quantum keys in key block 2, and the first key index of key block 2 is 10, indicating that 10 quantum keys in key block 2 are used. The key block length of key block 3 is 1024, indicating that there are 1024 quantum keys in key block 3, and the first key index of key block 3 is 0, indicating that the quantum key in key block 3 is not used.
[0097] The quantum key-based communication method provided by the embodiment of the present disclosure determines the encryption key block through the first key block index, and then according to the first key index of the encryption key block, can quickly locate the starting position of the unused quantum key in the first device, and then from this position, use the quantum key in the first device to encrypt the communication information once and for all, which can speed up the encryption processing and improve the security of communication. In addition, when the unused key length of the encryption key block is insufficient to encrypt the entire communication information, it can automatically switch to the next key block to continue encryption until the encryption processing of the entire communication information is completed, ensuring that the communication information can be fully encrypted and protected.
[0098] Also, after completing the encryption processing of the communication information, updating the first key block index and the first key index of the key block used for encryption processing helps manage the use of keys, prevents keys from being reused or leaked, and also provides convenience for subsequent communications.
[0099] In addition, the first key block index, or the first key block index and the first key index of the encrypted key block, is added to the message header of the communication message as identification information of the key block, so that the second device can use the corresponding quantum key for decryption processing.
[0100] Figure 4 A flowchart showing another communication method based on quantum keys in an embodiment of the present disclosure is shown. Figure 4 The execution subject of the method provided in the embodiment is a second device, which may also be referred to as a receiving party or a receiving device. Figure 4 The quantum key-based communication method provided in the embodiment of the present disclosure includes the following steps.
[0101] Step S410: receiving a communication message sent by a first device.
[0102] The communication message is obtained by the first device using the quantum key of the first device to encrypt the communication information based on the target encryption method. The communication message includes the identification information of the key block and the information of the target encryption method. The identification information of the key block is used to locate the starting position of the quantum key used for encryption processing.
[0103] In the embodiment of the present disclosure, when the key amount of the first device supports a one-time pad method, the target encryption method is a one-time pad method.
[0104] In the embodiment of the present disclosure, when the key quantity of the first device does not support the one-time pad method, if a non-one-time pad method is allowed, a target encryption method is selected from preset encryption methods. The preset encryption method includes at least one of a stream cipher algorithm, a block cipher algorithm, and a key derivation function.
[0105] In the above embodiment, the process of the first device encrypting the communication information to obtain the communication message has been described, which will not be repeated here.
[0106] Step S420, decrypt the communication message according to the identification information of the key block and the information of the target encryption method to obtain a message decryption result.
[0107] In the disclosed embodiment, the communication message includes identification information of the key block, and the identification information of the key block is used to locate the starting position of the quantum key used for encryption processing. The communication message also includes information of the target encryption method, and the information of the target encryption method is used to indicate the encryption method used by the first device for encryption processing.
[0108] The second device can accurately find the corresponding quantum key according to the identification information of the key block, and determine the decryption method to be used for decryption processing according to the information of the target encryption method, and then decrypt the communication message to obtain the message decryption result.
[0109] Step S430: Send the message decryption result to the first device.
[0110] After obtaining the message decryption result, the second device sends the message decryption result to the first device.
[0111] In the communication method based on quantum key provided by the embodiment of the present disclosure, the second device receives the communication message sent by the first device, decrypts the communication message according to the identification information of the key block and the information of the target encryption method in the communication message, obtains the message decryption result, and sends the message decryption result to the first device. In addition, when the key amount stored in the first device is sufficient, the communication message is obtained by encryption processing based on the one-time pad method, so that the second device can decrypt the communication message based on the one-time pad method, which is suitable for communication scenarios with high security levels, such as voice communication, video communication and other scenarios, and effectively improves the security of communication.
[0112] In some embodiments of the present disclosure, the method further includes: performing quantum key distribution with the first device to obtain a quantum key; storing the quantum key, and managing second identification information of the quantum key.
[0113] In the disclosed embodiment, the first device and the second device (i.e., the communicating parties) generate and share quantum keys using quantum key distribution technology, and store quantum keys.
[0114] Exemplarily, the first device includes a first quantum key distribution module and a first quantum key storage module, and the second device includes a second quantum key distribution module and a second quantum key storage module. The first quantum key distribution module of the first device and the second quantum key distribution module of the second device perform quantum key distribution, generate and share quantum keys, and then the first quantum key storage module of the first device and the second quantum key storage module of the second device store quantum keys respectively.
[0115] In the quantum key-based communication method provided by the embodiment of the present disclosure, the first device and the second device perform quantum key distribution, generate and share quantum keys. In this way, the first device and the second device have quantum key distribution, key storage, and communication encryption functions, which reduces the space occupied by the devices in the computer room and reduces the number of devices that need to be deployed and managed and maintained.
[0116] In some embodiments of the present disclosure, quantum key distribution is performed with a first device to obtain a quantum key, including: if the distance between the first device and the second device is less than or equal to a preset distance threshold, establishing a connection between the first device and the second device, performing quantum key distribution based on the connection, and obtaining a quantum key; if the distance between the first device and the second device is greater than the preset distance threshold, performing quantum key distribution using a quantum key distribution network to obtain a quantum key.
[0117] In the disclosed embodiment, the preset distance threshold is set according to the performance of the quantum key distribution technology and the physical distance between the communicating parties (ie, the first device and the second device).
[0118] If the distance between the first device and the second device is less than or equal to a preset distance threshold, it means that the distance between the first device and the second device is relatively close, and a connection is directly established between the first device and the second device, such as an optical fiber connection, and then quantum key distribution is performed, which can reduce transmission losses and potential security risks.
[0119] If the distance between the first device and the second device is greater than a preset distance threshold, indicating that the distance between the first device and the second device is far, a quantum key distribution network is used for quantum key distribution. Exemplarily, the first device accesses a quantum key distribution network, and the second device accesses a quantum key distribution network, and then the quantum key distribution network is used for quantum key distribution, so that the coverage of quantum key distribution for the first device and the second device can be expanded through the quantum key distribution network, so that the first device and the second device can share keys securely.
[0120] In the disclosed embodiment, the quantum key includes one or more key blocks, that is, the first device and the second device both store the quantum key in the form of key blocks, so that the quantum key can be managed more efficiently.
[0121] In the disclosed embodiment, the second device also manages the second identification information of the quantum key, wherein the second identification information of the quantum key includes the second key block index and the second identification information of each key block in the one or more key blocks.
[0122] The second key block index is used to indicate the key block currently used by the second device. Through the second key block index, the second device can quickly locate the key block currently used, ensuring that the correct key block can be accurately used in each communication.
[0123] The second identification information of each key block includes the key block identification of the key block, the key block length of the key block and the second key index of the key block.
[0124] The key block identifier is a unique identifier of the key block, which is used to distinguish different key blocks. The key block length indicates the size of the key block, that is, the number of key bits contained. The second key index of the key block is used to record the length of the key block that has been used in the second device. Through the second key index, the second device can track the used key part in the key block to ensure that the unused key part is used in each communication.
[0125] In the disclosed embodiment, the first device and the second device perform quantum key distribution to generate a quantum key, and both the first device and the second device store the quantum key and maintain identification information of the quantum key. In order to distinguish, the first device maintains the first identification information of the quantum key, that is, the use of the quantum key in the first device, and the second device maintains the second identification information of the quantum key, that is, the use of the quantum key in the second device.
[0126] Table 5 is a storage example table of quantum keys in the second device. As shown in Table 5, the first key block index is 1, indicating that the second device currently uses key block 1. The key block length of key block 1 is 1024, indicating that there are 1024 quantum keys in key block 1, and the second key index of key block 1 is 24, indicating that 24 quantum keys in key block 1 have been used by the second device. The key block length of key block 2 is 1024, indicating that there are 1024 quantum keys in key block 2, and the second key index of key block 2 is 0, indicating that the quantum keys in key block 2 are not used. The key block length of key block 3 is 1024, indicating that there are 1024 quantum keys in key block 3, and the second key index of key block 3 is 0, indicating that the quantum keys in key block 3 are not used.
[0127]
[0128] In the quantum key-based communication method provided by the embodiments of the present disclosure, the second device stores the quantum key in the form of a key block, which can manage the quantum key more efficiently; the second device also maintains second identification information of the quantum key, and the second identification information includes a second key block index to indicate the key block currently used by the second device. The second identification information of the quantum key includes second identification information of each key block, including each key block identification, length and second key index. The second key index is used to record the length of the key block that has been used in the second device, so as to facilitate tracking and identifying the use of the key block.
[0129] Figure 5 The flowchart of obtaining the message decryption result by performing decryption processing based on a one-time pad method in the embodiment of the present disclosure is shown. Figure 5 In the case where the target encryption method is a one-time pad method, step S420 decrypts the communication message according to the identification information of the key block and the information of the target encryption method to obtain the message decryption result, including the following steps.
[0130] Step S510: Determine the decryption key block of the second device according to the identification information of the key block, and locate the starting position of the second key in the decryption key block.
[0131] In the disclosed embodiment, the identification information of the key block in the communication message indicates the starting position of the quantum key used by the first device for encryption processing. The second device determines the key block to be used when performing decryption processing, that is, the decryption key block, based on the identification information of the key block, that is, the decryption key block is used to perform decryption processing in the future.
[0132] After determining the decryption key block, the second key starting position is further located, that is, the starting position of the quantum key used by the second device when performing decryption processing.
[0133] In some embodiments of the present disclosure, the identification information of the key block includes a first key block index. Wherein, determining the decryption key block of the second device according to the identification information of the key block and locating the second key starting position in the decryption key block includes: determining the decryption key block according to the first key block index; locating the second key starting position according to the second key index of the decryption key block.
[0134] If the identification information of the key block only includes the first key block index, the second device determines the decryption key block according to the first key block index. Since the quantum keys in the first device and the second device are used synchronously, that is, before the first device encrypts the communication information, the first identification information of the quantum key maintained by the first device and the second identification information of the quantum key maintained by the second device are the same. Therefore, the second device can determine the starting position of the second key according to the second key index of the decryption key block stored therein.
[0135] Taking Table 3 and Table 5 as examples, before the first device encrypts the communication information, the first key block index in Table 3 and the second key block index in Table 5 are the same, and the first key index in Table 3 and the second key index in Table 5 are the same. For the communication message generated by the first device, the first key block index in the identification information of its key block is 1. The second device determines that the decryption key block is key block 1 according to the first key block index, and locates the second key starting position as the 25th key of key block 1 according to the second key index 24 of key block 1 stored in the second device, that is, the decryption process starts from the 25th key of key block 1.
[0136] In some embodiments of the present disclosure, the identification information of the key block includes a first key block index and a first key index of the encryption key block. According to the identification information of the key block, determining the decryption key block of the second device and locating the second key starting position in the decryption key block includes: determining the decryption key block according to the first key block index; locating the second key starting position according to the first key index of the encryption key block.
[0137] If the identification information of the key block includes the first key block index and the first key index of the encryption key block, the second device determines the decryption key block according to the first key block index, and then determines the second key starting position according to the first key index of the encryption key block.
[0138] Taking Table 3 as an example, for the communication message generated by the first device, the first key block index in the identification information of the key block is 1, and the first key index of the encryption key block is 24. The second device determines that the decryption key block is key block 1 according to the first key block index, and locates the starting position of the second key as the 25th key of key block 1 according to the first key block index of the encryption key block is 24, that is, the decryption process starts from the 25th key of key block 1.
[0139] Step S520, starting from the starting position of the second key, using the quantum key in the decryption key block, decrypts the communication message based on a one-time pad method.
[0140] After locating the second key starting position, starting from the second key starting position, the communication message is decrypted using the quantum key in the decryption key block based on a one-time-one-pad method.
[0141] Step S530: If the unused key length of the decryption key block during the decryption process is sufficient to support decryption of the communication message, a message decryption result is obtained.
[0142] During the decryption process, the second device will continuously monitor the unused key length of the decryption key block. If the unused key length is long enough to cover the decryption requirements of the entire communication message, the decryption process will be completed and the message decryption result will be obtained.
[0143] Step S540, if the unused key length of the decryption key block is insufficient to support decryption of the communication message during the decryption process, the next key block of the decryption key block is used as a new decryption key block, and the decryption process is continued using the new decryption key block until the decryption process of the communication message is completed and the message decryption result is obtained.
[0144] If the unused key length of the decryption key block is not enough to support the decryption operation, that is, the unused key length of the decryption key block cannot cover the decryption requirements of the entire communication message, then after the quantum key in the decryption key block is used up, the second device will automatically switch to the next key block of the decryption key block and use it as a new decryption key block, and then use the new decryption key block to continue the decryption process from the first position in the communication message that has not been decrypted. This process will be repeated until the entire communication message is decrypted and the message decryption result is obtained.
[0145] In the communication method based on quantum key provided by the embodiment of the present disclosure, the second device determines the decryption key block of the second device through the identification information of the key block in the communication message, locates the starting position of the second key in the decryption key block, that is, locates the starting position of the quantum key used by the second device when performing decryption processing, and then starts from this position, uses the quantum key in the second device to perform one-time one-key decryption on the communication message, which can ensure that the second device uses the key relative to the key used by the first device when performing encryption processing to perform decryption processing, speeds up the decryption processing speed, and improves the security of communication. In addition, when the unused key length of the decryption key block is insufficient to decrypt the entire communication message, it can automatically switch to the next key block to continue decryption until the decryption processing of the entire communication message is completed, ensuring that the completed message decryption result is obtained.
[0146] In some embodiments of the present disclosure, the method further includes: after completing the decryption process of the communication message, updating the second key block index and the second key index of the key block used for the decryption process.
[0147] After the second device decrypts the communication message using the quantum key, it updates the second key block index so that the updated second key block index indicates the key block being used by the second device. In addition, the second device updates the second key index of the key block used in the decryption process.
[0148] In the disclosed embodiment, if the quantum key in the decryption key block has been used up, the decryption key block is deleted.
[0149] The quantum key-based communication method provided by the embodiment of the present disclosure updates the second key block index and the second key index of the key block used for decryption processing after completing the decryption processing of the communication message, which helps to manage the use of the key, prevent the key from being reused or leaked, and also provides convenience for subsequent communications.
[0150] In some embodiments of the present disclosure, the method further includes: if the second device fails to decrypt the communication message, synchronizing the key block index and the key index with the first device.
[0151] In an embodiment of the present disclosure, when the second device attempts to decrypt a received communication message but the decryption fails, such as due to a key mismatch, a key block index error, or other technical problems encountered during the decryption process, the second device will synchronize the key block index and the key index with the first device to ensure that both parties use the same key and key block for encryption and decryption operations.
[0152] Exemplarily, when the second device detects an error during the decryption process or cannot correctly restore the original information, it considers that the decryption has failed. The second device sends a synchronization request to the first device, which may include the key block index and key index currently used by the second device, as well as relevant information about the decryption failure. After receiving the synchronization request, the first device verifies the validity of the request, confirms the key block index and key index currently used, and then sends a response to the second device, which includes the correct key block index and key index. After receiving the response from the first device, the second device updates its stored key block index and key index to match the settings of the first device.
[0153] The quantum key-based communication method provided by the embodiment of the present disclosure can ensure that the second device uses the same key for encryption and decryption operations as the first device by synchronizing the key block index and the key index, thereby maintaining the security of communication; and when the key or key block needs to be updated, the synchronization mechanism can ensure that both devices can obtain the latest key information in a timely manner, supporting a dynamic key update strategy.
[0154] Figure 6 A schematic diagram of a scenario in which two communicating parties interact with each other in an embodiment of the present disclosure is shown. Figure 7FIG. 2 is a schematic diagram showing another scenario in which two communicating parties interact with each other in an embodiment of the present disclosure. Figure 6 , 7 As shown, the communicating parties are the integrated communication and secret device 1 and the integrated communication and secret device 2, both of which have quantum key distribution function and communication function.
[0155] Figure 6 In the scenario shown, the distance between the integrated communication and secret device 1 and the integrated communication and secret device 2 is less than or equal to the preset distance threshold, which means that the distance between the integrated communication and secret device 1 and the integrated communication and secret device 2 is short, and the devices can be directly connected via optical fiber, and quantum key distribution is directly carried out at both ends to continuously generate keys until the amount of quantum keys in the integrated communication and secret device 1 and the integrated communication and secret device 2 reaches the set maximum storage capacity.
[0156] Figure 7 In the scenario shown, the distance between the integrated communication and secret device 1 and the integrated communication and secret device 2 is greater than the preset distance threshold, which means that the distance between the integrated communication and secret device 1 and the integrated communication and secret device 2 is far, and they are respectively connected to the quantum key distribution network, and the quantum key distribution network is used to distribute quantum keys, and keys are continuously generated until the amount of quantum keys in the integrated communication and secret device 1 and the integrated communication and secret device 2 reaches the set maximum storage capacity.
[0157] Figure 8 A flowchart of encrypted communication between two communicating parties in an embodiment of the present disclosure is shown. Figure 8 As shown, the encrypted communication between the communication and secret integration device 1 and the communication and secret integration device 2 is performed according to the following steps.
[0158] Step S801: the integrated communication and secret device 1 and the integrated communication and secret device 2 perform quantum key distribution to obtain a quantum key.
[0159] Step S802: the communication and secret integration device 1 stores the quantum key and maintains the first identification information of the quantum key.
[0160] The quantum key is stored in the form of a key block, the quantum key includes one or more key blocks, and the first identification information of the quantum key includes a first key block index and a key block identifier, a key block length, and a first key index of each key block. The first key block index is used to locate the key block being used by the communication-secret integrated device 1, and the first key index of each key block is used to record the length of the key block that has been used in the communication-secret integrated device 1.
[0161] Step S803: the communication and secret integration device 2 stores the quantum key and maintains the second identification information of the quantum key.
[0162] The quantum key is stored in the form of a key block, the quantum key includes one or more key blocks, and the second identification information of the quantum key includes a second key block index and a key block identifier, a key block length, and a second key index of each key block. The second key block index is used to locate the key block being used by the communication-secret integrated device 2, and the second key index of each key block is used to record the length of the key block that has been used in the communication-secret integrated device 2.
[0163] Step S804: the communication and encryption integrated device 1 obtains the first key block index, determines the encryption key block according to the first key block index, and locates the first key start position according to the first key index of the encryption key block.
[0164] Step S805, the communication and secret integration device 1 starts from the starting position of the first key, adds the first key block index as the key block identifier to the message header, uses the quantum key in the communication and secret integration device 1, and encrypts the communication information based on a one-time one-pad method to obtain a communication message.
[0165] Specifically, starting from the first key starting position, the quantum key in the encryption key block is first used to perform a one-time encryption process. If during the encryption process, the length of the unused key of the encryption key block is sufficient to support the encrypted communication information, a communication message is obtained. If during the encryption process, the length of the unused key of the encryption key block is insufficient to support the encrypted communication information, the next key block of the encryption key block is used as a new encryption key block, and the one-time encryption process is continued using the new encryption key block until the encryption process of the communication information is completed and the communication message is obtained.
[0166] In addition, the message header of the communication message also includes information on the one-time pad method.
[0167] Step S806: the communication and secret integration device 1 sends the communication message to the communication and secret integration device 2.
[0168] Step S807, the communication and encryption integrated device 2 obtains the key block identifier in the communication message, locates the decryption key block according to the first cipher block index in the key block identifier, and locates the second key starting position according to the second key index of the decryption key block.
[0169] Step S808, the communication and secret integrated device 2 starts from the starting position of the second key, uses the quantum key in the communication and secret integrated device 2, and decrypts the communication message based on a one-time one-pad method to obtain a message decryption result.
[0170] Specifically, starting from the second key starting position, the quantum key in the decryption key block is first used to perform a one-time decryption process. If during the decryption process, the length of the unused key of the decryption key block is sufficient to support the decryption of the communication message, the communication message is obtained. If during the decryption process, the length of the unused key of the decryption key block is insufficient to support the decryption of the communication message, the next key block of the decryption key block is used as a new decryption key block, and the one-time decryption process is continued using the new decryption key block until the decryption process of the communication message is completed, and the message decryption result is obtained.
[0171] Step S809, the communication and secret integration device 2 feeds back the communication and secret integration device message decryption result.
[0172] It should be noted that if the communication and secret integration device 2 fails to decrypt the communication message, the communication and secret integration device 1 and the communication and secret integration device 2 perform synchronization operations on the key block index and the key index. Specifically, the first key block index in the communication and secret integration device 1 and the second key block index in the communication and secret integration device 2 are synchronized, and the first key index of the key block in the communication and secret integration device 1 and the second key index of the key block in the communication and secret integration device 2 are synchronized.
[0173] Fig. 9 Another flow chart of encrypted communication between two communicating parties in the embodiment of the present disclosure is shown. Fig. 9 As shown, the encrypted communication between the communication and secret integration device 1 and the communication and secret integration device 2 is performed according to the following steps.
[0174] Step S901: the integrated communication and secret device 1 and the integrated communication and secret device 2 perform quantum key distribution to obtain a quantum key.
[0175] Step S902: the communication and secret integration device 1 stores the quantum key and maintains the first identification information of the quantum key.
[0176] Step S903: the communication and secret integration device 2 stores the quantum key and maintains the second identification information of the quantum key.
[0177] Step S904: the communication and encryption integrated device 1 obtains the first key block index, determines the encryption key block according to the first key block index, and locates the first key start position according to the first key index of the encryption key block.
[0178] Steps S901 to S904 are the same as the above-mentioned steps S801 to S804 and will not be described again here.
[0179] Step S905, the communication and secret integrated device 1 starts from the first key starting position, adds the first key block index and the first key index of the key block indicated by the first key block index as the key block identifier to the message header, uses the quantum key in the communication and secret integrated device 1, and encrypts the communication information based on a one-time one-pad method to obtain a communication message.
[0180] Specifically, starting from the first key starting position, the quantum key in the encryption key block is first used to perform a one-time encryption process. If during the encryption process, the length of the unused key of the encryption key block is sufficient to support the encrypted communication information, a communication message is obtained. If during the encryption process, the length of the unused key of the encryption key block is insufficient to support the encrypted communication information, the next key block of the encryption key block is used as a new encryption key block, and the one-time encryption process is continued using the new encryption key block until the encryption process of the communication information is completed and the communication message is obtained.
[0181] In addition, the message header of the communication message also includes information on the one-time pad method.
[0182] Step S906: the communication and secret integration device 1 sends the communication message to the communication and secret integration device 2.
[0183] Step S907, the communication and encryption integrated device 2 obtains the key block identifier in the communication message, locates the decryption key block according to the first cipher block index in the key block identifier, and locates the second key starting position according to the first key index in the key block identifier.
[0184] Step S908, the communication and secret integrated device 2 starts from the starting position of the second key, uses the quantum key in the communication and secret integrated device 2, and decrypts the communication message based on a one-time one-pad method to obtain a message decryption result.
[0185] Specifically, starting from the second key starting position, the quantum key in the decryption key block is first used to perform a one-time decryption process. If during the decryption process, the length of the unused key of the decryption key block is sufficient to support the decryption of the communication message, the communication message is obtained. If during the decryption process, the length of the unused key of the decryption key block is insufficient to support the decryption of the communication message, the next key block of the decryption key block is used as a new decryption key block, and the one-time decryption process is continued using the new decryption key block until the decryption process of the communication message is completed, and the message decryption result is obtained.
[0186] Step S909, the communication and secret integration device 2 feeds back the communication and secret integration device message decryption result.
[0187] It should be noted that Figure 8 Examples and Fig. 9In the interaction shown in the implementation, the communication and secret integration device 1 and the communication and secret integration device 2 determine to use the one-time one-pad method. Then, if the key amount in the communication and secret integration device 1 is insufficient to support the one-time one-pad method, the communication and secret integration device 1 and the communication and secret integration device 2 do not communicate.
[0188] Fig. 9 Example compared to Figure 8 In the embodiment, when the communication and encryption integrated device 1 performs encryption processing, in addition to adding the first key block index as a key block identifier to the message header, the first key index of the key block indicated by the first key block index is also added as a key block identifier to the message header. Based on this, if the communication message fails to be sent, the key block index and key index synchronization operation are not required.
[0189] The quantum key-based communication method provided by the embodiments of the present disclosure can perform encryption processing based on the one-time pad method when the one-time pad method is supported. It does not rely on cryptographic algorithms and is suitable for communication scenarios with a high security level, such as voice communication, video communication, etc., and effectively improves the security of communication.
[0190] Based on the same inventive concept, the present disclosure also provides a communication device based on quantum keys, as described in the following embodiments. Since the principle of solving the problem in the device embodiment is similar to that in the above method embodiment, the implementation of the device embodiment can refer to the implementation of the above method embodiment, and the repeated parts will not be repeated.
[0191] Fig.10 A block diagram of a communication device based on quantum key in an embodiment of the present disclosure is shown. Fig.10 The apparatus 1000 provided in the embodiment is applied to a first device. Fig.10 The device 1000 includes: an encryption module 1010 and a first communication module 1020.
[0192] Among them, the encryption module 1010 is configured to: determine whether the key amount of the first device supports the one-time one-pad method; if the key amount of the first device supports the one-time one-pad method, use the one-time one-pad method as the target encryption method; based on the target encryption method, use the quantum key of the first device to encrypt the communication information to obtain a communication message; the communication message includes identification information of the key block and information of the target encryption method, and the identification information of the key block is used to locate the starting position of the quantum key used for encryption processing.
[0193] The first communication module 1020 is configured to: send a communication message to the second device, and receive a message decryption result sent by the second device; the message decryption result is obtained by the second device decrypting the communication message according to the identification information of the key block and the information of the target encryption method.
[0194] In some embodiments of the present disclosure, Fig.10 As shown, the device 1000 also includes a first quantum key distribution module 1030 and a first quantum key storage module 1040.
[0195] The first quantum key distribution module 1030 is configured to: perform quantum key distribution with the second device to obtain a quantum key. The first quantum key storage module 1040 is configured to: store the quantum key and manage the first identification information of the quantum key.
[0196] The quantum key includes one or more key blocks, and the first identification information of the quantum key includes a first key block index and first identification information of each key block; the first key block index is used to indicate the key block currently used by the first device; the first identification information of the key block includes a key block identifier of the key block, a key block length of the key block and a first key index of the key block, and the first key index of the key block is used to record the length of the key block that has been used in the first device.
[0197] In some embodiments of the present disclosure, the first quantum key distribution module 1030 is further configured to: if the distance between the first device and the second device is less than or equal to a preset distance threshold, establish a connection between the first device and the second device, perform quantum key distribution based on the connection, and obtain a quantum key; if the distance between the first device and the second device is greater than the preset distance threshold, perform quantum key distribution using a quantum key distribution network to obtain a quantum key.
[0198] In some embodiments of the present disclosure, the encryption module 1010 is further configured to: obtain a first key block index, and determine the encryption key block of the first device according to the first key block index; locate the first key starting position in the encryption key block according to the first key index of the encryption key block; starting from the first key starting position, use the quantum key in the encryption key block to encrypt the communication information based on a one-time-one-pad method; if the unused key length of the encryption key block during the encryption process is sufficient to support the encryption of the communication information, obtain a communication message; if the unused key length of the encryption key block during the encryption process is insufficient to support the encryption of the communication information, use the next key block of the encryption key block as a new encryption key block, and continue the encryption process using the new encryption key block until the encryption process of the communication information is completed and the communication message is obtained.
[0199] In some embodiments of the present disclosure, the first quantum key storage module 1040 is further configured to: after completing the encryption processing of the communication information, update the first key block index and the first key index of the key block used for the encryption processing.
[0200] In some embodiments of the present disclosure, the encryption module 1010 is further configured to: determine the first key block index as identification information of the key block, and add it to the message header of the communication message.
[0201] In some embodiments of the present disclosure, the encryption module 1010 is further configured to: determine the first key block index and the first key index of the encrypted key block as identification information of the key block, and add them to the message header of the communication message.
[0202] In some embodiments of the present disclosure, the encryption module 1010 is further configured to: if the key amount of the first device does not support the one-time pad method, determine whether encryption is allowed using a non-one-time pad method; if encryption is allowed using a non-one-time pad method, determine the target encryption method from a preset encryption method; the preset encryption method includes at least one of a stream cipher algorithm, a block cipher algorithm, and a key derivation function.
[0203] Fig.11 A structural block diagram of another communication device based on quantum key in an embodiment of the present disclosure is shown. Fig.11 The apparatus 1100 provided in the embodiment is applied to a second device. Fig.11 The device 1100 includes: a second communication module 1110 and a decryption module 1120.
[0204] Among them, the second communication module 1110 is configured to: receive a communication message sent by the first device; the communication message is obtained by the first device encrypting the communication information based on the target encryption method using the quantum key of the first device; when the key amount of the first device supports a one-time pad method, the target encryption method is a one-time pad method; the communication message includes identification information of the key block and information of the target encryption method, and the identification information of the key block is used to locate the starting position of the quantum key used for encryption processing.
[0205] The decryption module 1120 is configured to: decrypt the communication message according to the identification information of the key block and the information of the target encryption method to obtain the message decryption result.
[0206] The second communication module 1110 is further configured to: send the message decryption result to the first device.
[0207] In some embodiments of the present disclosure, Fig.11 As shown, the device 1100 also includes a second quantum key distribution module 1130 and a second quantum key storage module 1140.
[0208] The second quantum key distribution module 1130 is configured to: perform quantum key distribution with the first device to obtain a quantum key. The second quantum key storage module 1140 is configured to: store the quantum key and manage the second identification information of the quantum key.
[0209] The quantum key includes one or more key blocks, and the second identification information of the quantum key includes a second key block index and second identification information of each key block; the second key block index is used to indicate the key block currently used by the second device; the second identification information of the key block includes a key block identifier of the key block, a key block length of the key block and a second key index of the key block, and the second key index of the key block is used to record the length of the key block that has been used in the second device.
[0210] In some embodiments of the present disclosure, the second quantum key distribution module 1130 is further configured to: if the distance between the first device and the second device is less than or equal to a preset distance threshold, establish a connection between the first device and the second device, perform quantum key distribution based on the connection, and obtain a quantum key; if the distance between the first device and the second device is greater than the preset distance threshold, perform quantum key distribution using a quantum key distribution network to obtain a quantum key.
[0211] In some embodiments of the present disclosure, the decryption module 1120 is further configured to: determine the decryption key block of the second device according to the identification information of the key block, and locate the starting position of the second key in the decryption key block; starting from the starting position of the second key, use the quantum key in the decryption key block to decrypt the communication message based on a one-time-one-pad method; if the unused key length of the decryption key block during the decryption process is sufficient to support the decryption of the communication message, obtain the message decryption result; if the unused key length of the decryption key block during the decryption process is insufficient to support the decryption of the communication message, then use the next key block of the decryption key block as a new decryption key block, and continue the decryption process using the new decryption key block until the decryption process of the communication message is completed, and obtain the message decryption result.
[0212] In some embodiments of the present disclosure, the second quantum key storage module 1140 is further configured to: after completing the decryption process of the communication message, update the second key block index and the second key index of the key block used for the decryption process.
[0213] In some embodiments of the present disclosure, the identification information of the key block includes a first key block index. The decryption module 1120 is further configured to: determine the decryption key block according to the first key block index; and locate the second key starting position according to the second key index of the decryption key block.
[0214] In some embodiments of the present disclosure, the second quantum key storage module 1140 is further configured to synchronize the key block index and the key index with the first device if the second device fails to decrypt the communication message.
[0215] In some embodiments of the present disclosure, the identification information of the key block includes the first key block index and the first key index of the encrypted key block. The decryption module 1120 is further configured to: determine the decryption key block according to the first key block index; and locate the second key starting position according to the first key index of the encrypted key block.
[0216] It should be noted that the examples and application scenarios implemented by the modules in the above-mentioned device embodiment are the same as those of the corresponding steps in the method embodiment, but are not limited to the contents disclosed in the above-mentioned method embodiment. It should be noted that the above-mentioned modules as part of the device can be executed in a computer system such as a set of computer executable instructions.
[0217] Those skilled in the art will appreciate that various aspects of the present disclosure may be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or an implementation that combines hardware and software aspects, which may be collectively referred to herein as a "circuit," "module," or "system."
[0218] Based on the same inventive concept, an electronic device is also provided in an embodiment of the present disclosure, the electronic device comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute any of the above-mentioned quantum key-based communication methods by executing the executable instructions. Since the principle of solving the problem in the electronic device embodiment is similar to that in the above-mentioned method embodiment, the implementation of the electronic device embodiment can refer to the implementation of the above-mentioned method embodiment, and the repeated parts will not be repeated.
[0219] Refer to the following Fig.12 1200 according to this embodiment of the present disclosure is described. Fig.12 The electronic device 1200 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0220] like Fig.12 As shown, the electronic device 1200 is in the form of a general computing device. The components of the electronic device 1200 may include but are not limited to: at least one processing unit 1210, at least one storage unit 1220, and a bus 1230 connecting different system components (including the storage unit 1220 and the processing unit 1210).
[0221] The storage unit stores program codes, which can be executed by the processing unit 1210, so that the processing unit 1210 executes the steps according to various exemplary embodiments of the present disclosure described in the above “Exemplary Method” section of this specification. For example, the processing unit 1210 can execute the above Figure 2 Steps of the embodiment.
[0222] The storage unit 1220 may include a readable medium in the form of a volatile storage unit, such as a random access storage unit (RAM) 12201 and / or a cache storage unit 12202 , and may further include a read-only storage unit (ROM) 12203 .
[0223] The storage unit 1220 may also include a program / utility 12204 having a set (at least one) of program modules 12205, such program modules 12205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0224] Bus 1230 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0225] The electronic device 1200 may also communicate with one or more external devices 1240 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 1200, and / or may communicate with any device that enables the electronic device 1200 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 1250. In addition, the electronic device 1200 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter 1260. As shown, the network adapter 1260 communicates with other modules of the electronic device 1200 via a bus 1230. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 1200, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.
[0226] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes a number of instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the implementation of the present disclosure.
[0227] Based on the same inventive concept, a computer-readable storage medium is also provided in the embodiment of the present disclosure, on which a computer program is stored, and when the computer program is executed by a processor, any of the above-mentioned quantum key-based communication methods is implemented. Since the principle of solving the problem in the computer-readable storage medium embodiment is similar to that in the above-mentioned method embodiment, the implementation of the computer-readable storage medium embodiment can refer to the implementation of the above-mentioned method embodiment, and the repeated parts will not be repeated.
[0228] More specific examples of computer-readable storage media in the present disclosure may include, but are not limited to, an electrical connection having one or more conductors, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0229] In the present disclosure, a computer readable storage medium may include a data signal propagated in baseband or as part of a carrier wave, wherein a readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A readable signal medium may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0230] Alternatively, the program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.
[0231] In specific implementation, the program code for performing the operation of the present disclosure may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" language or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as an independent software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., using an Internet service provider to connect through the Internet).
[0232] Based on the same inventive concept, a computer program product is also provided in the embodiments of the present disclosure, including a computer program product, including: a computer program or an instruction, which implements any one of the quantum key-based communication methods in the above method embodiments when the computer program or the instruction is executed by the processor. Since the principle of solving the problem in the computer program product embodiment is similar to that in the above method embodiment, the implementation of the computer program product embodiment can refer to the implementation of the above method embodiment, and the repeated parts will not be repeated.
[0233] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.
[0234] In addition, although the steps of the method in the present disclosure are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.
[0235] Through the description of the above implementation modes, it is easy for those skilled in the art to understand that the example implementation modes described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation mode of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the implementation mode of the present disclosure.
[0236] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses or adaptations of the present disclosure, which follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the appended claims.
Claims
1. A communication method based on quantum key, characterized in that: The method is performed by a first device, and includes: Determining whether the key quantity of the first device supports a one-time pad method; If the key quantity of the first device supports the one-time pad method, use the one-time pad method as the target encryption method; Based on the target encryption method, encrypt the communication information using the quantum key of the first device to obtain a communication message; the communication message includes identification information of the key block and information of the target encryption method, and the identification information of the key block is used to locate the starting position of the quantum key used for encryption processing; The communication message is sent to the second device, and a message decryption result sent by the second device is received; the message decryption result is obtained by the second device decrypting the communication message according to the identification information of the key block and the information of the target encryption method.
2. The communication method according to claim 1, characterized in that: The method further comprises: Performing quantum key distribution with the second device to obtain a quantum key; Storing the quantum key and managing the first identification information of the quantum key; The quantum key includes one or more key blocks, and the first identification information of the quantum key includes a first key block index and first identification information of each of the key blocks; The first key block index is used to indicate the key block currently used by the first device; the first identification information of the key block includes the key block identification of the key block, the key block length of the key block and the first key index of the key block, and the first key index of the key block is used to record the length of the key block that has been used in the first device.
3. The communication method according to claim 2, characterized in that: The performing quantum key distribution with the second device to obtain a quantum key includes: If the distance between the first device and the second device is less than or equal to a preset distance threshold, establishing a connection between the first device and the second device, performing quantum key distribution based on the connection, and obtaining the quantum key; If the distance between the first device and the second device is greater than the preset distance threshold, quantum key distribution is performed using a quantum key distribution network to obtain the quantum key.
4. The communication method according to claim 2, characterized in that: The step of encrypting the communication information based on the target encryption mode by using the quantum key of the first device to obtain a communication message includes: Obtaining the first key block index, and determining the encryption key block of the first device according to the first key block index; Locating a first key start position in the encryption key block according to a first key index of the encryption key block; Starting from the starting position of the first key, using the quantum key in the encryption key block, encrypting the communication information based on the one-time pad method; If the unused key length of the encryption key block during the encryption process is sufficient to support encryption of the communication information, obtaining the communication message; If during the encryption process the unused key length of the encryption key block is insufficient to support the encryption of the communication information, the next key block of the encryption key block is used as a new encryption key block, and the encryption process is continued using the new encryption key block until the encryption process of the communication information is completed and the communication message is obtained.
5. The communication method according to claim 4, characterized in that: The method further comprises: After completing the encryption process of the communication information, the first key block index and the first key index of the key block used for the encryption process are updated.
6. The communication method according to claim 4, characterized in that: The method further comprises: The first key block index is determined as identification information of the key block, and is added to a message header of the communication message.
7. The communication method according to claim 4, characterized in that: The method further comprises: The first key block index and the first key index of the encryption key block are determined as identification information of the key block, and added to the message header of the communication message.
8. The communication method according to any one of claims 1 to 7, characterized in that: Before encrypting the communication information using the quantum key of the first device based on the target encryption mode to obtain the communication message, the method further includes: If the key quantity of the first device does not support the one-time pad method, determining whether to allow encryption using a non-one-time pad method; If the non-one-time pad encryption method is allowed, the target encryption method is determined from a preset encryption method; the preset encryption method includes at least one of a stream cipher algorithm, a block cipher algorithm, and a key derivation function.
9. A communication method based on quantum key, characterized in that: The method is performed by a second device, and includes: receiving a communication message sent by a first device; the communication message is obtained by the first device encrypting the communication information based on a target encryption method by using the quantum key of the first device; in the case where the key amount of the first device supports a one-time pad method, the target encryption method is the one-time pad method; the communication message includes identification information of a key block and information of the target encryption method, and the identification information of the key block is used to locate the starting position of the quantum key used for encryption processing; Decrypting the communication message according to the identification information of the key block and the information of the target encryption mode to obtain a message decryption result; Send the message decryption result to the first device.
10. The communication method according to claim 9, characterized in that: The method further comprises: Performing quantum key distribution with the first device to obtain a quantum key; storing the quantum key and managing the second identification information of the quantum key; The quantum key includes one or more key blocks, and the second identification information of the quantum key includes a second key block index and second identification information of each of the key blocks; The second key block index is used to indicate the key block currently used by the second device; the second identification information of the key block includes the key block identification of the key block, the key block length of the key block and the second key index of the key block, and the second key index of the key block is used to record the length of the key block that has been used in the second device.
11. The communication method according to claim 10, characterized in that: The performing quantum key distribution with the first device to obtain a quantum key includes: If the distance between the first device and the second device is less than or equal to a preset distance threshold, establishing a connection between the first device and the second device, performing quantum key distribution based on the connection, and obtaining the quantum key; If the distance between the first device and the second device is greater than the preset distance threshold, quantum key distribution is performed using a quantum key distribution network to obtain the quantum key.
12. The communication method according to claim 10, characterized in that: The decrypting the communication message according to the identification information of the key block and the information of the target encryption mode to obtain a message decryption result includes: Determine the decryption key block of the second device according to the identification information of the key block, and locate the starting position of the second key in the decryption key block; Starting from the starting position of the second key, using the quantum key in the decryption key block, decrypting the communication message based on the one-time pad method; If the unused key length of the decryption key block is sufficient to support decryption of the communication message during the decryption process, obtaining the message decryption result; If during the decryption process the unused key length of the decryption key block is insufficient to support decryption of the communication message, the next key block of the decryption key block is used as a new decryption key block, and the decryption process is continued using the new decryption key block until the decryption process of the communication message is completed and the message decryption result is obtained.
13. The communication method according to claim 12, characterized in that: The method further comprises: After completing the decryption process of the communication message, the second key block index and the second key index of the key block used for the decryption process are updated.
14. The communication method according to claim 12, characterized in that: The identification information of the key block includes a first key block index; The step of determining the decryption key block of the second device according to the identification information of the key block and locating the starting position of the second key in the decryption key block includes: Determining the decryption key block according to the first key block index; The second key starting position is located according to the second key index of the decryption key block.
15. The communication method according to claim 14, characterized in that: The method further comprises: If the second device fails to decrypt the communication message, it synchronizes the key block index and the key index with the first device.
16. The communication method according to claim 12, characterized in that: The identification information of the key block includes a first key block index and a first key index of the encrypted key block; The step of determining the decryption key block of the second device according to the identification information of the key block and locating the starting position of the second key in the decryption key block includes: Determining the decryption key block according to the first key block index; The second key starting position is located according to the first key index of the encryption key block.
17. A communication device based on quantum key, characterized in that: The device is applied to a first device, and includes: an encryption module, configured to determine whether the key amount of the first device supports a one-time pad method; if the key amount of the first device supports the one-time pad method, use the one-time pad method as a target encryption method; based on the target encryption method, encrypt the communication information using the quantum key of the first device to obtain a communication message; the communication message includes identification information of the key block and information of the target encryption method, and the identification information of the key block is used to locate the starting position of the quantum key used for encryption processing; The first communication module is configured to send the communication message to the second device and receive the message decryption result sent by the second device; the message decryption result is obtained by the second device decrypting the communication message according to the identification information of the key block and the information of the target encryption method.
18. A communication device based on quantum key, characterized in that: The device is applied to a second device, and includes: a second communication module configured to receive a communication message sent by a first device; the communication message is obtained by the first device encrypting the communication information based on a target encryption method using the quantum key of the first device; in the case where the key amount of the first device supports a one-time pad method, the target encryption method is the one-time pad method; the communication message includes identification information of a key block and information of the target encryption method, and the identification information of the key block is used to locate the starting position of the quantum key used for encryption processing; A decryption module, configured to decrypt the communication message according to the identification information of the key block and the information of the target encryption mode to obtain a message decryption result; The second communication module is further configured to send the message decryption result to the first device.
19. An electronic device, characterized in that: include: processor; as well as A memory, configured to store executable instructions of the processor; The processor is configured to execute the quantum key-based communication method described in any one of claims 1 to 8, or execute the quantum key-based communication method described in any one of claims 9 to 16 by executing the executable instructions.
20. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, it implements the quantum key-based communication method described in any one of claims 1 to 8, or implements the quantum key-based communication method described in any one of claims 9 to 16.
21. A computer program product comprising: A computer program or instruction, characterized in that when the computer program or instruction is executed by a processor, it implements the quantum key-based communication method described in any one of claims 1 to 8, or implements the quantum key-based communication method described in any one of claims 9 to 16.
Citation Information
Patent Citations
Reliable encryption transmission system and method of quantum cryptography network
CN103840936A
Quantum secret key chip and encryption and decryption method based on quantum secret key chip
CN107769912A
Encryption transmission method and a quantum encryption method
CN109802830A
Identity verification method and device, storage medium and electronic equipment
CN114448629A
Method and system for realizing encryption and decryption of network session data stream by adopting quantum key distribution
CN115567205A
Cited By
Encryption communication method, device, equipment, medium and product
CN121418101A
Cryptographic communication method, apparatus, device, medium, and product
CN121418101B