Communication method and device based on quantum key, storage medium and electronic device
By combining key interception and derivation methods in quantum key distribution technology, the problems of low quantum key code rate and insufficient update frequency are solved, the key usage time is extended, and the security and reuse rate of the key are improved. , ensuring communication security.
Patent Information
- Application Number
- CN202410725569.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-05
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2044-06-05
AI Technical Summary
In the existing quantum key distribution technology, the code rate of quantum keys is low, which leads to the problem of exhaustion of quantum keys due to frequent key updates, and the key update frequency is not enough to ensure communication security.
By combining the key interception method and the key derivation method in the communication device, determine the appropriate key generation method to reuse the quantum key, increase the key update frequency, and determine the key generation method during each data transmission to ensure Key randomness and security.
It extends the usage time of quantum keys, reduces the pressure on quantum key distribution equipment, improves the reuse rate and security of keys, and ensures the safe transmission of each message.
Smart Images

Figure CN118300789B
Abstract
Description
Background Art
[0002] With the development of computer technology and quantum computer equipment, quantum key distribution technology has emerged. Quantum key distribution uses the principles of quantum mechanics to achieve secure key distribution. Since the measurement of quantum state will interfere with its state, any eavesdropping on the quantum state will be discovered, thus ensuring the security of the key. However, the coding rate of quantum keys is relatively low, usually about the order of Kbps.
[0003] In the related art, the utilization schemes for quantum keys include two types: timed update and quantitative update. Timed update uses fixed intervals to update the key, and quantitative update updates the key after encrypting a fixed amount of data. In the current situation where the quantum key coding rate is not high enough, frequent key updates are prone to the problem of quantum key exhaustion.
[0004] 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
[0005] The purpose of the present disclosure is to provide a communication method, device, electronic device and storage medium based on quantum key, which can realize the reuse of quantum key and increase the key update frequency of each message.
[0006] 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.
[0007] According to one aspect of the present disclosure, a communication method based on quantum keys is provided, and the method is applied to a first communication device; the communication method based on quantum keys includes: determining a key generation method for transmitting current communication information; wherein the key generation method is a key interception method or a key derivation method; using the key generation method to process the quantum key in the first communication device to obtain a conversion quantum key; using the conversion quantum key to encrypt the current communication information to obtain a communication information ciphertext; generating a communication message according to the communication information ciphertext and information of the key generation method, and sending the communication message to a second communication device, so that the second communication device decrypts the communication information ciphertext in the communication message based on the key generation method indicated in the communication message and the quantum key stored in the second communication device.
[0008] In one embodiment of the present disclosure, the communication message includes a key generation method field; wherein, when the key generation method is a key interception method, the field value of the key generation method field is a first value; when the key generation method is a key derivation method, the field value of the key generation method field is a second value.
[0009] In one embodiment of the present disclosure, the key generation method is a key interception method; wherein, the key generation method is used to process the quantum key in the first communication device to obtain a converted quantum key, including: determining the starting number of bits for key interception; determining the key length according to the target cryptographic algorithm used to encrypt communication information; in the quantum key, starting from the bit corresponding to the starting number of bits for key interception, continuously intercepting bits whose length meets the key length to obtain the converted quantum key.
[0010] In one embodiment of the present disclosure, determining the starting number of bits for key interception includes: if it is the first time to intercept the quantum key, determining the starting number of bits for key interception as a specified number of bits; if it is not the first time to intercept the quantum key, obtaining the historical conversion quantum key intercepted from the quantum key last time, and determining the starting number of bits for key interception based on the historical conversion quantum key.
[0011] In one embodiment of the present disclosure, determining the number of key interception start bits according to a historical conversion quantum key includes: determining the number of historical key interception start bits of the historical conversion quantum key; determining a sub-bit segment from the historical conversion quantum key, and determining the number of back-shifts according to the sub-bit segment; determining the number of key interception start bits according to the historical key interception start bits and the number of back-shifts.
[0012] In one embodiment of the present disclosure, the communication method based on quantum key also includes: after obtaining the converted quantum key, determining the number of remaining bits of the bits that have not been intercepted in the quantum key; if the number of remaining bits is less than a preset length, applying for a new quantum key.
[0013] In one embodiment of the present disclosure, when the key generation method is a key derivation method, after determining the key generation method for transmitting the current communication information, it also includes: determining a target key derivation algorithm; and the communication message also includes a key derivation algorithm field, and the field value of the key derivation algorithm field is a preset value corresponding to the target key derivation algorithm.
[0014] In one embodiment of the present disclosure, when the key generation method is a key derivation method, the key generation method is used to process the quantum key in the first communication device to obtain a converted quantum key, including: obtaining a historical converted quantum key intercepted from the quantum key last time; obtaining the number of times the key derivation method has been used continuously, and determining the number of times to be calculated according to the number of times it has been used; and performing key derivation processing on the historical converted quantum key for the number of times to be calculated based on a target key derivation algorithm to obtain a converted quantum key.
[0015] In one embodiment of the present disclosure, when the key generation method is a key derivation method, the key generation method is used to process the quantum key in the first communication device to obtain a converted quantum key, including: obtaining a historical key used when a communication message was last sent to a second communication device; wherein the historical key is generated by intercepting the quantum key, or is generated by intercepting the quantum key and then performing at least one key derivation to generate the historical key; and performing key derivation processing on the historical key based on a target key derivation algorithm to obtain a converted quantum key.
[0016] In one embodiment of the present disclosure, the communication message also includes a key derivation algorithm field, and the field value of the key derivation algorithm field is a preset value corresponding to the target key derivation algorithm.
[0017] In one embodiment of the present disclosure, before determining the key generation method for transmitting communication information, the communication method based on quantum key also includes: determining a candidate cryptographic algorithm for communicating with a second communication device; generating an algorithm negotiation communication message based on the candidate cryptographic algorithm, and sending the algorithm negotiation communication message to the second communication device; wherein the algorithm negotiation communication message includes a cryptographic algorithm field, and the field value of the cryptographic algorithm field is a preset value corresponding to the candidate cryptographic algorithm; in response to the algorithm confirmation message returned by the second communication device, determining the candidate cryptographic algorithm as the target cryptographic algorithm for encrypting the communication information.
[0018] In one embodiment of the present disclosure, before determining the key generation method for transmitting communication information, the communication method based on quantum key also includes: sending a quantum key application request to a first quantum key distribution device; the first quantum key distribution device provides a quantum key distribution service for the first communication device; receiving the quantum key issued by the first quantum key distribution device; wherein the quantum key is generated by the first quantum key distribution device and the second quantum key distribution device performing quantum key distribution, and the second quantum key distribution device provides a quantum key distribution service for the second communication device.
[0019] According to another aspect of the present disclosure, a communication method based on quantum key is provided, and the method is applied to a second communication device; the communication method based on quantum key includes: receiving a communication message sent by a first communication device, wherein the communication message indicates a key generation method; wherein the key generation method is a key interception method or a key derivation method; using the key generation method to process the quantum key in the second communication device to obtain a converted quantum key; using the converted quantum key to decrypt the communication information ciphertext in the communication message to obtain the current communication information transmitted by the first communication device.
[0020] In one embodiment of the present disclosure, before receiving a communication message sent by a first communication device, the communication method based on quantum key also includes: receiving an algorithm negotiation communication message sent by the first communication device, the algorithm negotiation communication message including a cryptographic algorithm field; determining a candidate cryptographic algorithm indicated by the first communication device according to the field value of the cryptographic algorithm field; when the second communication device supports the candidate cryptographic algorithm, determining the candidate cryptographic algorithm as a target cryptographic algorithm for decrypting the current communication information sent by the first communication device, and returning an algorithm confirmation message to the first communication device.
[0021] In one embodiment of the present disclosure, before receiving a communication message sent by a first communication device, the communication method based on quantum key also includes: receiving a quantum key issued by a second quantum key distribution device; wherein the quantum key is generated by the first quantum key distribution device and the second quantum key distribution device performing quantum key distribution after the first communication device sends a quantum key application request to the first quantum key distribution device, and the first quantum key distribution device provides quantum key distribution services for the first communication device.
[0022] According to another aspect of the present disclosure, a communication device based on quantum key is provided, and the communication device is applied to a first communication device; the communication device includes: a determination module, which is used to determine a key generation method for transmitting current communication information; wherein the key generation method is a key interception method or a key derivation method; a first key generation module, which is used to process the quantum key in the first communication device using the key generation method to obtain a conversion quantum key; an encryption module, which is used to encrypt the current communication information using the conversion quantum key to obtain a communication information ciphertext; a message sending module, which is used to generate a communication message according to the communication information ciphertext and information of the key generation method, and send the communication message to a second communication device, so that the second communication device decrypts the communication information ciphertext in the communication message based on the key generation method indicated in the communication message and the quantum key stored in the second communication device.
[0023] According to another aspect of the present disclosure, a communication device based on quantum key is provided, and the communication device is applied to a second communication device; the communication device includes: a message receiving module, used to receive a communication message sent by a first communication device, and the communication message indicates a key generation method; wherein the key generation method is a key interception method or a key derivation method; a second key generation module, which uses the key generation method to process the quantum key in the second communication device to obtain a converted quantum key; and a decryption module, which uses the converted quantum key to decrypt the communication information ciphertext in the communication message to obtain the current communication information transmitted by the first communication device.
[0024] According to another aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the above-mentioned quantum key-based communication method is implemented.
[0025] According to another aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute the above-mentioned quantum key-based communication method by executing the executable instructions.
[0026] According to another aspect of the present disclosure, a computer program product is provided, including a computer program, wherein when the computer program is executed by a processor, the above-mentioned quantum key-based communication method is implemented.
[0027] The quantum key-based communication method provided by the embodiments of the present disclosure enables a first communication device to determine a key generation method for current communication information, then use the key generation method to process a pre-acquired quantum key to obtain a converted quantum key, and then use the converted quantum key to encrypt the current communication information, and send the encrypted communication information ciphertext and key generation method information to a second communication device through a communication message, so that the second communication device decrypts the communication information ciphertext in the communication message based on the key generation method indicated in the communication message and the same quantum key obtained in advance, obtains the current communication information sent by the first communication device, and realizes communication based on quantum keys; wherein, the key interception method in the key generation method consumes quantum keys, and the key derivation method does not consume quantum keys. It can be seen that, on the one hand, this scheme can combine the key interception method that consumes quantum keys with the key derivation method that does not consume quantum keys, so as to improve the reuse rate of quantum keys and extend the use time of quantum keys, thereby reducing the frequency of communication devices applying for quantum keys and alleviating the quantum key distribution pressure of quantum key distribution devices; on the other hand, in this scheme, each time the first communication device needs to transmit data information to the second communication device, a key generation method for the current data information transmission can be determined, and then the key generation method is used to process the pre-acquired quantum key with high security and randomness to obtain a conversion quantum key that is only used for the current communication information, so that the encryption key (i.e., the conversion quantum key) used for each message sent by the first communication device to the second communication device can be different, thereby ensuring the randomness and update frequency of the key on the basis of improving the reuse rate of the quantum key, and ensuring the secure transmission of each message.
[0028] 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
[0029] 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.
[0030] Figure 1 A schematic diagram showing an exemplary system architecture to which the quantum key-based communication method according to an embodiment of the present disclosure can be applied;
[0031] Figure 2 A flow chart of a quantum key-based communication method according to an embodiment of the present disclosure is shown;
[0032] Figure 3 A flow chart of obtaining a converted quantum key by key interception in a quantum key-based communication method according to an embodiment of the present disclosure is shown;
[0033] Figure 4 A flow chart showing the number of starting bits for key interception according to a historically converted quantum key in a quantum key-based communication method according to an embodiment of the present disclosure is shown;
[0034] Figure 5 A flow chart of obtaining a converted quantum key by a key derivation method in a quantum key-based communication method according to an embodiment of the present disclosure is shown;
[0035] Figure 6 A flow chart showing a target cryptographic algorithm agreed upon by both parties in a quantum key-based communication method according to an embodiment of the present disclosure is shown;
[0036] Figure 7 A schematic diagram showing consumption of quantum keys in a quantum key-based communication method according to an embodiment of the present disclosure is shown;
[0037] Figure 8 A flowchart of a quantum key-based communication method according to another embodiment of the present disclosure is shown;
[0038] Fig. 9 A schematic diagram of a communication method based on a quantum key according to an embodiment of the present disclosure is shown;
[0039] Fig.10 A block diagram of a quantum key-based communication device according to an embodiment of the present disclosure is shown;
[0040] Fig.11 A block diagram showing a quantum key-based communication device according to yet another embodiment of the present disclosure; and
[0041] Fig.12A structural block diagram of a quantum key-based communication computer device in an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0042] 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.
[0043] 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.
[0044] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of the present disclosure, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.
[0045] Figure 1 A schematic diagram showing an exemplary system architecture to which the quantum key-based communication method according to an embodiment of the present disclosure can be applied is shown.
[0046] like Figure 1 As shown, the system architecture may include a server 101, a network 102, and a client 103. The network 102 is used to provide a medium for a communication link between the client 103 and the server 101. The network 102 may include various connection types, such as wired, wireless communication links, or optical fiber cables.
[0047] In an exemplary embodiment, the client 103 for data transmission with the server 101 may include, but is not limited to, electronic devices of types such as smart phones, desktop computers, tablet computers, laptop computers, smart speakers, digital assistants, AR (Augmented Reality) devices, VR (Virtual Reality) devices, and smart wearable devices. Optionally, the operating system running on the electronic device may include, but is not limited to, Android system, IOS system, Linux system, Windows system, and the like.
[0048] Server 101 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. In some practical applications, server 101 can also be a server of a network platform, which can be, for example, a trading platform, a live broadcast platform, a social platform, or a music platform, etc., which is not limited in the embodiments of the present disclosure. Among them, the server can be a single server or a cluster formed by multiple servers, and the present disclosure does not limit the specific architecture of the server.
[0049] In an exemplary embodiment, servers 101 and servers 101, servers 101 and clients 103, and clients 103 and clients 103 that can establish a communication connection can all be the first communication device and the second communication device in a communication method based on quantum keys. For example, multiple clients 103 can include a first communication device and a second communication device; server 101 can be a QKD (Quantum Key Distribution) device, the first communication device and the second communication device can each register with a different QKD device, and the registered QKD device can send the same quantum key to the first communication device and the second communication device, respectively, so that the first communication device and the second communication device can communicate based on quantum keys.
[0050] In an exemplary embodiment, the process in which the client 103, as the first communication device, implements a communication method based on a quantum key may be that the first communication device determines a key generation method for transmitting current communication information; the first communication device uses the key generation method to process the quantum key in the first communication device to obtain a converted quantum key; the first communication device uses the converted quantum key to encrypt the current communication information to obtain a communication information ciphertext; the first communication device generates a communication message based on the communication information ciphertext and information on the key generation method, and sends the communication message to the second communication device, so that the second communication device decrypts the communication information ciphertext in the communication message based on the key generation method indicated in the communication message and the quantum key stored in the second communication device.
[0051] In an exemplary embodiment, the quantum key-based communication method provided by the present disclosure can be used in a scenario where both parties to the communication use the symmetric key obtained by quantum key distribution to perform secure communication, and both parties to the communication perform key updates according to the current key content and the specified strategy. The quantum key-based communication method provided by the present disclosure can be based on the premise that both parties to the communication access the quantum key distribution service, and the premise that both parties to the communication use quantum keys to perform secure communication and key updates.
[0052] In addition, it should be noted that Figure 1 What is shown is only one application environment of the quantum key-based communication method provided by the present disclosure. Figure 1 The numbers of servers 101, networks 102 and clients 103 are merely illustrative, and any number of clients, networks and servers may be provided according to actual needs.
[0053] In order to enable ordinary persons in the art to better understand the technical solution of the present disclosure, the various steps of the quantum key-based communication method in the exemplary embodiment of the present disclosure will be described in more detail below with reference to the accompanying drawings and embodiments.
[0054] Figure 2 The flowchart of the communication method based on quantum key according to one embodiment of the present disclosure is shown. The communication method based on quantum key is applied to a first communication device. The first communication device and the second communication device in the method provided by the embodiment of the present disclosure can be as follows: Figure 1 The server 101 or the client 103 is shown, but the present disclosure is not limited thereto.
[0055] In the following examples, the server 101 is used as the execution subject for illustration.
[0056] like Figure 2 As shown, the quantum key-based communication method provided by the embodiment of the present disclosure may include the following steps.
[0057] Step S201, determining a key generation method for transmitting current communication information; wherein the key generation method is a key interception method or a key derivation method.
[0058] In this step, before this step, the first communication device has established a communication connection with the second communication device, and the current communication information is data information that the first communication device is ready to transmit to the second communication device. Whenever the first communication device is ready to transmit data information to the second communication device, a key generation method for the current data information transmission can be determined.
[0059] In the key interception mode, bits can be intercepted from the quantum key to achieve key generation, and in the key derivation mode, bits intercepted from the quantum key can be derived to achieve key generation. In other words, it can be considered that the key interception mode consumes the quantum key, while the key derivation mode does not consume the quantum key.
[0060] Among them, when determining which key generation method to use, it can be randomly determined by the first communication device (for example, randomly generate 0 or 1), for example, determined based on a randomly generated 01 character string, thereby improving the randomness of determining the key generation method; it can also be determined by a fixed time update method, such as using a key interception method once every ten minutes, and using a key derivation method within the time period of two adjacent key interception methods; it can also be used once every a certain number of communication messages, and a key derivation method is used between two adjacent key interception methods, such as using a key interception method once every ten messages, and using a key derivation method for each of the remaining messages.
[0061] It can be seen that in the communication method provided by the present disclosure, the quantum key is not consumed every time a communication message is sent, but the key interception method that consumes the quantum key can be combined with the key derivation method that does not consume the quantum key to obtain the encryption and decryption key used in the communication. This method can improve the reuse rate of the quantum key, extend the use time of the quantum key, and deal with the problem of insufficient quantum key quantity, thereby reducing the frequency of communication equipment applying for quantum keys and alleviating the pressure of quantum key distribution on quantum key distribution equipment.
[0062] In some practical applications, after the first communication device establishes a communication connection with the second communication device and before this step, the first communication device and the second communication device can also obtain the same quantum key issued by a QKD (Quantum Key Distribution) device, and can agree on a cryptographic algorithm supported by both parties for encryption and decryption of data in communication.
[0063] In some embodiments, the communication message includes a key generation method field; wherein, when the key generation method is a key interception method, the field value of the key generation method field is a first value; when the key generation method is a key derivation method, the field value of the key generation method field is a second value.
[0064] For example, the first value corresponding to the key interception method may be 1, and the second value corresponding to the key derivation method may be 0.
[0065] Step S203: Process the quantum key in the first communication device using a key generation method to obtain a conversion quantum key.
[0066] Among them, using a key generation method to process the quantum key in the first communication device may be using a key interception method or a key derivation method to process the quantum key in the first communication device to obtain a conversion quantum key. The quantum key may be a key generated by a quantum key distribution (QKD) method, which is a technology that uses the principles of quantum mechanics to achieve secure key exchange. The conversion quantum key obtained by processing the quantum key in the first communication device using the key generation method determined for the current communication information can be used only for encryption processing of the current communication information. It can be seen that whenever the first communication device is preparing to transmit data information to the second communication device, it can process the quantum key based on the key generation method determined at that time to obtain a conversion quantum key that is only used for the current communication information, so that the encryption key used for each message sent by the first communication device to the second communication device can be different. Each message sent uses the key generation method determined at that time to process the pre-stored quantum key. The encryption keys used in multiple message sending are all based on the same quantum key. It can be seen that on the one hand, the key update frequency can be guaranteed on the basis of improving the reuse rate of quantum keys; on the other hand, since the encryption key is generated based on a quantum key with high security and randomness, the security of each message can be further improved.
[0067] Step S205, using the converted quantum key to encrypt the current communication information to obtain the communication information ciphertext.
[0068] Among them, the first communication device can use the cryptographic algorithm agreed upon in advance by the communicating parties to encrypt the current communication information to obtain the ciphertext of the communication information.
[0069] Step S207, generate a communication message according to the communication information ciphertext and the information of the key generation method, and send the communication message to the second communication device, so that the second communication device decrypts the communication information ciphertext in the communication message based on the key generation method indicated in the communication message and the quantum key stored in the second communication device.
[0070] Among them, the information of the key generation method can be reflected as a key generation method field in the generated communication message. In some practical applications, generating a communication message according to the communication information ciphertext and the information of the key generation method can include: determining the field value of the key generation method field according to the key generation method; wherein, when the key generation method is a key interception method, the field value of the key generation method field is a first value; when the key generation method is a key derivation method, the field value of the key generation method field is a second value; adding the field value of the key generation method field to the message header, and putting the communication information ciphertext into the message body to generate a communication message.
[0071] In some practical applications, the first communication device and the second communication device can obtain in advance a communication protocol that supports the communication method provided by the present disclosure, and then obtain the definition of the key generation method field based on the communication protocol; after the second communication device receives the above-mentioned communication message, it can parse the key generation method field in the communication message, and obtain the specific key generation method indicated by the first communication device in the communication message to generate the same conversion quantum key in the second communication device, and then the second communication device can use the cryptographic algorithm agreed upon in advance by the communicating parties and the locally generated conversion quantum key to decrypt the communication information ciphertext in the communication message to obtain the current communication information sent by the first communication device.
[0072] In the method provided by the present disclosure, the first communication device and the second communication device can obtain the same quantum key in advance. Through the communication method based on quantum key provided by the present disclosure, the first communication device can determine the key generation method for the current communication information, and then use the key generation method to process the pre-acquired quantum key to obtain a conversion quantum key, and then use the conversion quantum key to encrypt the current communication information, and send the encrypted communication information ciphertext and the information of the key generation method to the second communication device through a communication message, so that the second communication device decrypts the communication information ciphertext in the communication message based on the key generation method indicated in the communication message and the same quantum key obtained in advance, obtains the current communication information sent by the first communication device, and realizes communication based on quantum key; wherein, the key interception method in the key generation method consumes quantum keys, and the key derivation method does not consume quantum keys. It can be seen that, on the one hand, this scheme can combine the key interception method that consumes quantum keys with the key derivation method that does not consume quantum keys, so as to improve the reuse rate of quantum keys and extend the use time of quantum keys, thereby reducing the frequency of communication devices applying for quantum keys and alleviating the quantum key distribution pressure of quantum key distribution devices; on the other hand, in this scheme, each time the first communication device needs to transmit data information to the second communication device, a key generation method for the current data information transmission can be determined, and then the key generation method is used to process the pre-acquired quantum key with high security and randomness to obtain a conversion quantum key that is only used for the current communication information, so that the encryption key (i.e., the conversion quantum key) used for each message sent by the first communication device to the second communication device can be different, thereby ensuring the randomness and update frequency of the key on the basis of improving the reuse rate of the quantum key, and ensuring the secure transmission of each message.
[0073] Figure 3 A flow chart of obtaining a converted quantum key by key interception in a quantum key-based communication method according to an embodiment of the present disclosure is shown, and the flow is executed by a first communication device, such as Figure 3 As shown, in some embodiments, the key generation method is a key interception method; using the key interception method to process the quantum key in the first communication device to obtain the converted quantum key includes the following steps.
[0074] Step S301, determine the starting number of bits for key truncation.
[0075] In this step, the determined key interception starting bit number will be used for the quantum key. For example, assuming that the length of the quantum key is 1024, that is, it consists of 1024 bits, then if the key interception starting bit number is determined to be 19, the key interception can be started from the 19th bit in the quantum key to obtain the converted quantum key.
[0076] In some embodiments, determining the starting number of bits for key interception includes: if it is the first time to intercept the quantum key, determining the starting number of bits for key interception to be a specified number of bits; if it is not the first time to intercept the quantum key, obtaining the historical conversion quantum key intercepted from the quantum key last time, and determining the starting number of bits for key interception based on the historical conversion quantum key.
[0077] Among them, the current communication information may be the communication information sent for the first time after the first communication device establishes a communication connection with the second communication device, or it may be the communication information sent non-first time. The current situation that the quantum key is intercepted for the first time may correspond to the following practical situations: the current communication information is the communication information sent by the first communication device to the second communication device for the first time, or the quantum key is newly obtained and has not been used, and the information encryption strategy in the communication has just been changed to the method provided by the present disclosure, etc. In this case, the starting number of bits for key interception can be determined as a specified number of bits to achieve interception from the specified number of bits of the quantum key; for example, the specified number of bits can be set to 1, so that interception can be achieved from the first bit of the quantum key; the specified number of bits can be set to 5, so that interception can be achieved from the fifth bit of the quantum key. Among them, when the specified number of bits is set to 1, waste of bits in the quantum key can be avoided.
[0078] The fact that this is not the first time that the quantum key is intercepted may correspond to the following actual situation: the first communication device has previously intercepted a key for communication from the quantum key. In this case, the information of the historical conversion quantum key intercepted from the quantum key last time can be used to calculate the starting number of bits for key interception.
[0079] Figure 4 A flow chart showing the number of starting bits for key interception according to a historically converted quantum key in a communication method based on a quantum key according to an embodiment of the present disclosure is shown. The flow chart is executed by a first communication device, such as Figure 4 As shown, in some embodiments, when it is not the first time to intercept a quantum key, determining the starting number of bits for key interception based on historically converted quantum keys may include the following steps.
[0080] Step S401, determining the starting number of bits for truncation of the historical key of the historical conversion quantum key.
[0081] The starting number of bits for historical key interception is the starting number of bits when the historical conversion quantum key is intercepted from the quantum key. For example, assuming that there is a quantum key of "11010001100110110011011...", when the historical conversion quantum key is intercepted from it, it is intercepted from the 5th bit, that is, "0001100110110011011..." is intercepted as the historical conversion quantum key, then the starting number of bits for historical key interception is 5.
[0082] Step S403, determining a sub-bit segment from the historical conversion quantum key, and determining the number of post-shift bits according to the sub-bit segment.
[0083] Some bits in the historical conversion quantum key can be intercepted to form sub-bit segments, and then the sub-bit segments are converted to a base, so as to determine the number of shifted bits based on the result of the base conversion.
[0084] The length of the sub-bit segment may be a preset value, such as 1, 3, 7, 10, etc., and the starting bit intercepted in the historical conversion quantum key may also be specified, such as intercepting from the 1st bit, the 2nd bit, the 5th bit, etc. For example, assuming that it is specified to intercept from the 1st bit of the historical conversion quantum key and the length of the sub-bit segment is 7 bits, the first 7 bits of the historical conversion quantum key may be taken as the sub-bit segment, and then the number of shifted bits may be determined according to the decimal conversion result of the sub-bit segment.
[0085] The length of the sub-bit segment can also be determined based on the key length specified in the cryptographic algorithm agreed upon in advance by the communicating parties, so that the number of back-shift bits corresponding to the sub-bit segment is included in the range of 1 to the key length.
[0086] In some practical applications, the key interception method can be shifted back by bits, that is, with 1 bit as the shift granularity, in this way, the number of shifted bits can be taken to be any integer corresponding to the range of 1 to the key length (the unit of the key length is bit). The exponent of the key length with base 2 can be used as the length of the sub-bit segment. For example, if the key length specified in the cryptographic algorithm is 128 bits, the exponent of 128 with base 2 is calculated to be 7, then 7 can be determined as the length of the sub-bit segment; if the key length specified in the cryptographic algorithm is 256 bits, the exponent of 256 with base 2 is calculated to be 8, then 8 can be determined as the length of the sub-bit segment.
[0087] For example, assuming that there is a historical conversion quantum key of "0001100110110011011...", the key length specified in the cryptographic algorithm is 128 bits, it is specified to start intercepting from the first bit of the historical conversion quantum key, and the key interception method is shifted back according to the bit, then the first 7 bits can be intercepted from the historical conversion quantum key "0001100110110011011..." to obtain the sub-bit segment "0001100", and then "0001100" can be converted to decimal to obtain the value "12", so the number of shifted bits can be determined based on "12". Among them, in order to ensure that at least one bit (i.e., a new bit) can be used each time the key is intercepted, the value obtained after the decimal conversion of the sub-bit segment can be added by 1 to obtain the final number of shifted bits. In this example, the value "13" obtained by adding 1 to "12" can be used as the number of shifted bits.
[0088] In some practical applications, the key interception method can also be shifted back by bytes, that is, with 1 byte (8 bits) as the shift granularity, in this way, the number of shifted bits can be taken as a positive integer multiple of 8 in the range of 1 to the key length (the unit of the key length is bit). Specifically, since 1 byte is 8 bits, the exponent of the key length with base 2 can be calculated, and then 3 can be subtracted from the exponent result to obtain the length of the sub-bit segment. For example, if the key length specified in the cryptographic algorithm is 128 bits, the exponent of 128 with base 2 is 7, then the value "4" obtained by subtracting 7 from 3 can be determined as the length of the sub-bit segment; if the key length specified in the cryptographic algorithm is 256 bits, the exponent of 256 with base 2 is 8, then the value "5" obtained by subtracting 8 from 3 can be determined as the length of the sub-bit segment.
[0089] For example, assuming that there is a historical conversion quantum key of "0001100110110011011...", the key length specified in the cryptographic algorithm is 128 bits, it is specified to start intercepting from the first bit of the historical conversion quantum key, and the key interception method is shifted back by bytes, then the first 4 bits can be intercepted from the historical conversion quantum key "0001100110110011011..." to obtain the sub-bit segment "0001", and then "0001" can be converted to decimal to obtain the value "1", so the number of shifted bits can be determined based on "1". Among them, in order to ensure that new bits can be used each time the key is intercepted, the value obtained after the sub-bit segment is converted to decimal can be added by 1 to obtain the number of bytes to be shifted, and then multiplied by 8 to obtain the final number of shifted bits. In this example, the value "2" obtained by adding "1" to 1 can be used as the number of bytes to be shifted back; then "2" is multiplied by 8 to obtain the value "16", and finally "16" is used as the number of shifted bits.
[0090] Furthermore, different shifting modes (including shifting by bit and shifting by byte) in the key interception mode can also be reflected in the field value of the key generation mode field. The key generation mode field can contain at least two valid bits, and the key interception mode or key derivation mode is represented by different values of the first valid bit, and the shifting by bit or by byte is represented by different values of the second valid bit. In some practical applications, the first communication device can randomly choose to use the shifting by bit or the shifting by byte to improve the randomness of the key interception mode.
[0091] In some practical applications, Table 1 shows some field values of the key generation method field and their corresponding meanings.
[0092]
[0093] As shown in Table 1, a field value of "0x00" represents "key derivation", a field value of "0x01" represents "key interception and bit shifting", and a field value of "0x11" represents "key interception and byte shifting". Referring to Table 1, the field value of the key generation method field is a two-digit hexadecimal number, the low bit of the field value can be used to indicate one of the key interception method and the key derivation method, and the high bit of the field value can be used to indicate one of the bit shifting and byte shifting under the key interception method. Specifically, when the low bit of the field value is 0, it can indicate that the key generation method is the key derivation method, where the high bit can be set to 0 or 1, because at this time only the low bit in the field value is effective, and the value set to the high bit has no meaning and does not affect the result; when the low bit in the field value is 1, it indicates that the key generation method is the key interception method. In this case, when the high bit in the field value is 1, it can indicate that the key interception is performed using the "byte-shifted" method, and when the high bit in the field value is 0, it can indicate that the key interception is performed using the "bit-shifted" method.
[0094] The first communication device can fill in the field value of the key generation method field in the message header of the communication message according to the key generation method it specifically selects, and then send it to the second communication device through the communication message; after the second communication device receives the communication message, it can parse the content of the key generation method field in the communication message based on the content of Table 1 to obtain the key generation method used by the first communication device, and then use the same method to obtain the converted quantum key.
[0095] Step S405, determining the key interception starting number of bits according to the historical key interception starting number of bits and the number of backward shift bits.
[0096] The sum of the starting digits of the historical key interception and the number of the shifted digits can be used as the starting digits of the key interception. For example, assuming that the starting digit of the historical key interception is the 5th digit in the quantum key and the number of the shifted digits is "13", then 5+13 can be calculated, and "18" is the starting digit of the key interception this time.
[0097] Through Figure 4 The method for determining the starting number of bits for key interception in the illustrated embodiment can control the formation of the starting number of bits for key interception based on multiple factors, and transmit the various factors to the communication counterpart (i.e., the second communication device) through the field value of the key generation method field, thereby enriching the generation factors of key interception and improving the flexibility and randomness of key interception.
[0098] Step S303, determining the key length according to the target cryptographic algorithm used to encrypt the communication information.
[0099] In this step, the target cryptographic algorithm used to encrypt the communication information may be agreed upon in advance by the communicating parties through algorithm negotiation of the communication message, or may be a default algorithm specified in the communication protocol.
[0100] Step S305, in the quantum key, starting from the bit corresponding to the starting number of key interception bits, continuously intercepting bits whose length meets the key length to obtain the converted quantum key.
[0101] For example, assuming that there is a historical conversion quantum key of “0001100110110011011…”, the starting number of key interception is “7”, and the key length is 128 bits, then you can start intercepting from the 7th bit in “0001100110110011011…”, and intercept a total of 128 consecutive bits to obtain the conversion quantum key “0110110011011… (128 bits in total)”.
[0102] In some embodiments, the communication method based on quantum key further includes: after obtaining the converted quantum key, determining the number of remaining bits of the bits that have not been intercepted in the quantum key; if the remaining number of bits is less than a preset length, applying for a new quantum key. The first communication device may apply for a new quantum key from the first quantum key distribution device with which it is registered.
[0103] The preset length can be the key length or a value greater than the key length (such as two key lengths). In the key interception mode, the number of back-shifts can be any integer corresponding to the range of 1 to the key length (the unit of the key length is bits). If the remaining unused bits in the quantum key are less than a key length, it means that the remaining bits in the quantum key are not enough to support the maximum value of the back-shift number in a key interception (i.e., the number of back-shifts = key length). At this time, a new quantum key can be applied to obtain a converted quantum key using the new quantum key.
[0104] In some embodiments, the key generation method is a key derivation method; wherein, after determining the key generation method for transmitting the current communication information, it also includes: determining a target key derivation algorithm.
[0105] A set of one or more key derivation algorithms may be pre-set, and a target key derivation algorithm may be selected from the set. The key derivation algorithm may be, for example, derived using a key derivation function of GB / T 32918.3 SM2, derived using a cryptographic hash algorithm, derived using a message authentication code based on a cryptographic hash algorithm, and the like.
[0106] In some practical applications, a key derivation algorithm can be determined only in the first communication, which is used to generate conversion quantum keys under all key derivation methods in this communication connection.
[0107] In some practical applications, the key derivation algorithm used before this and the next key interception can also be determined in a key derivation method immediately following a key interception method, thereby improving the randomness of the conversion quantum key generated in this scheme to a certain extent.
[0108] In some practical applications, each time a key derivation method is determined to be used to obtain a conversion quantum key, a target key derivation algorithm can be reselected, thereby further improving the randomness of generating the conversion quantum key in this scheme.
[0109] In some practical applications, the key derivation method may be applied to a scenario where the current communication information is not the communication information sent by the first communication device to the second communication device for the first time.
[0110] Figure 5 A flow chart of obtaining a converted quantum key by a key derivation method in a quantum key-based communication method according to an embodiment of the present disclosure is shown. The flow chart is executed by a first communication device, such as Figure 5 As shown, in some embodiments, using a key derivation method to process a quantum key in a first communication device to obtain a conversion quantum key includes the following steps.
[0111] Step S501, obtaining the historical conversion quantum key intercepted from the quantum key last time.
[0112] Step S503, obtaining the number of times the key derivation method has been used continuously, and determining the number of times to be calculated according to the number of times used.
[0113] In this step, the number of times the key derivation method has been used continuously can be considered as the number of times the key is derived based on the historical conversion quantum key. The number of times used can be added by one to obtain the number of times to be calculated. For example, assuming that the number of times the key derivation method has been used continuously is 4, it can be determined that the number of times to be calculated is 5.
[0114] Step S505, performing key derivation processing on the historical conversion quantum key for the number of times to be calculated based on the target key derivation algorithm to obtain the conversion quantum key.
[0115] For example, assuming that it is determined that the number of times to be calculated is 5, the target key derivation algorithm can be used to perform key derivation processing for 5 consecutive times on the historical conversion quantum key obtained in step S501.
[0116] In such Figure 5 In the method of generating a conversion quantum key using a key derivation method as shown, the key derivation algorithm used before this and the next key interception can be determined in a key derivation method immediately following a key interception method. For example, when the first communication device uses the key interception method when sending a message to the second communication device for the (N-1)th time, and it is determined to use the key derivation method for the Nth time, a key derivation algorithm can be determined before sending the message for the Nth time. If it is determined to use the key derivation method for the (N+1)th time, it is not necessary to determine the key derivation algorithm again, but the key derivation algorithm selected for the Nth time can be used. Similarly, if it is determined to use the key derivation method for the (N+2)th time, the key derivation algorithm used last time (i.e., the key derivation algorithm selected for the Nth time) can also be used, and so on, until the continuity of the key derivation method is interrupted.
[0117] In some embodiments, the conversion quantum key is generated using a key derivation method, which may also be the following process: determining a historical key used by a first communication device when it last sent a communication message to a second communication device; performing a key derivation process on the historical key using a target key derivation algorithm determined for this communication to obtain a conversion quantum key.
[0118] In this embodiment, the target key derivation algorithm can be re-determined each time the key derivation method is determined to be used in the communication, which can greatly improve the randomness of the conversion quantum key generated in this scheme. In which, when the target key derivation algorithm remains unchanged, the result of the conversion quantum key obtained in this embodiment is the same as Figure 5 The results of converting the quantum key obtained in the illustrated embodiments are consistent.
[0119] In some embodiments, the communication message also includes a key derivation algorithm field, and the field value of the key derivation algorithm field is a preset value corresponding to the target key derivation algorithm.
[0120] The communication message sent by the first communication device to the second communication device may include a key generation method field and a key derivation algorithm field, wherein the key generation method field indicates the use of a key derivation method for processing; then, after the second communication device receives such a communication message, it can parse the key derivation algorithm field in the communication message, and obtain the specific key derivation algorithm indicated by the first communication device in the communication message to generate the same conversion quantum key in the second communication device, and then the second communication device can use the cryptographic algorithm pre-agreed by the communicating parties and the locally generated conversion quantum key to decrypt the communication information ciphertext in the communication message to obtain the current communication information sent by the first communication device.
[0121] In some practical applications, Table 2 shows some field values of the key derivation algorithm field and their corresponding meanings.
[0122]
[0123] As shown in Table 2, the field value of the key derivation algorithm field is a hexadecimal number, and each hexadecimal number can represent a key derivation algorithm.
[0124] After selecting the key derivation method, the first communication device can further select the key derivation algorithm it wants to use, and fill in the field value of the key derivation algorithm field in the message header of the communication message according to the key derivation algorithm it selects, and then send it to the second communication device through the communication message; after the second communication device receives the communication message, it can parse the content of the key derivation algorithm field in the communication message based on the content of Table 2 to obtain the key derivation algorithm used by the first communication device, and then use the same method to obtain the converted quantum key.
[0125] Figure 6 A flowchart of a target cryptographic algorithm agreed upon by both parties in a communication method based on a quantum key according to an embodiment of the present disclosure is shown. The flowchart can be executed by a first communication device, such as Figure 6As shown, in some embodiments, before determining the key generation method for transmitting communication information, the communication method based on quantum key also includes the communicating parties agreeing on a target cryptographic algorithm according to the following steps.
[0126] Step S601: A first communication device determines a candidate cryptographic algorithm for communicating with a second communication device.
[0127] Among them, a set consisting of one or more cryptographic algorithms can be pre-set, and a candidate cryptographic algorithm can be selected from the set. The cryptographic algorithm can be a cipher suitable for processing communication information. A block cipher (Block Cipher) can be selected as the cryptographic algorithm in this embodiment. The block cipher is a type of symmetric cipher, which can divide the plaintext into multiple blocks of equal length. Such data blocks are called groups, and each group is encrypted and decrypted with the same processing process and the same key. In addition to the encryption and decryption method, the cryptographic algorithm in this embodiment can also include key length, working mode, filling method, etc.; wherein, the encryption and decryption method can be, for example, SM4 cryptographic algorithm (my country's block cipher algorithm standard), AES (Advanced Encryption Standard, Advanced Encryption Standard) cryptographic algorithm; the key length can be, for example, 128 bits, 256 bits, etc.; the working mode is the use of the block cipher algorithm, for example, it can be CBC (Cipher BlockChaining, ciphertext block chaining mode), CFB (Cipher Feedback, ciphertext feedback mode), CTR (counter, counter mode) and other working modes; the filling method can be agreed upon by both parties in advance, such as the first byte of the filling value is 0x80, and the other bytes are filled with 0.
[0128] Step S603: The first communication device generates an algorithm negotiation communication message according to the candidate cryptographic algorithm, and sends the algorithm negotiation communication message to the second communication device; wherein the algorithm negotiation communication message includes a cryptographic algorithm field, and the field value of the cryptographic algorithm field is a preset value corresponding to the candidate cryptographic algorithm.
[0129] In some practical applications, Table 3 shows some field values of the cryptographic algorithm field and their corresponding meanings.
[0130]
[0131] As shown in Table 3, the field value of the cryptographic algorithm field can be composed of two hexadecimal numbers, where the first hexadecimal number can be 0x00, 0x01, and 0x02, respectively representing three cryptographic algorithm-key length combinations of "SM4, key length 128 bits", "AES-128", and "AES-256"; the second hexadecimal number can be 0x00, 0x01, and 0x02, respectively representing "CBC working mode", "CFB working mode", and "CTR working mode".
[0132] Step S605: In response to the algorithm confirmation message returned by the second communication device, the first communication device determines the candidate cryptographic algorithm as the target cryptographic algorithm for encrypting the communication information.
[0133] The first communication device can select the candidate cryptographic algorithm it wants to use, and fill the field value of the cryptographic algorithm field in the message header of the communication message according to the candidate cryptographic algorithm it selects, and then send it to the second communication device through the communication message; after the second communication device receives the communication message, it can parse the content of the cryptographic algorithm field in the communication message based on the content of Table 3 to learn the candidate cryptographic algorithm used by the first communication device, and then the second communication device can determine whether it supports the candidate cryptographic algorithm. If it does, it can return an algorithm confirmation message to the first communication device and determine to use the candidate cryptographic algorithm as the target cryptographic algorithm to be used in subsequent or current communication; after the first communication device receives the algorithm confirmation message returned by the second communication device, it can also use the candidate cryptographic algorithm as the target cryptographic algorithm to be used in subsequent or current communication. In this way, both parties have completed the agreement on the target cryptographic algorithm.
[0134] In addition, if the second communication device finds that it does not support the candidate cryptographic algorithm, it can return an algorithm rejection message to the first communication device, so that the first communication device selects a new candidate cryptographic algorithm, and both parties re-select the candidate cryptographic algorithm according to the above. Figure 6 Alternatively, after the second communication device finds that it does not support the candidate cryptographic algorithm, it can return an algorithm rejection message and the cryptographic algorithm supported by the second communication device to the first communication device, so that the first communication device can first determine the cryptographic algorithm supported by both parties based on the cryptographic algorithm supported by the second communication device, and then select a new candidate cryptographic algorithm from the cryptographic algorithms supported by both parties, thereby accelerating the completion of the target cryptographic algorithm agreement.
[0135] In some practical applications, after the first communication device and the second communication device agree to use a target cryptographic algorithm for communication, the target cryptographic algorithm can be used for encryption and decryption in communication until one of the two communication parties triggers a cryptographic algorithm update condition, and then the two parties renegotiate a new cryptographic algorithm. The cryptographic algorithm update condition can be related to the number of communication messages, communication duration, etc. For example, if the number of communication messages between the two communication parties exceeds a quantity threshold (such as 200, 500, 1000, etc.), or if the communication duration exceeds a duration threshold (such as 4 hours, 12 hours, etc.), the update condition can be retriggered. Figure 6 The process of both parties agreeing on a target cryptographic algorithm is shown, wherein the process of re-agreeing on the target cryptographic algorithm can be initiated by the first communication device or the second communication device.
[0136] In some embodiments, before the first communication device determines the key generation method for transmitting communication information, the communication method based on quantum key also includes: the first communication device sends a quantum key application request to the quantum key distribution module, so that the quantum key distribution module issues the same quantum key to the first communication device and the second communication device.
[0137] Specifically, the first communication device can send a quantum key application request to the first quantum key distribution device; wherein the first quantum key distribution device provides quantum key distribution services for the first communication device; the first communication device receives the quantum key issued by the first quantum key distribution device; wherein the quantum key is generated by quantum key distribution between the first quantum key distribution device and the second quantum key distribution device, and the second quantum key distribution device provides quantum key distribution services for the second communication device.
[0138] In this embodiment, the quantum key distribution module may include two QKD (Quantum Key Distribution) devices. The two QKD devices may be divided into QKD device 1 and QKD device 2, wherein the first communication device may register for service with QKD device 1, and the second communication device may register for service with QKD device 2; after the first communication device and the second communication device establish a connection, the first communication device or the second communication device may first apply for a quantum key to the QKD device to which it is registered. The following takes the example of the first communication device first applying for a quantum key from QKD device 1 as an example.
[0139] The first communication device can obtain the peer information required to apply for the quantum key during the process of establishing a connection with the second communication device. The peer information can be the identification of the second communication device and / or the identification of the QKD device 2; then the first communication device sends a quantum key application request carrying the peer information to the QKD device 1; the QKD device 1 can determine the QKD device 2 according to the peer information, and perform quantum key distribution with the QKD device 2 to determine the quantum key; then the QKD device 1 and the QKD device 2 can respectively issue the quantum key to the communication devices registered thereon, that is, the QKD device 1 issues the quantum key to the first communication device, and the QKD device 2 issues the same quantum key to the second communication device. At this point, the quantum key distribution module is implemented to issue the same quantum key to the first communication device and the second communication device.
[0140] Figure 7 A schematic diagram of consuming quantum keys in a quantum key-based communication method according to an embodiment of the present disclosure is shown. Figure 7 As shown, it includes 7 message sending, involving 4 key interception and 3 key derivation.
[0141] refer to Figure 7 , when sending a message for the first time, the quantum key QK is intercepted for the first time, and the converted quantum key K1 is obtained for the information encryption and decryption in the message sent for the first time. When sending a message for the second time, the K1 intercepted from the quantum key QK is key derived, and the converted quantum key K11 is obtained for the information encryption and decryption in the message sent for the second time, where KDF(·) is a key derivation algorithm. When sending a message for the third time, the K11 intercepted and derived based on the quantum key QK is key derived, and the converted quantum key K12 is obtained for the information encryption and decryption in the message sent for the third time.
[0142] When sending the message for the fourth time, the quantum key QK is intercepted for the second time to obtain the converted quantum key K2 for encryption and decryption of the information in the message sent for the fourth time.
[0143] When the message is sent for the fifth time, the quantum key QK is intercepted for the third time to obtain the converted quantum key K3 for encryption and decryption of the information in the message sent for the fifth time.
[0144] When the message is sent for the sixth time, key derivation is performed on K3 intercepted from the quantum key QK to obtain the converted quantum key K31 for encryption and decryption of information in the message sent for the sixth time.
[0145] When the message is sent for the 7th time, the quantum key QK is intercepted for the fourth time to obtain the converted quantum key K4 for encryption and decryption of the information in the message sent for the 7th time.
[0146] Depend on Figure 7It can be seen that combining the key interception method that consumes quantum keys with the key derivation method that does not consume quantum keys can not only improve the reuse rate of quantum keys and extend the use time of quantum keys, but also increase the randomness of the key generation method. Therefore, the randomness and update frequency of keys can be guaranteed on the basis of improving the reuse rate of quantum keys, thereby ensuring the secure transmission of each message.
[0147] Figure 8 FIG. 2 is a flow chart of a communication method based on a quantum key according to another embodiment of the present disclosure. The communication method based on a quantum key according to this embodiment is applied to a second communication device. Figure 8 As shown, the quantum key-based communication method provided by the embodiment of the present disclosure may include the following steps.
[0148] Step S801, receiving a communication message sent by a first communication device, wherein the communication message indicates a key generation method; wherein the key generation method is a key interception method or a key derivation method.
[0149] The communication message may include a key generation method field; when the key generation method is a key interception method, the field value of the key generation method field is a first value; when the key generation method is a key derivation method, the field value of the key generation method field is a second value.
[0150] In addition, when the key generation method is a key interception method, the field value of the key generation method field can also indicate one of shifting back by bits and shifting back by bytes; when the key generation method is a key derivation method, the communication message can include a key derivation algorithm field, and the field value of the key derivation algorithm field can indicate which key derivation algorithm is used to obtain the converted quantum key.
[0151] Step S803: Process the quantum key in the second communication device using a key generation method to obtain a conversion quantum key.
[0152] Step S805, use the converted quantum key to decrypt the communication information ciphertext in the communication message to obtain the current communication information transmitted by the first communication device.
[0153] Figure 8 The other contents of the embodiment can refer to the other embodiments mentioned above and will not be elaborated here.
[0154] In some embodiments, before the second communication device receives the communication message sent by the first communication device, the communication method based on quantum key also includes: the second communication device receives the algorithm negotiation communication message sent by the first communication device, and the algorithm negotiation communication message includes a cryptographic algorithm field; the second communication device determines the candidate cryptographic algorithm indicated by the first communication device according to the field value of the cryptographic algorithm field; when the second communication device supports the candidate cryptographic algorithm, the second communication device determines the candidate cryptographic algorithm as the target cryptographic algorithm for decrypting the current communication information sent by the first communication device, and returns an algorithm confirmation message to the first communication device, so that the first communication device determines the candidate cryptographic algorithm as the target cryptographic algorithm for encrypting the communication information.
[0155] In addition, when the second communication device does not support the candidate cryptographic algorithm, an algorithm rejection message may be returned to the first communication device, so that the first communication device and the second communication device renegotiate a new cryptographic algorithm.
[0156] In some embodiments, before the second communication device receives the communication message sent by the first communication device, the communication method based on quantum key also includes: receiving a quantum key issued by a second quantum key distribution device; wherein the quantum key is generated by the first quantum key distribution device and the second quantum key distribution device performing quantum key distribution after the first communication device sends a quantum key application request to the first quantum key distribution device; wherein the first quantum key distribution device provides quantum key distribution services for the first communication device.
[0157] Through the communication method based on quantum key provided by the present disclosure, in the communication message sent by the first communication device and received by the second communication device, a specific key generation method can be indicated, and the specific key generation method is one of the key interception method and the key derivation method, so that the second communication device uses the same key generation method as the first communication device to process the quantum key, and obtains the conversion quantum key used to decrypt the communication information ciphertext. Among them, the key interception method in the key generation method consumes the quantum key, and the key derivation method does not consume the quantum key. Therefore, this communication method can improve the reuse rate of the quantum key and extend the use time of the quantum key, thereby reducing the frequency of the communication device applying for the quantum key and alleviating the pressure of the quantum key distribution device. In addition, in this scheme, each time the data information is transmitted, the key generation method used for the current data information transmission can be determined once, and then the key generation method can be used to process the pre-obtained quantum key with high security and randomness, and a conversion quantum key used only for the current communication information is obtained, so that the encryption and decryption keys (i.e., conversion quantum keys) used for each communication message can be different, so that the key update frequency can be guaranteed on the basis of improving the reuse rate of the quantum key, and the security of each message can be improved.
[0158] Fig. 9 FIG. 1 is a schematic diagram of a communication method based on quantum keys according to an embodiment of the present disclosure. Fig. 9 As shown, it includes communication device 1 and communication device 2, QKD device 1 and QKD device 2. The communication method based on quantum key may include the following steps.
[0159] Step S901, communication device 1 registers for QKD service with QKD device 1.
[0160] Step S903, communication device 2 registers for QKD service with QKD device 2.
[0161] There is no limitation on the execution order of step S901 and step S903.
[0162] Step S905, the communication device 1 carries the peer information to apply for a quantum key to the QKD device 1, where the peer information may include at least one of the identification of the communication device 2 and the identification of the QKD device 2.
[0163] Step S907: QKD device 1 and QKD device 2 perform quantum key distribution to determine the quantum key QK.
[0164] Step S909, QKD device 1 sends quantum key QK to communication device 1.
[0165] Step S911, QKD device 2 sends quantum key QK to communication device 2.
[0166] There is no limitation on the execution order of step S909 and step S911.
[0167] In step S913, communication device 1 selects a target cryptographic algorithm supported by both communication device 1 and communication device 2, uses the key length specified in the target cryptographic algorithm to extract the first converted quantum key K1 from the quantum key QK, and uses K1 to encrypt the first information to be sent in the current communication to obtain a first ciphertext.
[0168] Step S915, communication device 1 generates a first communication message according to the first ciphertext and information of the target cryptographic algorithm, and sends it to communication device 2.
[0169] Step S917, communication device 2 receives the first communication message, obtains the target cryptographic algorithm, uses the key length specified in the target cryptographic algorithm to intercept the first converted quantum key K1 from the quantum key QK, and uses K1 to decrypt the first ciphertext in the first communication message to obtain the first information.
[0170] In step S919, the communication device 1 determines that the key generation method for transmitting the second information is the key interception method, and then uses the key interception method to intercept the second converted quantum key K2 from the quantum key QK, and uses K2 to encrypt the second information to be sent in the current communication to obtain the second ciphertext.
[0171] Step S921: Communication device 1 generates a second communication message according to the second ciphertext and information about the key interception method, and sends it to communication device 2.
[0172] Step S923, communication device 2 receives the second communication message, obtains the key interception method indicated by communication device 1, uses the key interception method to intercept the second converted quantum key K2 from the quantum key QK, and uses K2 to decrypt the second ciphertext in the second communication message to obtain the second information.
[0173] In step S925, the communication device 1 determines that the key generation method for transmitting the third information is a key derivation method, and determines the target key derivation algorithm for key derivation, and then uses the target key derivation algorithm to process the second conversion quantum key K2 to obtain the third conversion quantum key K21, and uses K21 to encrypt the third information to be sent in the current communication to obtain the third ciphertext.
[0174] Step S927, communication device 1 generates a third communication message according to the third ciphertext, information on the key derivation method, and information on the target key derivation algorithm, and sends it to communication device 2.
[0175] Step S929, communication device 2 receives the third communication message, obtains the key derivation method indicated by communication device 1 and the target key derivation algorithm thereunder, uses the target key derivation algorithm to process the second conversion quantum key K2, obtains the third conversion quantum key K21, and uses K21 to decrypt the third ciphertext in the third communication message to obtain the third information.
[0176] The above is the process of sending communication information three times by the communication device 1 as the sender.
[0177] In some practical applications, in order to avoid confusion in the keys determined by both parties due to simultaneous packet transmission, the two parties can use different quantum keys as the source of encryption keys, that is, both parties maintain two quantum keys, for example, QK1 and QK2 (QK: Quantum Key). Then add a flag to QK1 in communication device 1 to indicate that QK1 is used by communication device 1 to encrypt information sent to communication device 2, and add a flag to QK2 in communication device 1 to indicate that QK2 is used by communication device 1 to decrypt information sent from communication device 2; similarly, add a flag to QK1 in communication device 2 to indicate that QK1 is used by communication device 2 to decrypt information sent from communication device 1, and add a flag to QK2 in communication device 2 to indicate that QK2 is used by communication device 2 to encrypt information sent to communication device 1. In short, the information sent by communication device 1 can be encrypted based on QK1 and decrypted by communication device 2 based on QK1, while the information sent by communication device 2 can be encrypted based on QK2 and decrypted by communication device 1 based on QK2, so as to avoid the situation where the two parties send packets at the same time, which causes confusion in the key determination of both parties and causes the encryption and decryption of the two parties to be out of sync.
[0178] Among them, regarding the two quantum keys maintained by the two communicating parties, when they are first issued, they can both be issued in response to the quantum key application request of the first communication device, or they can both be issued in response to the quantum key application request of the second communication device, or one of them can be issued in response to the quantum key application request of the first communication device and the other can be issued in response to the quantum key application request of the second communication device. In the subsequent communication process, when one party in the communication finds that the number of remaining bits of the unintercepted bits in the quantum key used for encryption is less than the preset length (such as the key length), this party can apply for a new quantum key from the quantum key distribution device registered with it.
[0179] For example, in the above practical application, if the second communication device finds that the number of remaining bits of the unintercepted bits in QK2 is less than the key length, the second communication device can apply for a new quantum key to the second quantum key distribution device that provides quantum key distribution services for it, and then the second quantum key distribution device performs quantum key distribution with the first quantum key distribution device to generate QK3, and then the second quantum key distribution device sends QK3 to the second communication device, and the first quantum key distribution device sends QK3 to the first communication device. After the first communication device and the second communication device have received QK3 respectively, the first communication device and the second communication device can both stop using QK2, and in the subsequent communication process, the second communication device encrypts based on QK3, and the first communication device decrypts based on QK3.
[0180] In some practical applications, if both the first communication device and the second communication device have not received QK3, and the second communication device needs to send information at this time, the second communication device can continue to communicate with the first communication device using a key derivation method based on QK2 until both parties receive the newly applied quantum key.
[0181] Through Fig. 9 The quantum key-based communication method shown in the figure does not require communication equipment to have QKD capabilities. Instead, the communication equipment can use the QKD service by registering the QKD equipment, which is easy to expand the existing communication equipment. At the same time, only a small amount of field information needs to be added to the message to achieve the synchronization of the key update strategy (i.e., the key generation method), and the modification of the communication process and communication equipment is relatively simple.
[0182] It should be noted that the above figures are only schematic illustrations of the processes included in the method according to an exemplary embodiment of the present invention, and are not intended to be limiting. It is easy to understand that the processes shown in the above figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.
[0183] Fig.10 A block diagram of a communication device 1000 based on a quantum key according to an embodiment of the present disclosure is shown, and the communication device is applied to a first communication device; Fig.10 As shown, it includes: a determination module 1001, used to determine a key generation method for transmitting current communication information; wherein the key generation method is a key interception method or a key derivation method; a first key generation module 1002, used to process the quantum key in the first communication device using the key generation method to obtain a conversion quantum key; an encryption module 1003, used to encrypt the current communication information using the conversion quantum key to obtain a communication information ciphertext; a message sending module 1004, used to generate a communication message according to the communication information ciphertext and the information of the key generation method, and send the communication message to the second communication device, so that the second communication device decrypts the communication information ciphertext in the communication message based on the key generation method indicated in the communication message and the quantum key stored in the second communication device.
[0184] Through the quantum key-based communication device provided by the present disclosure, a first communication device can determine a key generation method for current communication information, then use the key generation method to process a pre-acquired quantum key to obtain a conversion quantum key, and then use the conversion quantum key to encrypt the current communication information, and send the encrypted communication information ciphertext and key generation method information to a second communication device through a communication message, so that the second communication device decrypts the communication information ciphertext in the communication message based on the key generation method indicated in the communication message and the same quantum key obtained in advance, obtains the current communication information sent by the first communication device, and realizes communication based on quantum keys; wherein, the key interception method in the key generation method consumes quantum keys, and the key derivation method does not consume quantum keys. It can be seen that, on the one hand, this scheme can combine the key interception method that consumes quantum keys with the key derivation method that does not consume quantum keys, so as to improve the reuse rate of quantum keys and extend the use time of quantum keys, thereby reducing the frequency of communication devices applying for quantum keys and alleviating the quantum key distribution pressure of quantum key distribution devices; on the other hand, in this scheme, each time the first communication device needs to transmit data information to the second communication device, a key generation method for the current data information transmission can be determined, and then the key generation method is used to process the pre-acquired quantum key with high security and randomness to obtain a conversion quantum key that is only used for the current communication information, so that the encryption key (i.e., the conversion quantum key) used for each message sent by the first communication device to the second communication device can be different, thereby ensuring the randomness and update frequency of the key on the basis of improving the reuse rate of the quantum key, and ensuring the secure transmission of each message.
[0185] In some embodiments, the communication message includes a key generation method field; wherein, when the key generation method is a key interception method, the field value of the key generation method field is a first value; when the key generation method is a key derivation method, the field value of the key generation method field is a second value.
[0186] In some embodiments, the key generation method is a key interception method; wherein the first key generation module 1002 uses the key generation method to process the quantum key in the first communication device to obtain a converted quantum key, including: determining the starting number of bits for key interception; determining the key length according to the target cryptographic algorithm used to encrypt communication information; in the quantum key, taking the bit corresponding to the starting number of bits for key interception as the starting point, continuously intercepting bits whose length satisfies the key length to obtain a converted quantum key.
[0187] In some embodiments, the first key generation module 1002 determines the starting number of bits for key interception, including: if it is the first time to intercept the quantum key, the starting number of bits for key interception is determined to be a specified number of bits; if it is not the first time to intercept the quantum key, the historical conversion quantum key intercepted from the quantum key last time is obtained, and the starting number of bits for key interception is determined based on the historical conversion quantum key.
[0188] In some embodiments, the first key generation module 1002 determines the number of key interception starting bits based on the historical conversion quantum key, including: determining the number of historical key interception starting bits of the historical conversion quantum key; determining a sub-bit segment from the historical conversion quantum key, and determining the number of back-shifts based on the sub-bit segment; determining the number of key interception starting bits based on the historical key interception starting bits and the number of back-shifts.
[0189] In some embodiments, the quantum key-based communication device also includes a quantum key application module 1005, which is used to determine the number of remaining bits of uninterrupted bits in the quantum key after obtaining the converted quantum key; if the remaining number of bits is less than the key length, apply for a new quantum key.
[0190] In some embodiments, when the key generation method is a key derivation method, the determination module 1001 is further used to determine the target key derivation algorithm after determining the key generation method used to transmit the current communication information; and the communication message also includes a key derivation algorithm field, and the field value of the key derivation algorithm field is a preset value corresponding to the target key derivation algorithm.
[0191] In some embodiments, when the key generation method is a key derivation method, the first key generation module 1002 uses the key generation method to process the quantum key in the first communication device to obtain a conversion quantum key, including: obtaining a historical conversion quantum key intercepted from the quantum key last time; obtaining the number of times the key derivation method has been used continuously, and determining the number of times to be calculated based on the number of times it has been used; performing key derivation processing on the historical conversion quantum key for the number of times to be calculated based on the target key derivation algorithm to obtain the conversion quantum key.
[0192] In some embodiments, when the key generation method is a key derivation method, the first key generation module 1002 uses the key generation method to process the quantum key in the first communication device to obtain a converted quantum key, including: obtaining the historical key used when the communication message was last sent to the second communication device; wherein the historical key is intercepted from the quantum key to generate, or is intercepted from the quantum key and then generated by performing at least one key derivation; performing key derivation processing on the historical key based on the target key derivation algorithm to obtain the converted quantum key.
[0193] In some embodiments, the communication message also includes a key derivation algorithm field, and the field value of the key derivation algorithm field is a preset value corresponding to the target key derivation algorithm.
[0194] In some embodiments, before determining the key generation method for transmitting communication information, the determination module 1001 is also used to determine a candidate cryptographic algorithm for communicating with a second communication device; the message sending module 1004 is also used to generate an algorithm negotiation communication message based on the candidate cryptographic algorithm, and send the algorithm negotiation communication message to the second communication device; wherein the algorithm negotiation communication message includes a cryptographic algorithm field, and the field value of the cryptographic algorithm field is a preset value corresponding to the candidate cryptographic algorithm; the determination module 1001 is also used to determine the candidate cryptographic algorithm as the target cryptographic algorithm for encrypting communication information in response to the algorithm confirmation message returned by the second communication device.
[0195] In some embodiments, the communication device based on quantum key also includes a quantum key application module 1005, which is used to send a quantum key application request to a first quantum key distribution device before determining a key generation method for transmitting communication information; the first quantum key distribution device provides a quantum key distribution service for the first communication device; and receives the quantum key issued by the first quantum key distribution device; wherein the quantum key is generated by the first quantum key distribution device and the second quantum key distribution device performing quantum key distribution, and the second quantum key distribution device provides a quantum key distribution service for the second communication device.
[0196] Fig.10 The other contents of the embodiment can refer to the other embodiments mentioned above. The specific manner in which each module in the quantum key-based communication device performs operations has been described in detail in the embodiment of the method and will not be elaborated here.
[0197] Fig.11 A block diagram of a communication device 1100 based on a quantum key according to another embodiment of the present disclosure is shown, and the communication device is applied to a second communication device; Fig.11 As shown, it includes: a message receiving module 1101, used to receive a communication message sent by a first communication device, wherein the communication message indicates a key generation method; wherein the key generation method is a key interception method or a key derivation method; a second key generation module 1102, which uses the key generation method to process the quantum key in the second communication device to obtain a conversion quantum key; a decryption module 1103, which uses the conversion quantum key to decrypt the communication information ciphertext in the communication message to obtain the current communication information transmitted by the first communication device.
[0198] Through the quantum key-based communication device provided by the present disclosure, a specific key generation method can be indicated in the communication message sent by the first communication device and received by the second communication device. The specific key generation method is one of the key interception method and the key derivation method, so that the second communication device uses the same key generation method as the first communication device to process the quantum key and obtain the conversion quantum key used to decrypt the communication information ciphertext. Among them, the key interception method in the key generation method consumes the quantum key, and the key derivation method does not consume the quantum key. Therefore, this communication method can improve the reuse rate of the quantum key and extend the use time of the quantum key, thereby reducing the frequency of the communication device applying for the quantum key and alleviating the quantum key distribution pressure of the quantum key distribution device. In addition, in this scheme, each time the data information is transmitted, the key generation method used for the current data information transmission can be determined once, and then the key generation method can be used to process the pre-obtained quantum key with high security and randomness to obtain a conversion quantum key used only for the current communication information, so that the encryption and decryption keys (i.e., conversion quantum keys) used for each communication message can be different, so that the key update frequency can be guaranteed on the basis of improving the reuse rate of the quantum key and improving the security of each message.
[0199] In some embodiments, the quantum key-based communication device 1100 also includes a key determination module 1104; the message receiving module 1101 is also used to receive an algorithm negotiation communication message sent by the first communication device before receiving the communication message sent by the first communication device, and the algorithm negotiation communication message includes a cryptographic algorithm field; the key determination module 1104 is used to determine the candidate cryptographic algorithm indicated by the first communication device according to the field value of the cryptographic algorithm field; and when the second communication device supports the candidate cryptographic algorithm, determine the candidate cryptographic algorithm as the target cryptographic algorithm for decrypting the current communication information sent by the first communication device, and return an algorithm confirmation message to the first communication device.
[0200] In some embodiments, the quantum key-based communication device 1100 also includes a quantum key receiving module 1105; before the message receiving module 1101 receives the communication message sent by the first communication device, the quantum key receiving module 1105 is used to receive the quantum key issued by the second quantum key distribution device; wherein the quantum key is generated by the first quantum key distribution device and the second quantum key distribution device performing quantum key distribution after the first communication device sends a quantum key application request to the first quantum key distribution device, and the first quantum key distribution device provides quantum key distribution services for the first communication device.
[0201] Fig.11The other contents of the embodiment can refer to the other embodiments mentioned above. The specific manner in which each module in the quantum key-based communication device performs operations has been described in detail in the embodiment of the method and will not be elaborated here.
[0202] It will be appreciated by those skilled in the art that various aspects of the present invention may be implemented as a system, method or program product. Therefore, various aspects of the present invention may be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to herein as a "circuit", "module" or "system".
[0203] Fig.12 The block diagram of a quantum key communication computer device in the embodiment of the present disclosure is shown. It should be noted that the electronic device shown in the figure is only an example and should not bring any limitation to the function and scope of use of the embodiment of the present invention.
[0204] Refer to the following Fig.12 The electronic device 1200 according to this embodiment of the present invention is described. Fig.12 The electronic device 1200 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0205] 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).
[0206] The storage unit stores program codes, which can be executed by the processing unit 1210, so that the processing unit 1210 performs the steps according to various exemplary embodiments of the present invention described in the above “Exemplary Method” section of this specification. For example, the processing unit 1210 can perform the following steps: Figure 2 or Figure 8 The method shown in .
[0207] 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 .
[0208] 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.
[0209] 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.
[0210] The electronic device 1200 may also communicate with one or more external devices 1300 (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 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 through 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) through a network adapter 1260. As shown, the network adapter 1260 communicates with other modules of the electronic device 1200 through 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.
[0211] In an exemplary embodiment of the present disclosure, a computer-readable storage medium is also provided, on which a program product capable of implementing the above method of the present specification is stored. In some possible implementations, various aspects of the present invention can also be implemented in the form of a program product, which includes a program code, and when the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps according to various exemplary embodiments of the present invention described in the above "Exemplary Method" section of the present specification.
[0212] The program product for implementing the above method according to the embodiment of the present invention may adopt a portable compact disk read-only memory (CD-ROM) and include program code, and may be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited thereto, and in this document, a readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, apparatus, or device.
[0213] The program product may be any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination thereof. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.
[0214] Computer readable signal media may include data signals propagated in baseband or as part of a carrier wave, in which 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. Readable signal media 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.
[0215] The program code embodied on the readable 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.
[0216] Program code for performing the operations of the present invention 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" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate 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., via the Internet using an Internet service provider).
[0217] 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.
[0218] 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.
[0219] 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 combining software 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 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 of the present disclosure.
[0220] According to one aspect of the present disclosure, a computer program product or a computer program is provided, the computer program product or the computer program including computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the methods provided in various optional implementations of the above-mentioned embodiments.
[0221] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any modification, use or adaptation of the present disclosure, which follows the general principles of the present disclosure and includes common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification 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, It is characterized in that The method is applied to a first communication device; the method comprises: Determine a key generation method for transmitting current communication information; wherein the key generation method is a key interception method or a key derivation method; Processing the quantum key in the first communication device using the key generation method to obtain a conversion quantum key; Encrypting the current communication information using the converted quantum key to obtain a communication information ciphertext; Generate a communication message according to the communication information ciphertext and the information of the key generation method, and send the communication message to the second communication device, so that the second communication device decrypts the communication information ciphertext in the communication message based on the key generation method indicated in the communication message and the quantum key stored in the second communication device; The key generation method is a key interception method, and the key generation method is used to process the quantum key in the first communication device to obtain the conversion quantum key, including: Determine the starting number of key interception; determine the key length according to the target cryptographic algorithm used to encrypt the communication information; in the quantum key, starting from the bit corresponding to the starting number of key interception, continuously intercept bits whose length meets the key length, and obtain the conversion quantum key; Alternatively, the key generation method is a key derivation method, and the key generation method is used to process the quantum key in the first communication device to obtain the converted quantum key, including: Determine a target key derivation algorithm; obtain a historical conversion quantum key intercepted from the quantum key last time; obtain the number of times the key derivation method has been used continuously, and determine the number of times to be calculated according to the number of times used; perform key derivation processing on the historical conversion quantum key for the number of times to be calculated based on the target key derivation algorithm to obtain a conversion quantum key.
2. The method according to claim 1, It is characterized in that The communication message includes a key generation method field; Among them, when the key generation method is a key interception method, the field value of the key generation method field is a first value; when the key generation method is a key derivation method, the field value of the key generation method field is a second value.
3. The method according to claim 1, It is characterized in that Determine the starting number of digits for key truncation, including: If it is the first time to intercept the quantum key, the starting number of bits for intercepting the key is determined to be the specified number of bits; If it is not the first time to intercept the quantum key, the historical conversion quantum key intercepted from the quantum key last time is obtained, and the key interception starting bit number is determined according to the historical conversion quantum key.
4. The method according to claim 3, It is characterized in that Determining the key interception starting bit number according to the historical conversion quantum key includes: Determine the starting number of bits for intercepting the historical key of the historical conversion quantum key; Determining a sub-bit segment from the historical conversion quantum key, and determining a number of post-shifts based on the sub-bit segment; The key interception starting number of bits is determined according to the historical key interception starting number of bits and the back-shifted number of bits.
5. The method according to claim 1, It is characterized in that The method further comprises: After obtaining the converted quantum key, determining the number of remaining bits of the quantum key that have not been intercepted; If the remaining number of bits is less than the preset length, a new quantum key is applied for.
6. The method according to claim 1 or 2, It is characterized in that In the case where the key generation method is a key derivation method, the communication message further includes a key derivation algorithm field, and the field value of the key derivation algorithm field is a preset value corresponding to the target key derivation algorithm.
7. The method according to claim 6, It is characterized in that In the case where the key generation method is a key derivation method, using the key generation method to process the quantum key in the first communication device to obtain a conversion quantum key includes: Acquire a historical key used when sending a communication message to the second communication device last time; wherein the historical key is obtained by intercepting the quantum key, or is obtained by intercepting the quantum key and performing at least one key derivation; The historical key is subjected to key derivation processing based on the target key derivation algorithm to obtain a converted quantum key.
8. The method according to claim 1, It is characterized in that Before determining the key generation method for transmitting the communication information, the method further includes: determining a candidate cryptographic algorithm for communicating with the second communications device; Generate an algorithm negotiation communication message according to the candidate cryptographic algorithm, and send the algorithm negotiation communication message to the second communication device; wherein the algorithm negotiation communication message includes a cryptographic algorithm field, and the field value of the cryptographic algorithm field is a preset value corresponding to the candidate cryptographic algorithm; In response to the algorithm confirmation message returned by the second communication device, the candidate cryptographic algorithm is determined as the target cryptographic algorithm for encrypting the communication information.
9. The method according to claim 1, It is characterized in that Before determining the key generation method for transmitting the communication information, the method further includes: Sending a quantum key application request to a first quantum key distribution device; wherein the first quantum key distribution device provides a quantum key distribution service for the first communication device; Receive a quantum key issued by the first quantum key distribution device; wherein the quantum key is generated by quantum key distribution between the first quantum key distribution device and a second quantum key distribution device, and the second quantum key distribution device provides a quantum key distribution service for the second communication device.
10. A communication method based on quantum key, It is characterized in that The method is applied to a second communication device; the method comprises: Receiving a communication message sent by a first communication device, wherein the communication message indicates a key generation method; wherein the key generation method is a key interception method or a key derivation method; Processing the quantum key in the second communication device using the key generation method to obtain a conversion quantum key; Decrypting the communication information ciphertext in the communication message using the converted quantum key to obtain the current communication information transmitted by the first communication device; The communication information ciphertext is obtained by encrypting the current communication information by the first communication device using the conversion quantum key; the conversion quantum key used by the first communication device is obtained by the first communication device processing the quantum key in the first communication device using the key generation method; The key generation method is a key interception method, and the first communication device uses the key generation method to process the quantum key in the first communication device to obtain the converted quantum key, including: Determine the starting number of key interception; determine the key length according to the target cryptographic algorithm used to encrypt the communication information; in the quantum key, starting from the bit corresponding to the starting number of key interception, continuously intercept bits whose length meets the key length, and obtain the conversion quantum key; Alternatively, the key generation method is a key derivation method, and the first communication device uses the key generation method to process the quantum key in the first communication device to obtain the converted quantum key, including: Determine a target key derivation algorithm; obtain a historical conversion quantum key intercepted from the quantum key last time; obtain the number of times the key derivation method has been used continuously, and determine the number of times to be calculated according to the number of times used; perform key derivation processing on the historical conversion quantum key for the number of times to be calculated based on the target key derivation algorithm to obtain a conversion quantum key.
11. The method according to claim 10, It is characterized in that Before receiving the communication message sent by the first communication device, the method further includes: Receiving an algorithm negotiation communication message sent by the first communication device, wherein the algorithm negotiation communication message includes a cryptographic algorithm field; Determining a candidate cryptographic algorithm indicated by the first communication device according to a field value of the cryptographic algorithm field; In the case that the second communication device supports the candidate cryptographic algorithm, the candidate cryptographic algorithm is determined as the target cryptographic algorithm for decrypting the current communication information sent by the first communication device, and an algorithm confirmation message is returned to the first communication device.
12. The method according to claim 10, It is characterized in that Before receiving the communication message sent by the first communication device, the method further includes: Receiving a quantum key issued by a second quantum key distribution device; The quantum key is generated by the first quantum key distribution device and the second quantum key distribution device performing quantum key distribution after the first communication device sends a quantum key application request to the first quantum key distribution device, and the first quantum key distribution device provides quantum key distribution services for the first communication device.
13. A communication device based on quantum key, It is characterized in that The communication device is applied to a first communication device; The communication device comprises: A determination module, used to determine a key generation method for transmitting current communication information; wherein the key generation method is a key interception method or a key derivation method; A first key generation module, configured to process the quantum key in the first communication device using the key generation method to obtain a conversion quantum key; An encryption module, used to encrypt the current communication information using the converted quantum key to obtain a communication information ciphertext; a message sending module, configured to generate a communication message according to the communication information ciphertext and the information of the key generation method, and send the communication message to a second communication device, so that the second communication device decrypts the communication information ciphertext in the communication message based on the key generation method indicated in the communication message and the quantum key stored in the second communication device; The key generation method is a key interception method, and the first key generation module uses the key generation method to process the quantum key in the first communication device to obtain the conversion quantum key, including: Determine the starting number of key interception; determine the key length according to the target cryptographic algorithm used to encrypt the communication information; in the quantum key, starting from the bit corresponding to the starting number of key interception, continuously intercept bits whose length meets the key length, and obtain the conversion quantum key; Alternatively, the key generation method is a key derivation method, and the first key generation module uses the key generation method to process the quantum key in the first communication device to obtain the converted quantum key, including: Determine a target key derivation algorithm; obtain a historical conversion quantum key intercepted from the quantum key last time; obtain the number of times the key derivation method has been used continuously, and determine the number of times to be calculated according to the number of times used; perform key derivation processing on the historical conversion quantum key for the number of times to be calculated based on the target key derivation algorithm to obtain a conversion quantum key.
14. A communication device based on quantum key, It is characterized in that The communication device is applied to a second communication device; the communication device comprises: A message receiving module, used to receive a communication message sent by a first communication device, wherein the communication message indicates a key generation method; wherein the key generation method is a key interception method or a key derivation method; A second key generation module, using the key generation method to process the quantum key in the second communication device to obtain a conversion quantum key; A decryption module, used to decrypt the communication information ciphertext in the communication message using the converted quantum key to obtain the current communication information transmitted by the first communication device; The communication information ciphertext is obtained by encrypting the current communication information by the first communication device using the conversion quantum key; the conversion quantum key used by the first communication device is obtained by the first communication device processing the quantum key in the first communication device using the key generation method; The key generation method is a key interception method, and the first communication device uses the key generation method to process the quantum key in the first communication device to obtain the converted quantum key, including: Determine the starting number of key interception; determine the key length according to the target cryptographic algorithm used to encrypt the communication information; in the quantum key, starting from the bit corresponding to the starting number of key interception, continuously intercept bits whose length meets the key length, and obtain the conversion quantum key; Alternatively, the key generation method is a key derivation method, and the first communication device uses the key generation method to process the quantum key in the first communication device to obtain the converted quantum key, including: Determine a target key derivation algorithm; obtain a historical conversion quantum key intercepted from the quantum key last time; obtain the number of times the key derivation method has been used continuously, and determine the number of times to be calculated according to the number of times used; perform key derivation processing on the historical conversion quantum key for the number of times to be calculated based on the target key derivation algorithm to obtain a conversion quantum key.
15. A computer-readable storage medium having a computer program stored thereon, wherein when the program is executed by a processor, the method according to any one of claims 1 to 12 is implemented.
16. An electronic device, It is characterized in that include: one or more processors; A storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, enables the one or more processors to implement the method according to any one of claims 1 to 12.
