A method and device for obtaining an effective quantum key

By calculating and comparing the digest values ​​of the quantum key, and dividing and combining them when necessary, the problem of invalidity caused by interference during the quantum key transmission process is solved, ensuring the effectiveness of the quantum key and the security of data transmission. .

CN115189865BActive Publication Date: 2024-10-08CHINA TELECOM CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210668315.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-14
Publication Date
2024-10-08
Estimated Expiration
2042-06-14

AI Technical Summary

Technical Problem

Quantum keys are susceptible to interference during the transmission process, resulting in different keys obtained by both parties in the quantum key interaction, and the security of data transmission cannot be guaranteed.

Method used

By calculating the digest value of the quantum key and comparing whether the digest values ​​at both ends are the same, if they are different, the quantum key is divided and combined until the preset termination conditions are met to ensure that the same effective quantum key is obtained.

Benefits of technology

It effectively solves the problem of invalidity caused by interference during the transmission process of quantum keys, ensures that both parties of quantum key interaction obtain the same effective key, and improves the security of data transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115189865B_ABST
    Figure CN115189865B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention provides a method and device for obtaining an effective quantum key, which relates to the field of network security technology and is applied to a first interactive device. The method includes: obtaining a first quantum key and using the first quantum key as the first decoding data; calculating the first summary value of the first decoding data; determining whether the first summary value is the same as the second summary value; if they are the same, determining the first decoding data as the target data; if they are different, dividing the first decoding data, and using each grouped data obtained by the division as the new first decoding data. For each first decoding data, if the preset termination condition is met, returning to the step of calculating the first summary value of the first decoding data; if the preset termination condition is met, combining the determined target data to obtain an effective quantum key. Applying the scheme provided by the embodiment of the present invention, both parties in quantum key interaction can obtain the same effective quantum key.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of network security technology, and in particular to a method and device for obtaining an effective quantum key. Background Art

[0002] In order to ensure the security of the data exchange process between the two parties, the two parties can first exchange keys before data exchange. The sender can use the key to encrypt the data before transmitting the encrypted data. The receiver can use the same key to decrypt the encrypted data after receiving the encrypted data. Since only the two parties to the data exchange can obtain the above key, other devices cannot decrypt the encrypted data even if they obtain the transmitted encrypted data. Therefore, the use of keys can ensure the security of data transmission.

[0003] Quantum key is a highly secure key. The two parties in quantum key interaction can exchange quantum keys through quantum channels, and then encrypt data transmission based on quantum keys. However, due to the characteristics of light quanta, quantum keys are easily interfered during transmission, resulting in different quantum keys obtained by the two parties in quantum key interaction. Such quantum keys are invalid quantum keys. In order to solve the above problems, a method for obtaining valid quantum keys is urgently needed. Summary of the invention

[0004] The purpose of the embodiment of the present invention is to provide a method and device for obtaining an effective quantum key to ensure that both parties in quantum key interaction obtain the same effective quantum key. The specific technical solution is as follows:

[0005] In a first aspect, an embodiment of the present invention provides a method for obtaining an effective quantum key, wherein any device performing quantum key interaction is used as a first interaction device, and another device is used as a second interaction device, and is applied to the first interaction device, and the method includes:

[0006] Obtaining a first quantum key, and using the first quantum key as first decoding data;

[0007] Calculating a first digest value of the first decoded data;

[0008] Determining whether the first digest value is the same as the second digest value, wherein the second digest value is: a digest value obtained by the second interactive device calculating the second decoded data, a position of the second decoded data in the second quantum key is the same as a position of the first decoded data in the first quantum key, a method in which the first interactive device calculates the first digest value is the same as a method in which the second interactive device calculates the second digest value, and the second quantum key is: a quantum key obtained by the second interactive device;

[0009] If they are the same, the first decoded data is determined as the target data;

[0010] If they are different, the first decoded data is divided, and each grouped data obtained by the division is used as a new first decoded data. If the preset termination condition is not met, for each first decoded data, the step of calculating the first summary value of the first decoded data is returned to be executed;

[0011] If the preset termination condition is met, the determined target data is combined to obtain a valid quantum key.

[0012] In one embodiment of the present invention, the determining whether the first digest value is the same as the second digest value includes:

[0013] receiving a second digest value sent by a second interactive device;

[0014] The first digest value is compared with the second digest value to determine whether the first digest value is the same as the second digest value.

[0015] In one embodiment of the present invention, the determining whether the first digest value is the same as the second digest value includes:

[0016] Sending the first digest value to the second interactive device, so that the second interactive device compares the first digest value with the second digest value, and feeds back the comparison result to the first interactive device;

[0017] Based on the received comparison result, it is determined whether the first digest value is the same as the second digest value.

[0018] In one embodiment of the present invention, the step of dividing the first decoded data and using each group of data obtained by the division as new first decoded data includes:

[0019] The first decoded data is evenly divided by using a binary division method, and two grouped data obtained by the division are respectively used as new first decoded data.

[0020] In one embodiment of the present invention, the preset termination condition is: the length of each grouped data obtained by division is smaller than the quantum key length required for encrypting the data.

[0021] In a second aspect, an embodiment of the present invention provides an effective quantum key acquisition device, wherein any device performing quantum key interaction is used as a first interaction device, and another device is used as a second interaction device, and is applied to the first interaction device, and the device includes:

[0022] A decoding data obtaining module, used to obtain a first quantum key and use the first quantum key as first decoding data;

[0023] A first digest value calculation module, used to calculate a first digest value of the first decoded data;

[0024] a digest value comparison module, configured to determine whether the first digest value is the same as the second digest value, wherein the second digest value is: a digest value obtained by the second interactive device calculating the second decoded data, the position of the second decoded data in the second quantum key is the same as the position of the first decoded data in the first quantum key, the first interactive device calculates the first digest value in the same manner as the second interactive device calculates the second digest value, and the second quantum key is: a quantum key obtained by the second interactive device;

[0025] a target data determination module, configured to determine the first decoded data as target data if the digest value comparison module determines that the first digest value is the same as the second digest value;

[0026] a decoded data division module, configured to divide the first decoded data, if the digest value comparison module determines that the first digest value is different from the second digest value, and use each grouped data obtained by the division as a new first decoded data, and trigger the execution of the first digest value calculation module for each first decoded data if a preset termination condition is not met;

[0027] The effective key acquisition module is used to combine the determined target data to obtain the effective quantum key if the preset termination condition is met.

[0028] In one embodiment of the present invention, the summary value comparison module is specifically used to:

[0029] receiving a second digest value sent by a second interactive device;

[0030] The first digest value is compared with the second digest value to determine whether the first digest value is the same as the second digest value.

[0031] In one embodiment of the present invention, the summary value comparison module is specifically used to:

[0032] Sending the first digest value to the second interactive device, so that the second interactive device compares the first digest value with the second digest value, and feeds back the comparison result to the first interactive device;

[0033] Based on the received comparison result, it is determined whether the first digest value is the same as the second digest value.

[0034] In one embodiment of the present invention, the decoded data division module is specifically used to:

[0035] When the digest value comparison module determines that the first digest value is different from the second digest value, the first decoded data is evenly divided using a binary method, and two grouped data obtained by the division are respectively used as new first decoded data.

[0036] In one embodiment of the present invention, the preset termination condition is: the length of each grouped data obtained by division is smaller than the quantum key length required for encrypting the data.

[0037] In a third aspect, an embodiment of the present invention provides an electronic device, including a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;

[0038] Memory, used to store computer programs;

[0039] The processor is used to implement any method step described in the first aspect when executing a program stored in the memory.

[0040] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, any method step described in the first aspect is implemented.

[0041] In a fifth aspect, an embodiment of the present invention further provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute any of the method steps described in the first aspect.

[0042] Beneficial effects of the embodiments of the present invention:

[0043] The embodiment of the present invention provides an effective quantum key acquisition method, which is applied to a first interactive device that performs quantum key interaction. The first interactive device calculates a first digest value of first decoded data, and compares the first digest value with a second digest value calculated by a second interactive device on the second decoded data. Since the digest calculation method used by the first interactive device to calculate the first digest value is the same as the digest calculation method used by the second interactive device to calculate the second digest value, if the calculated first digest value is the same as the second digest value, it means that the first decoded data is the same as the second decoded data, and the first decoded data can be used as the target data. Otherwise, it means that the first decoded data contains a different part from the second decoded data, and the first decoded data can be divided to obtain new first decoded data, and continue to determine whether the new first decoded data is the target data.

[0044] It can be seen that through the embodiments of the present invention, each device performing quantum key interaction can obtain the same target data as a first interaction device, and then the same effective quantum key can be obtained by combining data based on the same target data. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention, and a person skilled in the art can also obtain other drawings based on these drawings.

[0046] Figure 1 A schematic diagram of a flow chart of a first method for obtaining an effective quantum key provided by an embodiment of the present invention;

[0047] Figure 2 A target data determination flow chart provided by an embodiment of the present invention;

[0048] Figure 3 A schematic diagram of a flow chart of a second method for obtaining an effective quantum key provided by an embodiment of the present invention;

[0049] Figure 4 A schematic diagram of a flow chart of a third method for obtaining an effective quantum key provided by an embodiment of the present invention;

[0050] Figure 5 A schematic diagram of a fourth method for obtaining a valid quantum key provided by an embodiment of the present invention;

[0051] Figure 6 A schematic diagram of a fifth method for obtaining a valid quantum key provided in an embodiment of the present invention;

[0052] Figure 7 A schematic diagram of the structure of an effective quantum key acquisition device provided by an embodiment of the present invention;

[0053] Figure 8 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0054] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field based on this application belong to the scope of protection of the present invention.

[0055] The embodiment of the present invention provides a method for obtaining an effective quantum key. Any device performing quantum key interaction is used as a first interaction device, and another device is used as a second interaction device. The method is applied to the first interaction device. The method includes:

[0056] Obtaining a first quantum key, and using the first quantum key as first decoding data;

[0057] Calculating a first summary value of the first decoded data;

[0058] Determine whether the first digest value is the same as the second digest value, wherein the second digest value is: a digest value obtained by the second interactive device calculating the second decoded data, the position of the second decoded data in the second quantum key is the same as the position of the first decoded data in the first quantum key, the first interactive device calculates the first digest value in the same way as the second interactive device calculates the second digest value, and the second quantum key is: a quantum key obtained by the second interactive device;

[0059] If they are the same, the first decoded data is determined as the target data;

[0060] If they are different, the first decoded data is divided, and each grouped data obtained by the division is used as a new first decoded data. If the preset termination condition is not met, for each first decoded data, the step of calculating the first summary value of the first decoded data is returned to be executed;

[0061] If the preset termination condition is met, the determined target data is combined to obtain a valid quantum key.

[0062] As can be seen from the above, the first interactive device calculates the first digest value of the first decoded data, and compares the first digest value with the second digest value calculated by the second interactive device for the second decoded data. Since the digest calculation method used by the first interactive device to calculate the first digest value is the same as the digest calculation method used by the second interactive device to calculate the second digest value, if the calculated first digest value is the same as the second digest value, it means that the first decoded data is the same as the second decoded data, and the first decoded data can be used as the target data. Otherwise, it means that the first decoded data contains a different part from the second decoded data, and the first decoded data can be divided to obtain new first decoded data, and continue to determine whether the new first decoded data is the target data.

[0063] It can be seen that through the embodiments of the present invention, each device performing quantum key interaction can obtain the same target data as a first interaction device, and then the same effective quantum key can be obtained by combining data based on the same target data.

[0064] First, the process of quantum key interaction is described. In an embodiment of the present invention, the two parties of quantum key interaction can implement the quantum key interaction process based on the BB84 protocol or other protocols in the prior art.

[0065] When the two parties of quantum key interaction perform quantum key interaction based on the BB84 protocol, they can be divided into a key sender and a key receiver. The key sender first generates a random binary number containing a preset number of bits, sets a basis vector for each bit of the random binary number, and then performs optical quantum modulation on the random binary number to obtain optical quanta.

[0066] In addition, the key receiver is also configured with a preset number of basis vectors, each basis vector corresponding to a binary bit.

[0067] The key sender sends a light quantum to the key receiver through a quantum channel, and the key receiver parses the light quantum to obtain a random binary number.

[0068] The key sender and the key receiver respectively send the basis vectors set by themselves to each other, and compare the basis vectors set by themselves and the received basis vectors bit by bit to determine the binary bits with the same corresponding basis vectors.

[0069] The key sender and the key receiver respectively combine the binary bits with the same basis vector determined by themselves according to their order in the random binary bits to obtain the quantum key.

[0070] In the above process, both the key sender and the key receiver obtain the quantum key based on the random binary number generated by the key sender. The above random binary number is sent by the key sender to the key receiver in the form of light quanta. Affected by the quantum mechanical properties of light quanta, light quanta are easily disturbed and changed during the transmission process, which makes the light quanta received by the key receiver different from the light quanta sent by the key sender, and then makes the random binary number obtained by the key receiver different from the random binary number generated by the key sender, which ultimately leads to the quantum key obtained by the key receiver based on the random binary number being different from the quantum key obtained by the key sender based on the random binary number, resulting in the problem that both parties in the key interaction obtain invalid quantum keys.

[0071] In addition, the basis vectors transmitted between the two parties in the key interaction are the basis for extracting quantum keys from random binary numbers. It is necessary to ensure that the basis vectors do not change during the transmission process in order to achieve accurate quantum key extraction. Therefore, the two parties in the key interaction can transmit the basis vectors through other channels with higher stability other than quantum channels. Other channels other than quantum channels can be called classical channels.

[0072] It can be seen from the above that in the prior art, the quantum keys obtained by the two parties in quantum key interaction may be different invalid quantum keys. In order to solve the above problem, an embodiment of the present invention provides a method and device for obtaining a valid quantum key.

[0073] See also Figure 1, which is a flow chart of a first method for obtaining a valid quantum key provided in an embodiment of the present invention, wherein any device performing quantum key interaction serves as a first interaction device, and another device serves as a second interaction device, and is applied to the first interaction device to synchronously determine a valid quantum key through the following steps S101-S106.

[0074] S101: Obtain a first quantum key, and use the first quantum key as first decoding data.

[0075] Specifically, if the first interactive device is a key sender, the first quantum key is a quantum key generated by the first interactive device based on a random binary number generated by itself. If the first interactive device is a key receiver, the first quantum key is a quantum key generated by the first interactive device based on a random binary number received by itself. The first quantum key consists of a plurality of binary bits.

[0076] S102: Calculate a first digest value of the first decoded data.

[0077] In one embodiment of the present invention, the first interactive device may adopt a preset digest calculation method to calculate the above-mentioned first digest value. The above-mentioned preset digest calculation method may be a digest calculation method in the prior art. For example, the first digest value of the first decoded data may be calculated based on a hash function. For example, the above-mentioned hash function may be SHA224 (Secure Hash Algorithm 224), SHA256 (Secure Hash Algorithm 256), SHA512 (Secure Hash Algorithm 512), etc.

[0078] S103: Determine whether the first digest value is the same as the second digest value.

[0079] The second summary value is: a summary value obtained by calculating the second decoded data by the second interactive device.

[0080] The position of the second decoded data in the second quantum key is the same as the position of the first decoded data in the first quantum key. The first interactive device calculates the first digest value in the same way as the second interactive device calculates the second digest value, and the second quantum key is: the quantum key obtained by the second interactive device.

[0081] Specifically, when the first decoded data is the first quantum key, the second decoded data is the second quantum key, that is, in the initial state of the embodiment of the present invention, the second interactive device also calculates the digest value of the second quantum key based on the digest calculation method to obtain the second digest value. Specifically, after obtaining the second quantum key, the second interactive device can also calculate the second digest value based on the calculation method shown in the aforementioned step S102.

[0082] When the key sender shown above is the first interactive device, the second interactive device is the key receiver shown above; when the key receiver shown above is the first interactive device, the second interactive device is the key sender shown above.

[0083] In addition, if the first digest value is the same as the second digest value, it means that the first quantum key corresponding to the first digest value is the same as the second quantum key corresponding to the second digest value, which means that the first quantum key obtained by the first interactive device and the second quantum key obtained by the second interactive device are both valid quantum keys, and step S104 is continued; otherwise, it means that the first quantum key and the second quantum key are different and contain different binary bits, and if the preset termination condition is not met, step S105 is continued.

[0084] Otherwise, if the preset termination condition is met, the process continues to execute step S106.

[0085] In addition, the description of the preset termination conditions can be found below and will not be described in detail here.

[0086] S104: Determine the first decoded data as target data.

[0087] Specifically, if the first digest value corresponding to the first decoded data is the same as the second digest value corresponding to the second decoded data, it can be determined that the first decoded data is the same as the second decoded data, and the first decoded data can be marked as target data that can be combined into a valid quantum key.

[0088] S105: Divide the first decoded data, and use each group of data obtained by the division as new first decoded data.

[0089] In addition, for each new first decoded data, the process returns to execute the above step S102 until a preset termination condition is met.

[0090] Specifically, the number of grouped data obtained after dividing the original first decoded data can be a preset number of grouped data, for example, 2, 3, 4, etc. The lengths of the grouped data obtained after the division can be the same or different, and the grouped data obtained after the division can contain the same binary bits or may not contain the same binary bits.

[0091] In one embodiment of the present invention, the above step S105 can be implemented by step A shown below, which will not be described in detail here.

[0092] In addition, after the original first decoded data is divided to obtain new first decoded data, the second decoded data corresponding to the first decoded data will also be updated accordingly, which is equivalent to obtaining new second decoded data by dividing the original second decoded data in the same data division method as the first interactive data. The positions of the bits contained in the new second decoded data in the second quantum key are still the same as the positions of the bits contained in the new first decoded data in the first quantum key.

[0093] Specifically, for each new first decoded data, return to execute steps S102-S103, calculate the first digest value of the new first decoded data and compare it with the second digest value of the new second decoded data, and continue to determine whether the first digest value is the same as the second digest value. If they are the same, execute step S104 and use the new first decoded data as the target data. Otherwise, it means that the new first decoded data is different from the new second decoded data. Execute step S105 for the new first decoded data, divide the new first decoded data into various grouped data, and use each grouped data as the new first decoded data to re-execute step S102, and so on, and gradually determine the target data contained in the first quantum key.

[0094] S106: Combining the determined target data to obtain a valid quantum key.

[0095] Specifically, each target array may be sequentially arranged and combined according to the order of each target data in the first quantum key to form a valid quantum key.

[0096] As can be seen from the above, an embodiment of the present invention provides an effective quantum key acquisition method, which is applied to a first interactive device that performs quantum key interaction. The first interactive device calculates a first digest value of the first decoded data, and compares the first digest value with a second digest value calculated by the second interactive device for the second decoded data. Since the digest calculation method used by the first interactive device to calculate the first digest value is the same as the digest calculation method used by the second interactive device to calculate the second digest value, if the calculated first digest value is the same as the second digest value, it means that the first decoded data is the same as the second decoded data, and the first decoded data can be used as the target data. Otherwise, it means that the first decoded data contains a different part from the second decoded data, and the first decoded data can be divided to obtain new first decoded data, and continue to determine whether the new first decoded data is the target data.

[0097] It can be seen that through the embodiments of the present invention, each device performing quantum key interaction can obtain the same target data as a first interaction device, and then the same effective quantum key can be obtained by combining data based on the same target data.

[0098] In one embodiment of the present invention, the above step S104 can be implemented by the following step A.

[0099] Step A: Use the binary division method to evenly divide the first decoded data, and use the two grouped data obtained by the division as new first decoded data.

[0100] Specifically, when the first decoded data contains an even number of binary bits, the binary bits contained in the two grouped data obtained after average division are the same; when the first decoded data contains an odd number of binary bits, one grouped data obtained after average division has one more binary bit than the other grouped data.

[0101] When the first decoded data is different from the second decoded data, there are different binary bits in the first decoded data and the second decoded data, but the specific positions of the different binary bits in the first decoded data cannot be determined. Therefore, the first decoded data can be evenly divided to obtain two average grouped data. In theory, the probability that the different binary bits are located in the two average grouped data is the same, that is, the probability that the two average grouped data are the target data is the same.

[0102] If the first decoded data is divided in a non-even division manner, the more binary bits are contained in the grouped data obtained by division, the greater the probability that the grouped data contains different binary bits, and the lower the probability that the grouped data is the target data. That is, in most cases, each process of determining the target data can only determine a small number of binary bits as the target data, resulting in a slower overall determination speed of the target data and a shorter length of the determined target data.

[0103] As can be seen from the above, in the embodiment of the present invention, the average division method is adopted to obtain two grouped data with similar binary bits, and then the grouped data are used as new first decoding data to determine the target data, which can generally improve the speed of determining the target data, and thus improve the speed of determining the effective quantum key.

[0104] In addition, the preset termination conditions in the embodiment of the present invention are described below:

[0105] The preset termination condition may be: the length of each grouped data obtained by division is smaller than the quantum key length required for encrypting the data.

[0106] Specifically, as the embodiment of the present invention is executed, the length of each grouped data obtained by division gradually decreases, that is, the length of the grouped data determined as the target data each time gradually decreases. After the length of the grouped data is less than the preset quantum key length, even if the grouped data continues to be judged as the target data, the length of the target data determined to be obtained is also shorter. At this time, even if the target data that continues to be obtained is put into the effective quantum key as part of the effective quantum key, it will not have a significant impact on the effective quantum key, and continuing to determine the target data will consume computing resources and data transmission resources of the first interactive device and the second interactive device. Therefore, after the length of the grouped data is less than the preset quantum key length, the confirmation of the target data can be stopped to improve the efficiency of obtaining the effective quantum key.

[0107] Moreover, in the prior art, the length of the quantum key obtained by both parties participating in the quantum key interaction in the initial state is relatively long, such as 1M, 2M, etc., and the number of different binary bits contained therein is not too large, while the length of the quantum key actually required to be used when encrypting data is often shorter. For example, the length of the quantum key actually required to be used can be 128bit, 256bit, etc.

[0108] It can be seen that the length of the first quantum key obtained by the first interactive device is often much longer than the length of the quantum key required for data encryption. Therefore, the total length of the determined effective quantum key does not need to be too long to achieve the subsequent data encryption process. In other words, the total length of the target data finally determined does not need to be too long. Therefore, it is actually not necessary to determine all the binary bits contained in the first quantum data that are the same as the second quantum data. It is also possible to generate sufficient effective quantum keys for subsequent data encryption. Therefore, in the embodiment of the present invention, the length of each grouped data obtained by division can be less than the length of the quantum key required for data encryption as the termination condition for cyclically determining the target data. At this time, although there are still binary bits that are the same as those in the second quantum key in each grouped data obtained by division, the total length of the target data obtained is often enough to meet the needs of subsequent data encryption. At this time, stopping the determination of the target data can save data calculation and transmission resources of the first interactive device and the second interactive device, and improve the efficiency of obtaining effective quantum keys.

[0109] In addition, the preset termination condition may also be that the number of times the first decoded data is divided reaches a preset number of times.

[0110] Or each of the divided grouped data contains only one binary bit. Specifically, each grouped data contains only one binary bit, which is equivalent to determining each binary bit contained in the first quantum key that is the same as the second quantum key through the embodiment of the present invention, and using the determined binary bits as target data, so that the length of the effective quantum key obtained based on the target data is the longest.

[0111] See also Figure 2 , is a target data determination flow chart provided in an embodiment of the present invention.

[0112] As can be seen from the figure, the embodiment of the present invention starts with the processing of the first quantum key. First, the first quantum key is used as the first decoding data to be compared with the second decoding data. The cross symbol on the first quantum data in the figure indicates that the first quantum data is different from the second quantum data, and the first quantum data is not the target data. Therefore, the first quantum data is divided to obtain group data 1 and group data 2.

[0113] The packet data 1 and the packet data 2 are respectively used as new first decoded data to be compared with the new second decoded data. The cross symbols on the packet data 1 and the packet data 2 in the figure indicate that the packet data 1 and the packet data 2 are not target data either.

[0114] The packet data 1 is divided to obtain the packet data 1-1 and the packet data 1-2, and the packet data 2 is divided to obtain the packet data 2-1 and the packet data 2-2. The packet data 1-1, the packet data 1-2, the packet data 2-1, and the packet data 2-2 are respectively used as the new first decoding data. In the figure, the cross symbol on the packet data 1-1, the packet data 1-2, and the packet data 2-2 indicates that the packet data 1-1, the packet data 1-2, and the packet data 2-2 are not the target data either, and the check mark symbol on the packet data 2-1 indicates that the packet data 2-1 is the target data.

[0115] Continue to divide the group data 1-1, group data 1-2 and group data 2-2, and do not divide the group data 2-1 any more. Group data 1-1 can be divided into group data 1-1-1 and group data 1-1-2, group data 1-2 can be divided into group data 1-2-1 and group data 1-2-2, and group data 2-2 can be divided into group data 2-2-1 and group data 2-2-2. In the figure, the check marks on group data 1-1-1, group data 1-2-2 and group data 2-2-2 indicate that group data 1-1-1, group data 1-2-2 and group data 2-2-2 are target data, and the cross marks on group data 1-1-2, group data 1-2-1 and group data 2-2-1 indicate that group data 1-1-2, group data 1-2-1 and group data 2-2-1 are not target data.

[0116] By analogy, the iterative division of group data 1-1-2, group data 1-2-1 and group data 2-2-1 is continued, and finally group data 1-...-1, group data 1-...-2, group data 2-...-1, group data 2-...-2 are obtained, which meet the preset termination condition. The check mark on group data 1-...-1 indicates that group data 1-...-1 is the target data, and the cross mark on group data 1-...-2, group data 2-...-1, and group data 2-...-2 indicates that group data 1-...-2, group data 2-...-1, and group data 2-...-2 are not the target data.

[0117] The target data obtained by the embodiment of the present invention are packet data 2-1, packet data 1-1-1, packet data 1-2-2, packet data 2-2-2 and packet data 1-...-1. The target data can be combined into valid quantum data according to the order of the target data in the first quantum key. Specifically, in this embodiment, the order of packet data 1-1-1, packet data 1-...-1, packet data 1-2-2, packet data 2-1, and packet data 2-2-2 is combined into a valid quantum data.

[0118] See also Figure 3 , is a flow chart of a second method for obtaining an effective quantum key provided by an embodiment of the present invention, which is similar to the above Figure 1 Compared with the embodiment shown, the above step S103 can be implemented by the following steps S103A-S103B.

[0119] S103A: Receive a second digest value sent by a second interactive device.

[0120] Specifically, since the second digest value is used as a basis for determining whether the first decoded data and the second decoded data are the same, in order to ensure the accuracy of the determination result, it is necessary to avoid changes in the second digest value during transmission. Therefore, the second interactive device can send the second digest value to the first interactive device through a relatively stable classical channel.

[0121] S103B: Compare the first digest value with the second digest value to determine whether the first digest value is the same as the second digest value.

[0122] Specifically, the first digest value generated by itself may be compared with the received second digest value to determine whether the first digest value is the same as the second digest value.

[0123] Furthermore, after determining the comparison result, the first interaction device may send the comparison result to the second interaction device, so that the second interaction device can also determine whether the first digest value is the same as the second digest value.

[0124] As can be seen above, in the embodiment of the present invention, after calculating the second digest value, the second interactive device can send the first digest value to the first interactive device, and the first interactive device can compare the first digest value with the second digest value to determine whether they are the same.

[0125] See also Figure 4 , is a flow chart of a third method for obtaining an effective quantum key provided by an embodiment of the present invention, which is similar to the aforementioned Figure 1 In comparison, the above step S103 can be implemented by the following steps S103C-S103D.

[0126] S103C: Send the first digest value to the second interactive device, so that the second interactive device compares the first digest value with the second digest value, and feeds back the comparison result to the first interactive device.

[0127] Specifically, since the first digest value is used as a basis for determining whether the first decoded data and the second decoded data are the same, in order to ensure the accuracy of the determination result, it is necessary to avoid changes in the first digest value during transmission. Therefore, the first interactive device can send the first digest value to the second interactive device through a relatively stable classical channel.

[0128] After receiving the first digest value, the second interaction data may compare the received first digest value with the second digest value generated by itself, thereby determining a comparison result.

[0129] S103D: Determine whether the first digest value is the same as the second digest value based on the received comparison result.

[0130] As can be seen from the above, in the embodiment of the present invention, after calculating the first digest value, the first interaction device can send the first digest value to the second interaction device, and the second interaction device can compare the first digest value with the second digest value to determine whether the two are the same, and feedback the comparison result to the first interaction device, so that the first interaction device determines whether the first digest value is the same as the second digest value.

[0131] Specifically, the devices participating in the quantum key interaction can be respectively referred to as device M and device N. Device M can determine whether the digest values ​​generated by the two are the same based on steps S103A-S103B and S103C shown above, and device N can also determine whether the digest values ​​generated by the two are the same based on steps S103A-S103B and S103C shown above.

[0132] That is, device M can send the digest value generated by itself to device N, and device N can also send the digest value generated by itself to device M. Both device M and device N can compare the digest value generated by themselves with the digest value received by themselves, and independently determine whether the digest values ​​generated by the two are the same.

[0133] In addition, device M may determine whether the first digest value is the same as the second digest value based on steps S103A-S103B shown above, and device N may determine whether the first digest value is the same as the second digest value based on steps S103C-S103D shown above.

[0134] That is, device N sends the digest value calculated by itself to device M. After receiving the digest value sent by device N, device M compares it with the digest value generated by itself and sends the comparison result to device N, so that device N can also determine the comparison result of the two digest values. Compared with the above determination method, device M does not need to send the digest value generated by itself to device N. It only needs device N to send the digest value generated by itself to device M to determine whether the digest values ​​of the two are the same, thereby saving data transmission resources between the two parties of quantum key interaction and improving the efficiency of obtaining effective quantum keys.

[0135] See also Figure 5 , which is a flow chart of a fourth method for obtaining an effective quantum key provided in an embodiment of the present invention.

[0136] As can be seen from the figure, the above-mentioned effective quantum key acquisition method includes a quantum key distribution process and an effective quantum key acquisition process. Specifically, the above-mentioned quantum key distribution process is a process of exchanging quantum keys based on the BB84 protocol.

[0137] The steps on the left side of the dotted line in the figure are performed by the key sender, and the steps on the right side of the dotted line are performed by the key receiver.

[0138] Specifically, the above-mentioned method for obtaining a valid quantum key includes the following steps B1-B19.

[0139] Step B1: The key sender selects a basis vector.

[0140] Step B2: The key sender generates a random binary number.

[0141] Step B3: The key sender performs optical quantum modulation on the random binary number based on the selected basis vector to obtain optical quanta.

[0142] Step B4: The key sender sends the light quantum to the key receiver through the quantum channel.

[0143] Step B5: The key receiver selects a basis vector.

[0144] Step B6: The key receiver decodes the obtained light quantum based on the basis vector.

[0145] Step B7: The key receiver obtains the binary number.

[0146] Step B8: The key sender and the key receiver exchange basis vectors through a classical channel.

[0147] Step B9: The key sender obtains the quantum key based on the basis vector as the decoding data.

[0148] Step B10: The key receiver obtains the quantum key based on the basis vector as decoding data.

[0149] Specifically, the aforementioned steps B1-B10 are similar to the aforementioned quantum key interaction method and will not be repeated here.

[0150] Step B11: The key sender calculates the digest value of the decoded data.

[0151] Step B12: The key receiver calculates the digest value of the decoded data.

[0152] Step B13: The key sender and the key receiver exchange summary values ​​through the classic channel.

[0153] Step B14: The key sender compares the digest value.

[0154] If the digest values ​​are different, execute step B16.

[0155] Step B15: The key receiver compares the digest value.

[0156] If the digest values ​​are different, execute step B17.

[0157] Step B16: The key sender groups the decoded data to obtain new decoded data.

[0158] Return to step B11.

[0159] Step B17: The key receiver groups the decoded data to obtain new decoded data.

[0160] Return to step B12.

[0161] Return to the loop and iterate to execute steps B11-B17 until the preset termination condition is reached.

[0162] Step B18: The key sender obtains a valid quantum key.

[0163] Step B19: The key recipient obtains a valid quantum key.

[0164] Specifically, the aforementioned steps B11-B19 are the same as the aforementioned Figure 1 The embodiments shown are similar and will not be described again in detail.

[0165] See also Figure 6, which is a flow chart of a fifth method for obtaining a valid quantum key provided in an embodiment of the present invention, comprising the following steps C1-C18.

[0166] Specifically, the above-mentioned effective quantum key acquisition method includes a quantum key distribution process and an effective quantum key acquisition process. Among them, the above-mentioned quantum key distribution process is a process of exchanging quantum keys based on the BB84 protocol.

[0167] Step C1: The key sender generates a random binary number.

[0168] Step C2: The key sender selects a basis vector for each binary bit of the random binary number, and performs optical quantum modulation on the random binary number based on the basis vector to obtain an optical quantum.

[0169] Step C3: The key sender sends the light quantum to the key receiver through the quantum channel.

[0170] Step C4: The key receiver selects a basis vector.

[0171] Step C5: The key receiver decodes the obtained light quantum to obtain a binary number.

[0172] Step C6: The key sender and the key receiver exchange basis vectors through a classical channel.

[0173] Step C7: The key sender determines the binary bits with the same corresponding basis vector as the decoded data.

[0174] Step C8: The key receiver determines the binary bits with the same corresponding basis vector as the decoded data.

[0175] Specifically, the aforementioned steps C1-C8 are similar to the aforementioned quantum key interaction method and will not be repeated here.

[0176] Step C9: The key sender calculates the digest value of the decoded data.

[0177] Step C10: The key receiver calculates the digest value of the decoded data.

[0178] Step C11: The key sender and the key receiver interact through the classic channel and compare the digest values.

[0179] If the digest values ​​are different, the key sender executes steps C12-C13, and the key receiver executes steps C14-C15.

[0180] Step C12: The key sender groups the decoded data to obtain new decoded data.

[0181] Step C13: The key sender calculates the digest value of the new decoded data.

[0182] Step C14: The key receiver groups the decoded data to obtain new decoded data.

[0183] Step C15: The key receiver calculates the digest value of the new decoded data.

[0184] Step C16: The key sender and the key receiver interact through the classic channel and compare the new digest value.

[0185] If the digest values ​​are different, the key sender returns to execute steps C12-C13, and the key receiver returns to execute steps C14-C15. If the digest values ​​are the same, the key sender executes step C17, and the key receiver executes step C18.

[0186] Step C17: The key sender retains the decoded data with the same summary value to obtain a valid quantum key.

[0187] Step C18: The key recipient retains the decoded data with the same summary value to obtain a valid quantum key.

[0188] Specifically, the aforementioned steps C9-C18 and the aforementioned Figure 1 The embodiments shown are similar and will not be described again in detail.

[0189] Corresponding to the aforementioned method for obtaining a valid quantum key applied to a first interactive device, an embodiment of the present invention further provides a device for obtaining a valid quantum key applied to a first interactive device.

[0190] See also Figure 7 , is a schematic diagram of the structure of an effective quantum key acquisition device provided by an embodiment of the present invention, which is applied to each device that performs quantum key interaction, as a first interaction device, and the device includes:

[0191] A decoding data obtaining module 701 is used to obtain a first quantum key and use the first quantum key as first decoding data;

[0192] A first digest value calculation module 702, configured to calculate a first digest value of the first decoded data;

[0193] A digest value comparison module 703 is used to determine whether the first digest value is the same as the second digest value, wherein the second digest value is: a digest value obtained by the second interactive device calculating the second decoded data, the position of the second decoded data in the second quantum key is the same as the position of the first decoded data in the first quantum key, the first interactive device calculates the first digest value in the same way as the second interactive device calculates the second digest value, and the second quantum key is: a quantum key obtained by the second interactive device;

[0194] a target data determination module 704, configured to determine the first decoded data as target data if the digest value comparison module 703 determines that the first digest value is the same as the second digest value;

[0195] a decoded data division module 705, configured to divide the first decoded data, if the digest value comparison module 703 determines that the first digest value is different from the second digest value, and use each grouped data obtained by the division as a new first decoded data, and trigger the execution of the first digest value calculation module 702 for each first decoded data if a preset termination condition is not met;

[0196] The effective key obtaining module 706 is used to combine the determined target data to obtain the effective quantum key if the preset termination condition is met.

[0197] As can be seen from the above, an embodiment of the present invention provides an effective quantum key acquisition method, which is applied to a first interactive device that performs quantum key interaction. The first interactive device calculates a first digest value of the first decoded data, and compares the first digest value with a second digest value calculated by the second interactive device for the second decoded data. Since the digest calculation method used by the first interactive device to calculate the first digest value is the same as the digest calculation method used by the second interactive device to calculate the second digest value, if the calculated first digest value is the same as the second digest value, it means that the first decoded data is the same as the second decoded data, and the first decoded data can be used as the target data. Otherwise, it means that the first decoded data contains a different part from the second decoded data, and the first decoded data can be divided to obtain new first decoded data, and continue to determine whether the new first decoded data is the target data.

[0198] It can be seen that through the embodiments of the present invention, each device performing quantum key interaction can obtain the same target data as a first interaction device, and then the same effective quantum key can be obtained by combining data based on the same target data.

[0199] In one embodiment of the present invention, the summary value comparison module 703 is specifically used to:

[0200] receiving a second digest value sent by a second interactive device;

[0201] The first digest value is compared with the second digest value to determine whether the first digest value is the same as the second digest value.

[0202] As can be seen above, in the embodiment of the present invention, after calculating the second digest value, the second interactive device can send the first digest value to the first interactive device, and the first interactive device can compare the first digest value with the second digest value to determine whether they are the same.

[0203] In one embodiment of the present invention, the summary value comparison module 703 is specifically used to:

[0204] Sending the first digest value to the second interactive device, so that the second interactive device compares the first digest value with the second digest value, and feeds back the comparison result to the first interactive device;

[0205] Based on the received comparison result, it is determined whether the first digest value is the same as the second digest value.

[0206] As can be seen from the above, in the embodiment of the present invention, after calculating the first digest value, the first interaction device can send the first digest value to the second interaction device, and the second interaction device can compare the first digest value with the second digest value to determine whether the two are the same, and feedback the comparison result to the first interaction device, so that the first interaction device determines whether the first digest value is the same as the second digest value.

[0207] In one embodiment of the present invention, the above-mentioned decoded data division module 705 is specifically used for:

[0208] When the digest value comparison module 703 determines that the first digest value is different from the second digest value, the first decoded data is evenly divided using a binary method, and two grouped data obtained by the division are respectively used as new first decoded data.

[0209] As can be seen from the above, in the embodiment of the present invention, the average division method is adopted to obtain two grouped data with similar binary bits, and then the grouped data are used as new first decoding data to determine the target data, which can generally improve the speed of determining the target data, and thus improve the speed of determining the effective quantum key.

[0210] In one embodiment of the present invention, the preset termination condition is: the length of each grouped data obtained by division is smaller than the quantum key length required for encrypting the data.

[0211] It can be seen that the length of the first quantum key obtained by the first interactive device is often much longer than the length of the quantum key required for data encryption. Therefore, the total length of the determined effective quantum key does not need to be too long to achieve the subsequent data encryption process. In other words, the total length of the target data finally determined does not need to be too long. Therefore, it is actually not necessary to determine all the binary bits contained in the first quantum data that are the same as the second quantum data. It is also possible to generate sufficient effective quantum keys for subsequent data encryption. Therefore, in the embodiment of the present invention, the length of each grouped data obtained by division can be less than the length of the quantum key required for data encryption as the termination condition for cyclically determining the target data. At this time, although there are still binary bits that are the same as those in the second quantum key in each grouped data obtained by division, the total length of the target data obtained is often enough to meet the needs of subsequent data encryption. At this time, stopping the determination of the target data can save data calculation and transmission resources of the first interactive device and the second interactive device, and improve the efficiency of obtaining effective quantum keys.

[0212] The embodiment of the present invention further provides an electronic device, such as Figure 8 As shown, it includes a processor 801, a communication interface 802, a memory 803 and a communication bus 804, wherein the processor 801, the communication interface 802, and the memory 803 communicate with each other through the communication bus 804.

[0213] Memory 803, used for storing computer programs;

[0214] The processor 801 is used to implement any method step shown in the above-mentioned method for obtaining a valid quantum key when executing the program stored in the memory 803.

[0215] When the electronic device provided by the embodiment of the present invention is used to obtain an effective quantum key, the embodiment of the present invention provides an effective quantum key obtaining method, which is applied to a first interactive device that performs quantum key interaction, and the first interactive device calculates a first digest value of the first decoded data, and compares the first digest value with a second digest value obtained by the second interactive device calculating the second decoded data. Since the digest calculation method used by the first interactive device to calculate the first digest value is the same as the digest calculation method used by the second interactive device to calculate the second digest value, if the calculated first digest value is the same as the second digest value, it means that the first decoded data is the same as the second decoded data, and the first decoded data can be used as the target data. Otherwise, it means that the first decoded data contains a different part from the second decoded data, and the first decoded data can be divided to obtain new first decoded data, and continue to determine whether the new first decoded data is the target data.

[0216] It can be seen that through the embodiments of the present invention, each device performing quantum key interaction can obtain the same target data as a first interaction device, and then the same effective quantum key can be obtained by combining data based on the same target data.

[0217] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0218] The communication interface is used for communication between the above electronic device and other devices.

[0219] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0220] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0221] In another embodiment of the present invention, a computer-readable storage medium is provided, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned methods for obtaining a valid quantum key are implemented.

[0222] When applying the computer program stored in the computer-readable storage medium provided by the embodiment of the present invention to obtain an effective quantum key, the embodiment of the present invention provides an effective quantum key obtaining method, which is applied to a first interactive device that performs quantum key interaction, and the first interactive device calculates a first digest value of the first decoded data, and compares the first digest value with the second digest value obtained by the second interactive device calculating the second decoded data. Since the digest calculation method used by the first interactive device to calculate the first digest value is the same as the digest calculation method used by the second interactive device to calculate the second digest value, if the calculated first digest value is the same as the second digest value, it means that the first decoded data is the same as the second decoded data, and the first decoded data can be used as the target data. Otherwise, it means that the first decoded data contains a different part from the second decoded data, and the first decoded data can be divided to obtain new first decoded data, and continue to determine whether the new first decoded data is the target data.

[0223] It can be seen that through the embodiments of the present invention, each device performing quantum key interaction can obtain the same target data as a first interaction device, and then the same effective quantum key can be obtained by combining data based on the same target data.

[0224] In another embodiment provided by the present invention, a computer program product comprising instructions is also provided, which, when executed on a computer, enables the computer to execute any effective quantum key acquisition method in the above embodiments.

[0225] When the computer program product provided by the embodiment of the present invention is used to obtain an effective quantum key, the embodiment of the present invention provides an effective quantum key obtaining method, which is applied to a first interactive device that performs quantum key interaction, and the first interactive device calculates a first digest value of the first decoded data, and compares the first digest value with a second digest value obtained by the second interactive device calculating the second decoded data. Since the digest calculation method used by the first interactive device to calculate the first digest value is the same as the digest calculation method used by the second interactive device to calculate the second digest value, if the calculated first digest value is the same as the second digest value, it means that the first decoded data is the same as the second decoded data, and the first decoded data can be used as the target data. Otherwise, it means that the first decoded data contains a different part from the second decoded data, and the first decoded data can be divided to obtain new first decoded data, and continue to determine whether the new first decoded data is the target data.

[0226] It can be seen that through the embodiments of the present invention, each device performing quantum key interaction can obtain the same target data as a first interaction device, and then the same effective quantum key can be obtained by combining data based on the same target data.

[0227] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk Solid State Disk (SSD)), etc.

[0228] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0229] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device, electronic device, computer-readable storage medium, and computer program product embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.

[0230] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.

Claims

1. A method for obtaining an effective quantum key, characterized in that: Any device that performs quantum key interaction is used as a first interaction device, and another device is used as a second interaction device. The method is applied to the first interaction device and includes: Obtaining a first quantum key, and using the first quantum key as first decoding data; Calculating a first digest value of the first decoded data; Determining whether the first digest value is the same as the second digest value, wherein the second digest value is: a digest value obtained by the second interactive device calculating the second decoded data, a position of the second decoded data in the second quantum key is the same as a position of the first decoded data in the first quantum key, a method in which the first interactive device calculates the first digest value is the same as a method in which the second interactive device calculates the second digest value, and the second quantum key is: a quantum key obtained by the second interactive device; If they are the same, the first decoded data is determined as the target data; If they are different, the first decoded data is divided, and each grouped data obtained by the division is used as a new first decoded data. If the preset termination condition is not met, for each first decoded data, the step of calculating the first summary value of the first decoded data is returned to be executed; If the preset termination condition is met, the determined target data is combined to obtain a valid quantum key.

2. The method according to claim 1, characterized in that The determining whether the first digest value is the same as the second digest value includes: receiving a second digest value sent by a second interactive device; The first digest value is compared with the second digest value to determine whether the first digest value is the same as the second digest value.

3. The method according to claim 1, characterized in that: The determining whether the first digest value is the same as the second digest value includes: Sending the first digest value to the second interactive device, so that the second interactive device compares the first digest value with the second digest value, and feeds back the comparison result to the first interactive device; Based on the received comparison result, it is determined whether the first digest value is the same as the second digest value.

4. The method according to claim 1, characterized in that: The step of dividing the first decoded data and using each group of data obtained by the division as new first decoded data includes: The first decoded data is evenly divided by using a binary division method, and two grouped data obtained by the division are respectively used as new first decoded data.

5. The method according to any one of claims 1 to 4, characterized in that The preset termination condition is that the length of each grouped data obtained by division is less than the quantum key length required for encrypting the data.

6. An effective quantum key acquisition device, characterized in that: Any device for quantum key interaction is used as a first interaction device, and another device is used as a second interaction device, and is applied to the first interaction device. The device includes: A decoding data obtaining module, used to obtain a first quantum key and use the first quantum key as first decoding data; A first digest value calculation module, used to calculate a first digest value of the first decoded data; a digest value comparison module, configured to determine whether the first digest value is the same as the second digest value, wherein the second digest value is: a digest value obtained by the second interactive device calculating the second decoded data, the position of the second decoded data in the second quantum key is the same as the position of the first decoded data in the first quantum key, the first interactive device calculates the first digest value in the same manner as the second interactive device calculates the second digest value, and the second quantum key is: a quantum key obtained by the second interactive device; a target data determination module, configured to determine the first decoded data as target data if the digest value comparison module determines that the first digest value is the same as the second digest value; a decoded data division module, configured to divide the first decoded data, if the digest value comparison module determines that the first digest value is different from the second digest value, and use each grouped data obtained by the division as a new first decoded data, and trigger the execution of the first digest value calculation module for each first decoded data if a preset termination condition is not met; The effective key acquisition module is used to combine the determined target data to obtain the effective quantum key if the preset termination condition is met.

7. The device according to claim 6, characterized in that The summary value comparison module is specifically used for: receiving a second digest value sent by a second interactive device; The first digest value is compared with the second digest value to determine whether the first digest value is the same as the second digest value.

8. The device according to claim 6, characterized in that The summary value comparison module is specifically used for: Sending the first digest value to the second interactive device, so that the second interactive device compares the first digest value with the second digest value, and feeds back the comparison result to the first interactive device; Based on the received comparison result, it is determined whether the first digest value is the same as the second digest value.

9. The device according to claim 6, characterized in that The decoded data division module is specifically used for: When the digest value comparison module determines that the first digest value is different from the second digest value, the first decoded data is evenly divided using a binary method, and two grouped data obtained by the division are respectively used as new first decoded data.

10. The device according to any one of claims 6 to 9, characterized in that: The preset termination condition is that the length of each grouped data obtained by division is less than the quantum key length required for encrypting the data.

11. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, for implementing the method steps described in any one of claims 1 to 5 when executing a program stored in a memory.

12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method steps described in any one of claims 1 to 5 are implemented.