CN115189865A - Method and device for obtaining effective quantum key - Google Patents

Method and device for obtaining effective quantum key Download PDF

Info

Publication number
CN115189865A
CN115189865A CN202210668315.8A CN202210668315A CN115189865A CN 115189865 A CN115189865 A CN 115189865A CN 202210668315 A CN202210668315 A CN 202210668315A CN 115189865 A CN115189865 A CN 115189865A
Authority
CN
China
Prior art keywords
data
digest value
quantum key
value
digest
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210668315.8A
Other languages
Chinese (zh)
Inventor
黄铖斌
方燕萍
王锦华
薛伟佳
王聪丽
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Telecom Corp Ltd
Original Assignee
China Telecom Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Telecom Corp Ltd filed Critical China Telecom Corp Ltd
Priority to CN202210668315.8A priority Critical patent/CN115189865A/en
Publication of CN115189865A publication Critical patent/CN115189865A/en
Priority to PCT/CN2022/141137 priority patent/WO2023240986A1/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0816Key establishment, i.e. cryptographic processes or cryptographic protocols whereby a shared secret becomes available to two or more parties, for subsequent use
    • H04L9/0852Quantum cryptography
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0816Key establishment, i.e. cryptographic processes or cryptographic protocols whereby a shared secret becomes available to two or more parties, for subsequent use
    • H04L9/0819Key transport or distribution, i.e. key establishment techniques where one party creates or otherwise obtains a secret value, and securely transfers it to the other(s)
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3236Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using cryptographic hash functions
    • H04L9/3239Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using cryptographic hash functions involving non-keyed hash functions, e.g. modification detection codes [MDCs], MD5, SHA or RIPEMD

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • Electromagnetism (AREA)
  • Theoretical Computer Science (AREA)
  • Storage Device Security (AREA)

Abstract

The embodiment of the invention provides a method and a device for obtaining an effective quantum key, which relate to the technical field of network security and are applied to first interaction equipment, wherein the method comprises the following steps: obtaining a first quantum key, and taking the first quantum key as first decoding data; calculating a first abstract value of the first decoding data; determining whether the first digest value is the same as the second digest value; if the first decoding data are the same as the target data, determining the first decoding data as the target data; if the first decoded data are different, dividing the first decoded data, taking each divided grouped data as new first decoded data, and returning to the step of calculating the first abstract value of the first decoded data if the preset termination condition is met for each first decoded data; and if the preset termination condition is met, performing data combination on the determined target data to obtain the effective quantum key. By applying the scheme provided by the embodiment of the invention, both sides of quantum key interaction can obtain the same effective quantum key.

Description

Method and device for obtaining effective quantum key
Technical Field
The invention relates to the technical field of network security, in particular to a method and a device for obtaining an effective quantum key.
Background
In order to ensure the safety of the data interaction process of the two data interaction parties, the two data interaction parties can firstly interact the secret key before data interaction is carried out, then the sender can adopt the secret key to encrypt the data and then transmit the encrypted data, and the receiver can adopt the same secret key to decrypt the encrypted data after receiving the encrypted data. Since only both data interaction parties can obtain the key, and other devices cannot decrypt the encrypted data even if the other devices obtain the transmitted encrypted data, the security of data transmission can be ensured by using the key.
The quantum key is a key with higher safety degree, and both sides of quantum key interaction can interact the quantum key through a quantum channel and then carry out encrypted data transmission based on the quantum key. However, due to the influence of the light quantum characteristics, the quantum key is easily interfered in the transmission process, so that the quantum keys obtained by two sides of quantum key interaction are different, and the quantum key is an invalid quantum key. In order to solve the above problems, a method for obtaining an effective quantum key is needed.
Disclosure of Invention
The embodiment of the invention aims to provide an effective quantum key obtaining method and device so as to ensure that two quantum key interaction parties obtain the same effective quantum key. The specific technical scheme is as follows:
in a first aspect, an embodiment of the present invention provides an effective quantum key obtaining method, where any device that performs 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, where the method includes:
obtaining a first quantum key, and taking 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 a second digest value, wherein the second digest value is: the second interaction device calculates a digest value obtained by 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 way of calculating the first digest value by the first interaction device is the same as the way of calculating the second digest value by the second interaction device, and the second quantum key is: the quantum key obtained by the second interactive device;
if the first decoding data are the same as the target data, determining the first decoding data as the target data;
if the first decoding data are different, dividing the first decoding data, taking each divided grouped data as new first decoding data respectively, and if a preset termination condition is not met, returning to the step of calculating the first abstract value of the first decoding data aiming at each first decoding data;
and if the preset termination condition is met, performing data combination on the determined target data to obtain the effective quantum key.
In an embodiment of the present invention, the determining whether the first digest value is the same as the second digest value includes:
receiving a second abstract value sent by second interactive equipment;
and comparing the first abstract value with the second abstract value to determine whether the first abstract value and the second abstract value are the same.
In an embodiment of the present invention, the determining whether the first digest value is the same as the second digest value includes:
sending a first abstract value to second interactive equipment, enabling the second interactive equipment to compare the first abstract value with a second abstract value, and feeding back a comparison result to the first interactive equipment;
determining whether the first digest value and the second digest value are the same based on the received comparison result.
In an embodiment of the present invention, the dividing the first decoded data, and using each divided packet data as new first decoded data respectively includes:
and averagely dividing the first decoding data by adopting a bisection method, and respectively taking two grouped data obtained by dividing as new first decoding data.
In an embodiment of the present invention, the preset termination condition is: the length of each divided grouped data is smaller than the length of a quantum key required for encrypting the data.
In a second aspect, an embodiment of the present invention provides an effective quantum key obtaining apparatus, where any device that performs 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 apparatus includes:
the decoding data obtaining module is used for obtaining a first quantum key and taking the first quantum key as first decoding data;
the first digest value calculation module is used for calculating a first digest value of the first decoding data;
a digest value comparison module, configured to determine whether the first digest value is the same as a second digest value, where the second digest value is: the second interaction device calculates a digest value obtained by 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 way of calculating the first digest value by the first interaction device is the same as the way of calculating the second digest value by the second interaction device, and the second quantum key is: the quantum key obtained by the second interactive device;
a target data determining module, configured to determine first decoded data as target data when the digest value comparing module determines that the first digest value is the same as the second digest value;
a decoding data dividing module, configured to divide the first decoding data when the digest value comparison module determines that the first digest value is different from the second digest value, use each divided packet data as new first decoding data, and trigger execution of the first digest value calculation module for each first decoding data if a preset termination condition is not met;
and the effective key obtaining module is used for carrying out data combination on the determined target data to obtain an effective quantum key if a preset termination condition is met.
In an embodiment of the present invention, the digest value comparison module is specifically configured to:
receiving a second abstract value sent by second interactive equipment;
and comparing the first abstract value with the second abstract value to determine whether the first abstract value and the second abstract value are the same.
In an embodiment of the present invention, the digest-value comparison module is specifically configured to:
sending a first abstract value to second interactive equipment, enabling the second interactive equipment to compare the first abstract value with a second abstract value, and feeding back a comparison result to the first interactive equipment;
determining whether the first digest value is identical to the second digest value based on the received comparison result.
In an embodiment of the present invention, the decoding data dividing module is specifically configured to:
and under the condition that the digest value comparison module determines that the first digest value is different from the second digest value, averagely dividing the first decoding data by adopting a bisection method, and respectively taking two grouped data obtained by dividing as new first decoding data.
In an embodiment of the present invention, the preset termination condition is: the length of each divided grouped data is smaller than the length of a quantum key required for encrypting the data.
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, where the processor, the communication interface, and the memory complete mutual communication through the communication bus;
a memory for storing a computer program;
a processor for implementing the method steps of any of the first aspect when executing a program stored in the memory.
In a fourth aspect, the present invention provides a computer-readable storage medium, in which a computer program is stored, and the computer program, when executed by a processor, implements the method steps of any one of the first aspect.
In a fifth aspect, embodiments of the present invention also provide a computer program product comprising instructions, which when run on a computer, cause the computer to perform the method steps of any of the first aspects described above.
The embodiment of the invention has the following beneficial effects:
the embodiment of the invention provides an effective quantum key obtaining method, which is applied to first interaction equipment for quantum key interaction. 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 may be used as the target data. Otherwise, the part of the first decoded data, which is included in the second decoded data, is described, the first decoded data may be divided to obtain new first decoded data, and it is continuously determined whether the new first decoded data is the target data.
Therefore, through the embodiment of the invention, each device for quantum key interaction can be used as the first interaction device to obtain the same target data, and then the same effective quantum key can be obtained by performing data combination based on the same target data.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and other drawings can be obtained by those skilled in the art according to the drawings.
Fig. 1 is a schematic flowchart of a first method for obtaining an effective quantum key according to an embodiment of the present invention;
FIG. 2 is a flow chart of target data determination according to an embodiment of the present invention;
fig. 3 is a schematic flowchart of a second effective quantum key obtaining method according to an embodiment of the present invention;
fig. 4 is a schematic flowchart of a third method for obtaining a valid quantum key according to an embodiment of the present invention;
fig. 5 is a schematic flowchart of a fourth method for obtaining a valid quantum key according to an embodiment of the present invention;
fig. 6 is a schematic flowchart of a fifth method for obtaining an effective quantum key according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of an effective quantum key obtaining apparatus according to an embodiment of the present invention;
fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived from the embodiments given herein by one of ordinary skill in the art, are within the scope of the invention.
The embodiment of the invention provides an effective quantum key obtaining method, any device for carrying out quantum key interaction is used as a first interaction device, another device is used as a second interaction device and is applied to the first interaction device, and the method comprises the following steps:
obtaining a first quantum key, and taking 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 a second digest value, wherein the second digest value is: the second interactive device calculates a digest value obtained by calculating second decoded data, where 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, and the first interactive device calculates the first digest value in the same manner as the second interactive device calculates the second digest value, where the second quantum key is: the quantum key obtained by the second interactive device;
if the first decoding data are the same as the target data, determining the first decoding data as the target data;
if the first decoding data are different, dividing the first decoding data, taking each divided grouped data as new first decoding data respectively, and if a preset termination condition is not met, returning to the step of calculating the first abstract value of the first decoding data aiming at each first decoding data;
and if the preset termination condition is met, performing data combination on the determined target data to obtain the effective quantum key.
As can be seen from the above, 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 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 indicates that the first decoded data is the same as the second decoded data, and the first decoded data may be used as the target data. Otherwise, the part of the first decoded data, which is included in the second decoded data, is described, the first decoded data may be divided to obtain new first decoded data, and whether the new first decoded data is the target data is continuously determined.
Therefore, through the embodiment of the invention, each device for quantum key interaction can obtain the same target data as the first interaction device, and then the same effective quantum key can be obtained by performing data combination based on the same target data.
First, a quantum key interaction process is described, in the embodiment of the present invention, both sides of the quantum key interaction may implement the quantum key interaction process based on the BB84 protocol or other protocols in the prior art.
Under the condition that quantum key interaction is carried out on both sides of quantum key interaction based on a BB84 protocol, the both sides of quantum key interaction can be divided into a key sending side and a key receiving side, the key sending side firstly generates a random binary number containing a preset number of bits, a basis vector is set for each bit of the random binary number, and then optical quantum modulation is carried out on the random binary number to obtain optical quantum.
And, the key receiver also configures a preset number of basis vectors, each basis vector corresponding to a binary bit.
And the key sending party sends the light quanta to the key receiving party through the quantum channel, and the key receiving party analyzes the light quanta to obtain random binary numbers.
And the key sender and the key receiver respectively send the self-set basis vectors to the opposite side, respectively compare the self-set basis vectors with the received basis vectors according to bits, and determine the binary bits with the same corresponding basis vectors.
And the key sender and the key receiver respectively combine the binary bits which are determined by the key sender and have the same basis vector according to the front and back sequence of the binary bits in the random binary bits to obtain the quantum key.
In the process, both the key sender and the key receiver obtain the quantum key based on the random binary number generated by the key sender, and the random binary number is sent to the key receiver by the key sender in the form of optical quantum and is influenced by the quantum mechanical characteristics of the optical quantum, the optical quantum is easily interfered and changed in the transmission process, so that the optical quantum received by the key receiver is different from the optical quantum sent by the key sender, and further the random binary number obtained by the key receiver is different from the random binary number generated by the key sender, and finally the quantum key obtained by the key receiver based on the random binary number is different from the quantum key obtained by the key sender based on the random binary number, so that the problem that both key interaction parties obtain invalid quantum keys is caused.
In addition, the mutual transmitted basis vector of the two key interaction parties is the basis for extracting the quantum key from the random binary number, and accurate quantum key extraction can be realized only by ensuring that the basis vector does not change in the transmission process. Therefore, both sides of the key interaction can transmit the basis vectors through other channels with higher stability except the quantum channel, and the other channels except the quantum channel can be called as classical channels.
As can be seen from the above, quantum keys obtained by both sides of quantum key interaction in the prior art may be different invalid quantum keys, and in order to solve the above problems, embodiments of the present invention provide a method and an apparatus for obtaining an effective quantum key.
Referring to fig. 1, which is a schematic flow chart of a first method for obtaining an effective quantum key according to an embodiment of the present invention, any device that performs quantum key interaction is used as a first interaction device, and another device is used as a second interaction device and applied to the first interaction device, and effective quantum keys are synchronously determined through the following steps S101 to S106.
S101: and obtaining a first quantum key, and using the first quantum key as first decoding data.
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 the first interactive device. 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 the random binary number received by the first interactive device. The first quantum key is composed of a plurality of binary bits.
S102: calculating a first digest value of the first decoded data.
In an embodiment of the present invention, the first interactive device may employ a predetermined digest calculation manner to calculate the first digest value, where the predetermined digest calculation manner may be a digest calculation manner 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 Hash function may be SHA224 (Secure Hash Algorithm 224), SHA256 (Secure Hash Algorithm256 ), SHA512 (Secure Hash Algorithm512, secure Hash Algorithm 512), and the like.
S103: and determining whether the first abstract value and the second abstract value are the same.
Wherein, the second abstract value is: and the second interactive equipment calculates the digest value obtained by the second decoding data.
The position of the second decoding data in the second quantum key is the same as the position of the first decoding 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: the second interactive device obtains the quantum key.
Specifically, in the case that 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 interaction device performs digest value calculation on the second quantum key based on the digest calculation method to obtain the second digest value. Specifically, after the second interactive device obtains the second quantum key, the second interactive device may also calculate the obtained second digest value based on the calculation manner shown in step S102.
In the case where the above-indicated key sender is the above-indicated first interaction device, the second interaction device is the above-indicated key receiver, and in the case where the above-indicated key receiver is the above-indicated first interaction device, the second interaction device is the above-indicated key sender.
In addition, if the first digest value is the same as the second digest value, it indicates 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, it indicates 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 continuously executed, otherwise, it indicates that the first quantum key is different from the second quantum key, and includes different binary bits, and step S105 is continuously executed if the preset termination condition is not met.
Otherwise, if the preset termination condition is satisfied, the step S106 is continuously executed.
In addition, the description of the preset termination condition can be referred to below, and will not be detailed herein.
S104: the first decoded data is determined to be target data.
Specifically, if a first digest value corresponding to the first decoded data is the same as a second digest value corresponding to the second decoded data, it may be determined that the first decoded data is the same as the second decoded data, and the first decoded data may be marked as target data that can be combined into an effective quantum key.
S105: and dividing the first decoding data, and taking each divided grouped data as new first decoding data respectively.
In addition, for each new first decoded data, the step S102 is executed again until the predetermined termination condition is satisfied.
Specifically, the number of the packet data obtained by dividing the original first decoded data may be a preset packet data number, for example, 2, 3, 4, and the like, the lengths of the packet data obtained by dividing may be the same or different, and the packet data obtained by dividing may or may not include the same binary bits.
In an embodiment of the present invention, the step S105 can be implemented by the step a shown below, and will not be described in detail here.
In addition, after the original first decoding data is divided to obtain new first decoding data, the second decoding data corresponding to the first decoding data is also updated, which is equivalent to that the original second decoding data is divided by the second interactive data in the same data division mode as the first interactive data to obtain new second decoding data, and the position of the bit contained in the new second decoding data in the second quantum key is still the same as the position of the bit contained in the new first decoding data in the first quantum key.
Specifically, for each new first decoded data, returning to execute steps S102-S103, calculating to obtain a first digest value of the new first decoded data and a second digest value of the new second decoded data, continuously determining whether the first digest value is the same as the second digest value, if so, executing step S104, taking the new first decoded data as target data, otherwise, indicating that the new first decoded data is different from the new second decoded data, executing step S105 for the new first decoded data, dividing the new first decoded data to obtain each packet data, and re-executing step S102 for each packet data as the new first decoded data, and so on to gradually determine the target data included in the first quantum key.
S106: and performing data combination on the determined target data to obtain an effective quantum key.
Specifically, the target arrays may be sequentially arranged and combined according to a front-back order of each target data in the first quantum key to form an effective quantum key.
As can be seen from the above, the embodiment of the present invention provides an effective quantum key obtaining method, which is applied to a first interaction device for performing quantum key interaction, where the first interaction 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 interaction device for 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 may be used as the target data. Otherwise, the part of the first decoded data, which is included in the second decoded data, is described, the first decoded data may be divided to obtain new first decoded data, and it is continuously determined whether the new first decoded data is the target data.
Therefore, through the embodiment of the invention, each device for quantum key interaction can obtain the same target data as the first interaction device, and then the same effective quantum key can be obtained by performing data combination based on the same target data.
In one embodiment of the present invention, the step S104 can be implemented by the following step a.
Step A: and averagely dividing the first decoding data by adopting a bisection method, and respectively taking two grouped data obtained by dividing as new first decoding data.
Specifically, when the first decoded data includes an even number of binary bits, the binary bits included in the two pieces of packet data obtained by the average division are the same, and when the first decoded data includes an odd number of binary bits, one piece of packet data obtained by the average division has one more binary bit than the other piece of packet data.
Under the condition that the first decoding data is different from the second decoding data, different binary bits exist in the first decoding data and the second decoding data, but the specific positions of the different binary bits in the first decoding data cannot be determined.
If the first decoding data is divided in a non-average division mode, the more binary bits are included in the divided grouped data, the higher the probability that the grouped data contains different binary bits is, and the lower the probability that the grouped data is the target data is. That is, in most cases, only a small number of bits can be determined as target data in each process of determining target data, resulting in a slow overall determination speed of target data and a short length of target data.
As can be seen from the above, in the embodiment of the present invention, two grouped data with similar binary bits are obtained by dividing in an average division manner, and then the grouped data are respectively used as new first decoding data to determine target data, so that the speed of determining the target data can be increased on the whole, and further, the speed of determining an effective quantum key can be increased.
In addition, the preset termination condition in the embodiment of the present invention is explained as follows:
the preset termination condition may be: the length of each divided grouped data is smaller than the length of a quantum key required for encrypting the data.
Specifically, with the implementation of the embodiment of the present invention, the lengths of the packet data obtained by dividing are gradually reduced, that is, the length of the packet data determined as the target data each time is gradually reduced, after the length of the packet data is smaller than the preset quantum key length, even if it is determined whether the packet data is the target data, the length of the target data obtained by determining is also shorter, at this time, even if the target data obtained continuously is put into the effective quantum key as a part of the effective quantum key, the effective quantum key is not greatly affected, and the calculation resources and the data transmission resources of the first interactive device and the second interactive device are consumed by continuously determining the target data, so that after the length of the packet data is smaller than the preset quantum key length, the determination of the target data can be stopped, and the efficiency of obtaining the effective quantum key is improved.
In addition, in the prior art, the lengths of the quantum keys obtained in the initial state by both parties participating in quantum key interaction are both long, for example, 1M, 2M, and the like, the number of different binary bits contained therein is not excessive, and the length of the quantum key actually required to be used when data is encrypted is often short, for example, the length of the quantum key actually required to be used may be 128 bits, 256 bits, and the like.
Therefore, the length of the first quantum key obtained by the first interactive device is often far longer than that of the quantum key required for data encryption, and therefore the determined total length of the effective quantum key does not need to be too long to realize the subsequent data encryption process. That is, the total length of the finally determined target data does not need to be too long, and therefore, all the same binary bits as the second quantum data contained in the first quantum data do not need to be actually determined, and a sufficient effective quantum key for use in the subsequent data encryption can be generated. Therefore, in the embodiment of the present invention, the length of each divided packet data may be smaller than the length of the quantum key required for encrypting data as a termination condition for circularly determining the target data, at this time, although each divided packet data still has the same binary bit as that in the second quantum key, the total length of the obtained target data often can meet the requirement of subsequent data encryption, and at this time, stopping determining the target data may save data calculation and transmission resources of the first interactive device and the second interactive device, and improve the efficiency of obtaining an effective quantum key.
In addition, the preset termination condition may be that the number of times of dividing the first decoded data reaches a preset number of times.
Or the divided packet data only contains one binary bit. Specifically, each packet data includes only one binary bit, which is equivalent to determining each binary bit included in the first quantum key and identical to each binary bit included in the second quantum key through the embodiment of the present invention, and using all the determined binary bits as target data, so that the length of the effective quantum key obtained based on the target data is longest.
Referring to fig. 2, a flow chart of target data determination according to an embodiment of the present invention is provided.
As can be seen from the figure, in the embodiment of the present invention, the first quantum key is first compared with the second decoded data as the first decoded data, the cross sign 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, so that the first quantum data is divided into the grouped data 1 and the grouped data 2.
Packet data 1 and packet data 2 are compared as new first decoded data with new second decoded data, respectively, and the cross symbols on packet data 1 and packet data 2 in the figure indicate that packet data 1 and packet data 2 are also not target data.
The method comprises the steps of dividing packet data 1 to obtain packet data 1-1 and packet data 1-2, dividing packet data 2 to obtain packet data 2-1 and packet data 2-2, taking the packet data 1-1, the packet data 1-2, the packet data 2-1 and the packet data 2-2 as new first decoding data, wherein cross symbols on the packet data 1-1, the packet data 1-2 and the packet data 2-2 in the graph indicate that the packet data 1-1, the packet data 1-2 and the packet data 2-2 are not target data, and a pair symbol on the packet data 2-1 indicates that the packet data 2-1 is the target data.
Packet data 1-1, packet data 1-2, and packet data 2-2 continue to be divided, and packet data 2-1 is not divided. The grouping data 1-1 is divided into the grouping data 1-1-1 and the grouping data 1-1-2, the grouping data 1-2-1 and the grouping data 1-2-2 are divided into the grouping data 1-2, and the grouping data 2-2-1 and the grouping data 2-2 are divided into the grouping data 2-2. In the figure, symbols on packet data 1-1-1, packet data 1-2-2, and packet data 2-2-2 indicate that packet data 1-1-1, packet data 1-2-2, and packet data 2-2-2 are target data, and symbols on packet data 1-1-2, packet data 1-2-1, and packet data 2-2-1 cross indicate that packet data 1-1-2, packet data 1-2-1, and packet data 2-2-1 are not target data.
And by analogy, iterative division is continuously carried out on the grouped data 1-1-2, the grouped data 1-2-1 and the grouped data 2-2-1, and finally the grouped data 1- \8230 \ 8230; -1, the grouped data 1- \8230; -2, the grouped data 2- \8230; -1, the grouped data 2- \8230; -2 is obtained, and preset termination conditions are met. Wherein the grouping data 1- \8230;, the pair number symbol on-1 indicates grouping data 1- \8230; -1 is target data, the grouping data 1- \8230;, the group data 8230; -2, the grouping data 2- \8230;, the grouping data 8230;, the group data 2- \8230;, the group data 2, the grouping data 2- \8230;, the group data 828230;, the group data 2- \\ 8230;, the group data 2- \\\ 8230;, the group data 1, the group data 2- \\ 8230, and the group data 8230-2 are not target data.
The target data obtained by the embodiment of the invention are grouped data 2-1, grouped data 1-1-1, grouped data 1-2-2, grouped data 2-2-2 and grouped data 1- \ 8230; -1, respectively. The respective target data may be combined into valid quantum data in the order of the respective target data in the first quantum key. Specifically, in the present embodiment, the group data 1-1-1, the group data 1- \8230; -1, the group data 1-2-2, the group data 2-1, and the group data 2-2-2 are combined into one effective quantum data in this order.
Referring to fig. 3, a schematic flow chart of a second method for obtaining an effective quantum key according to an embodiment of the present invention, compared with the foregoing embodiment shown in fig. 1, the step S103 may be implemented by the following steps S103A to S103B to implement the step S103.
S103A: and receiving a second abstract value sent by the second interactive device.
Specifically, since the second digest value is a basis for determining whether the first decoded data and the second decoded data are the same, in order to ensure accuracy of the determination result, the second digest value is prevented from changing during transmission, and therefore the second interactive device may send the second digest value to the first interactive device through a relatively stable classical channel.
S103B: comparing the first abstract value with the second abstract value to determine whether the first abstract value is the same as the second abstract value.
Specifically, the first digest value generated by the self-generator may be compared with the received second digest value, and it may be determined whether the first digest value is the same as the second digest value.
And 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.
As can be seen from the above, in the embodiment of the present invention, after the second interactive device calculates the second digest value, the second interactive device may send the first digest value to the first interactive device, and the first interactive device may compare the first digest value with the second digest value by itself to determine whether the first digest value and the second digest value are the same.
Referring to fig. 4, a schematic flow chart of a third method for obtaining an effective quantum key according to an embodiment of the present invention, compared with the foregoing fig. 1, the foregoing step S103 may be implemented by the following steps S103C to S103D.
S103C: and sending the first abstract value to second interactive equipment, so that the second interactive equipment compares the first abstract value with the second abstract value, and feeds back a comparison result to the first interactive equipment.
Specifically, since the first digest value is 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 to be avoided that the first digest value changes during the transmission process, and therefore the first interaction device may send the first digest value to the second interaction device through a relatively stable classical channel.
After the second interactive data receives the first abstract value, the received first abstract value and a second abstract value generated by the second interactive data can be compared, and therefore a comparison result is determined.
S103D: and determining whether the first abstract value and the second abstract value are the same based on the received comparison result.
As can be seen from the above, in the embodiment of the present invention, after the first interactive device calculates the first digest value, the first interactive device may send the first digest value to the second interactive device, and the second interactive device may compare the first digest value with the second digest value to determine whether the first digest value and the second digest value are the same, and feed back a comparison result to the first interactive device, so that the first interactive device determines whether the first digest value and the second digest value are the same.
Specifically, the devices participating in quantum key interaction may be referred to as device M and device N, respectively, and then device M may determine whether the digest values generated by the two devices are the same based on the steps S103A to S103B and S103C shown in the foregoing, and device N may also determine whether the digest values generated by the two devices are the same based on the steps S103A to S103B and S103C shown in the foregoing.
That is, the device M may send the self-generated digest value to the device N, and the device N also sends the self-generated digest value to the device M, and both the device M and the device N may compare the self-generated digest value with the self-received digest value, and determine whether the two generated digest values are the same independently.
In addition, the device M may determine whether the first digest value is identical to the second digest value based on the steps S103A-S103B shown above, and the device N may determine whether the first digest value is identical to the second digest value based on the steps S103C-S103D shown above.
The device N sends the digest value calculated by itself to the device M, and the device M receives the digest value sent by the device N, compares the digest value with the digest value generated by itself, and sends a comparison result to the device N, so that the device N can also determine the comparison result of the two digest values. Compared with the foregoing determination method, the device M does not need to send the digest value generated by itself to the device N, and can determine whether the digest values of the device N and the device N are the same by sending the digest value generated by itself to the device M, so that data transmission resources between the two parties of quantum key interaction can be saved, and the efficiency of obtaining an effective quantum key is improved.
Referring to fig. 5, a schematic flowchart of a fourth method for obtaining an effective quantum key according to an embodiment of the present invention is provided.
It can be seen from the figure that the above-mentioned method for obtaining an effective quantum key includes a quantum key distribution process and an effective quantum key obtaining process. Specifically, the quantum key distribution process is a process of exchanging quantum keys based on the BB84 protocol.
The steps performed by the key sender are to the left of the dotted line in the figure and the steps performed by the key receiver are to the right of the dotted line.
Specifically, the effective quantum key obtaining method includes the following steps B1 to B19.
Step B1: the key sender selects a basis vector.
And step B2: the key sender generates a random binary number.
And step B3: and the secret key sending party carries out light quantum modulation on the random binary number based on the selected basis vector to obtain light quantum.
And step B4: and the key sender sends the light quantum to the key receiver through the quantum channel.
And step B5: the key receiver selects a basis vector.
Step B6: the key receiver decodes the obtained light quanta based on the basis of the basis vectors.
And step B7: the key receiver obtains a binary number.
And step B8: the key sender and the key receiver interact with each other through a classical channel.
Step B9: and the key sender obtains the quantum key based on the basis of the basis vector as decoding data.
Step B10: and the key receiver obtains the quantum key based on the basis of the basis vector as decoding data.
Specifically, the aforementioned steps B1 to B10 are similar to the aforementioned quantum key interaction manner, and are not described herein again.
Step B11: the key sender calculates the digest value of the decoded data.
Step B12: the key receiver calculates a digest value of the decoded data.
Step B13: the key sender and the key receiver exchange the digest values through a classical channel.
Step B14: the key sender compares the digest values.
If the digest values are different, step B16 is performed.
Step B15: the key receiver compares the digest values.
If the digest values are different, step B17 is performed.
Step B16: and the key sender performs data grouping on the decoded data to obtain new decoded data.
And returning to execute the step B11.
Step B17: and the key receiver performs data grouping on the decoded data to obtain new decoded data.
And returning to the step B12.
And returning to the loop to execute the steps B11-B17 in an iteration mode until a preset termination condition is reached.
Step B18: the key sender obtains a valid quantum key.
Step B19: the key receiver obtains a valid quantum key.
Specifically, the steps B11 to B19 are similar to the embodiment shown in fig. 1, and are not repeated herein.
Referring to fig. 6, a schematic flow chart of a fifth effective quantum key obtaining method according to an embodiment of the present invention includes the following steps C1 to C18.
Specifically, the effective quantum key obtaining method includes a quantum key distribution process and an effective quantum key obtaining process. The quantum key distribution process is a process of exchanging quantum keys based on a BB84 protocol.
Step C1: the key sender generates a random binary number.
And step C2: and the key sender selects a basis vector for each binary bit of the random binary number and carries out light quantum modulation on the random binary number based on the basis of the basis vectors to obtain light quanta.
Step C3: and the key sender sends the light quantum to the key receiver through the quantum channel.
And C4: the key receiver selects a basis vector.
And C5: and the key receiver decodes the obtained light quanta to obtain binary number.
Step C6: the key sender and the key receiver interact with each other through a classical channel.
Step C7: and the key sender determines the binary bits with the same corresponding basis vectors as the decoded data.
Step C8: and the key receiver determines the binary bits with the same corresponding basis vectors as the decoded data.
Specifically, the foregoing steps C1 to C8 are similar to the foregoing quantum key interaction manner, and are not described herein again.
Step C9: the key sender calculates the digest value of the decoded data.
Step C10: the key receiver calculates a digest value of the decoded data.
Step C11: the key sender and the key receiver interact and compare the digest values through a classical channel.
If the digest values are different, the key sender performs steps C12-C13 and the key receiver performs steps C14-C15.
Step C12: and the key sender performs data grouping on the decoded data to obtain new decoded data.
Step C13: the key sender calculates the digest value of the newly decoded data.
Step C14: and the key receiver performs data grouping on the decoded data to obtain new decoded data.
Step C15: the key receiver calculates a digest value of the newly decoded data.
Step C16: the key sender and the key receiver interact through a classical channel and compare the new digest value.
If the digest values are different, the key sender returns to perform steps C12-C13, and the key receiver returns to perform steps C14-C15. If the digest values are the same, the key sender performs step C17, and the key receiver performs step C18.
Step C17: and the key sender keeps the decoded data with the same digest value to obtain the effective quantum key.
Step C18: and the key receiver reserves the decoded data with the same digest value to obtain the effective quantum key.
Specifically, the steps C9-C18 are similar to the embodiment shown in fig. 1, and are not repeated herein.
Corresponding to the foregoing method for obtaining an effective quantum key applied to the first interactive device, an embodiment of the present invention further provides an effective quantum key obtaining apparatus applied to the first interactive device.
Referring to fig. 7, a schematic structural diagram of an effective quantum key obtaining apparatus provided in an embodiment of the present invention is applied to each device performing quantum key interaction, where the apparatus is used as a first interaction device, and the apparatus includes:
a decoding data obtaining module 701, configured to obtain a first quantum key, where the first quantum key is used as first decoding data;
a first digest value calculation module 702, configured to calculate a first digest value of the first decoded data;
a digest value comparison module 703, configured to determine whether the first digest value is the same as a second digest value, where the second digest value is: the second interaction device calculates a digest value obtained by calculating 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 way of calculating the first digest value by the first interaction device is the same as the way of calculating the second digest value by the second interaction device, and the second quantum key is: the quantum key obtained by the second interactive device;
a target data determining module 704, configured to determine the first decoded data as the target data if the digest value comparing module 703 determines that the first digest value is the same as the second digest value;
a decoding data dividing module 705, configured to divide the first decoding data when the digest value comparison module 703 determines that the first digest value is different from the second digest value, use each divided packet data as new first decoding data, and trigger execution of the first digest value calculation module 702 for each first decoding data if a preset termination condition is not met;
an effective secret key obtaining module 706, configured to perform data combination on the determined target data if a preset termination condition is met, so as to obtain an effective quantum secret key.
As can be seen from the above, the embodiment of the present invention provides an effective quantum key obtaining method, which is applied to a first interaction device performing quantum key interaction, where the first interaction 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 interaction device on 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 indicates that the first decoded data is the same as the second decoded data, and the first decoded data may be used as the target data. Otherwise, the part of the first decoded data, which is included in the second decoded data, is described, the first decoded data may be divided to obtain new first decoded data, and whether the new first decoded data is the target data is continuously determined.
Therefore, through the embodiment of the invention, each device for quantum key interaction can obtain the same target data as the first interaction device, and then the same effective quantum key can be obtained by performing data combination based on the same target data.
In an embodiment of the present invention, the digest value comparison module 703 is specifically configured to:
receiving a second abstract value sent by second interactive equipment;
and comparing the first abstract value with the second abstract value to determine whether the first abstract value and the second abstract value are the same.
As can be seen from the above, in the embodiment of the present invention, after the second abstract value is obtained through calculation, the second interactive device may send the first abstract value to the first interactive device, and the first interactive device may compare the first abstract value with the second abstract value to determine whether the first abstract value and the second abstract value are the same.
In an embodiment of the present invention, the digest value comparison module 703 is specifically configured to:
sending a first abstract value to second interactive equipment, enabling the second interactive equipment to compare the first abstract value with a second abstract value, and feeding back a comparison result to the first interactive equipment;
determining whether the first digest value is identical to the second digest value based on the received comparison result.
As can be seen from the above, in the embodiment of the present invention, after the first interactive device calculates the first digest value, the first interactive device may send the first digest value to the second interactive device, and the second interactive device may compare the first digest value with the second digest value to determine whether the first digest value and the second digest value are the same, and feed back a comparison result to the first interactive device, so that the first interactive device determines whether the first digest value and the second digest value are the same.
In an embodiment of the present invention, the decoding data dividing module 705 is specifically configured to:
under the condition that the digest value comparison module 703 determines that the first digest value is different from the second digest value, the first decoded data is divided equally by bisection, and two divided packet data are respectively used as new first decoded data.
As can be seen from the above, in the embodiment of the present invention, two grouped data with similar binary bits are obtained by dividing in an average division manner, and then the grouped data are respectively used as new first decoding data to determine target data, so that the speed of determining the target data can be increased on the whole, and further, the speed of determining an effective quantum key can be increased.
In an embodiment of the present invention, the preset termination condition is: the length of each divided grouped data is smaller than the length of a quantum key required for encrypting the data.
Therefore, the length of the first quantum key obtained by the first interactive device is often far longer than that of the quantum key required for data encryption, and therefore the determined total length of the effective quantum key does not need to be too long to realize the subsequent data encryption process. That is, the total length of the finally determined target data does not need to be too long, and therefore it is not actually necessary to determine all the same binary bits contained in the first quantum data as the second quantum data, and it is also possible to generate a valid quantum key sufficient for use in subsequent data encryption. Therefore, in the embodiment of the present invention, the length of each divided packet data may be smaller than the length of the quantum key required for encrypting data as a termination condition for circularly determining the target data, at this time, although each divided packet data still has the same binary bit as that in the second quantum key, the total length of the obtained target data often can meet the requirement of subsequent data encryption, and at this time, stopping determining the target data may save data calculation and transmission resources of the first interactive device and the second interactive device, and improve the efficiency of obtaining an effective quantum key.
An embodiment of the present invention further provides an electronic device, as shown in fig. 8, which includes a processor 801, a communication interface 802, a memory 803, and a communication bus 804, where the processor 801, the communication interface 802, and the memory 803 complete mutual communication through the communication bus 804,
a memory 803 for storing a computer program;
the processor 801 is configured to implement the method steps shown in any one of the above-described valid quantum key obtaining methods when executing the program stored in the memory 803.
When the electronic device provided by the embodiment of the invention is applied to obtaining the effective quantum key, the embodiment of the invention provides an effective quantum key obtaining method, which is applied to a first interaction device for quantum key interaction, wherein the first interaction device calculates a first digest value of first decoded data, and compares the first digest value with a second digest value obtained by calculating second decoded data by a second interaction device. 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 indicates that the first decoded data is the same as the second decoded data, and the first decoded data may be used as the target data. Otherwise, the part of the first decoded data, which is included in the second decoded data, is described, the first decoded data may be divided to obtain new first decoded data, and whether the new first decoded data is the target data is continuously determined.
Therefore, through the embodiment of the invention, each device for quantum key interaction can obtain the same target data as the first interaction device, and then the same effective quantum key can be obtained by performing data combination based on the same target data.
The communication bus mentioned in the electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this is not intended to represent only one bus or type of bus.
The communication interface is used for communication between the electronic equipment and other equipment.
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 memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), application Specific Integrated Circuits (ASICs), field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components.
In yet another embodiment provided by the present invention, a computer-readable storage medium is further provided, in which a computer program is stored, and the computer program, when executed by a processor, implements the steps of any one of the above-mentioned effective quantum key obtaining methods.
When the computer program stored in the computer-readable storage medium 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 interaction device performing quantum key interaction, where the first interaction device calculates a first digest value of first decoded data, and compares the first digest value with a second digest value obtained by a second interaction device by calculating 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 indicates that the first decoded data is the same as the second decoded data, and the first decoded data may be used as the target data. Otherwise, the part of the first decoded data, which is included in the second decoded data, is described, the first decoded data may be divided to obtain new first decoded data, and whether the new first decoded data is the target data is continuously determined.
Therefore, through the embodiment of the invention, each device for quantum key interaction can be used as the first interaction device to obtain the same target data, and then the same effective quantum key can be obtained by performing data combination based on the same target data.
In yet another embodiment, a computer program product containing instructions is provided, which when run on a computer causes the computer to perform any one of the above-described methods for efficient quantum key derivation.
When the computer program product provided by the embodiment of the invention is applied to obtain the effective quantum key, the embodiment of the invention provides an effective quantum key obtaining method, which is applied to a first interactive device for quantum key interaction, wherein the first interactive device calculates a first digest value of first decoding data, and compares the first digest value with a second digest value obtained by calculating second decoding data by a second interactive device. 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 indicates that the first decoded data is the same as the second decoded data, and the first decoded data may be used as the target data. Otherwise, the part of the first decoded data, which is included in the second decoded data, is described, the first decoded data may be divided to obtain new first decoded data, and it is continuously determined whether the new first decoded data is the target data.
Therefore, through the embodiment of the invention, each device for quantum key interaction can obtain the same target data as the first interaction device, and then the same effective quantum key can be obtained by performing data combination based on the same target data.
In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, it may 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 loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the invention to be performed in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid State Disk (SSD)), among others.
It should be noted that, in this document, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrases "comprising a," "8230," "8230," or "comprising" does not exclude the presence of additional like elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the apparatus, the electronic device, the computer-readable storage medium, and the computer program product embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and for the relevant points, reference may be made to the partial description of the method embodiments.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

Claims (12)

1. A method for obtaining an effective quantum key is characterized in that any device for carrying out 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 comprises the following steps:
obtaining a first quantum key, and taking 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 a second digest value, wherein the second digest value is: the second interaction device calculates a digest value obtained by calculating 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 way of calculating the first digest value by the first interaction device is the same as the way of calculating the second digest value by the second interaction device, and the second quantum key is: the quantum key obtained by the second interactive device;
if the first decoding data are the same as the target data, determining the first decoding data as the target data;
if the first decoding data are different, dividing the first decoding data, taking each divided grouped data as new first decoding data respectively, and if a preset termination condition is not met, returning to the step of calculating the first abstract value of the first decoding data aiming at each first decoding data;
and if the preset termination condition is met, performing data combination on the determined target data to obtain the effective quantum key.
2. The method of claim 1, wherein determining whether the first digest value is the same as the second digest value comprises:
receiving a second abstract value sent by second interactive equipment;
and comparing the first abstract value with the second abstract value to determine whether the first abstract value and the second abstract value are the same.
3. The method of claim 1, wherein determining whether the first digest value is the same as the second digest value comprises:
sending a first abstract value to second interactive equipment, enabling the second interactive equipment to compare the first abstract value with a second abstract value, and feeding back a comparison result to the first interactive equipment;
determining whether the first digest value is identical to the second digest value based on the received comparison result.
4. The method of claim 1, wherein the dividing the first decoded data and using each divided packet data as new first decoded data respectively comprises:
and averagely dividing the first decoding data by adopting a bisection method, and respectively taking two grouped data obtained by dividing as new first decoding data.
5. The method according to any one of claims 1 to 4, wherein the preset termination condition is: the length of each divided grouped data is smaller than the length of a quantum key required for encrypting the data.
6. An apparatus 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, the apparatus comprising:
the decoding data acquisition module is used for acquiring a first quantum key and taking the first quantum key as first decoding data;
the first digest value calculation module is used for calculating a first digest value of the first decoding data;
a digest value comparison module, configured to determine whether the first digest value is the same as a second digest value, where the second digest value is: the second interaction device calculates a digest value obtained by 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 way of calculating the first digest value by the first interaction device is the same as the way of calculating the second digest value by the second interaction device, and the second quantum key is: the quantum key obtained by the second interactive device;
a target data determining module, configured to determine first decoded data as target data when the digest value comparing module determines that the first digest value is the same as the second digest value;
a decoding data dividing module, configured to divide the first decoding data when the digest value comparison module determines that the first digest value is different from the second digest value, use each divided packet data as new first decoding data, and trigger execution of the first digest value calculation module for each first decoding data if a preset termination condition is not met;
and the effective key obtaining module is used for carrying out data combination on the determined target data to obtain an effective quantum key if a preset termination condition is met.
7. The apparatus of claim 6, wherein the digest value comparison module is specifically configured to:
receiving a second abstract value sent by second interactive equipment;
and comparing the first abstract value with the second abstract value to determine whether the first abstract value and the second abstract value are the same.
8. The apparatus of claim 6, wherein the digest value comparison module is specifically configured to:
sending a first abstract value to second interactive equipment, enabling the second interactive equipment to compare the first abstract value with a second abstract value, and feeding back a comparison result to the first interactive equipment;
determining whether the first digest value is identical to the second digest value based on the received comparison result.
9. The apparatus of claim 6, wherein the decoding data partitioning module is specifically configured to:
and under the condition that the digest value comparison module determines that the first digest value is different from the second digest value, averagely dividing the first decoding data by adopting a bisection method, and respectively taking two grouped data obtained by dividing as new first decoding data.
10. The apparatus according to any one of claims 6-9, wherein the preset termination condition is: the length of each divided grouped data is smaller than the length of a quantum key required for encrypting the data.
11. An electronic device is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor and the communication interface are used for realizing mutual communication by the memory through the communication bus;
a memory for storing a computer program;
a processor for implementing the method steps of any one of claims 1 to 5 when executing a program stored in the memory.
12. A computer-readable storage medium, characterized in that a computer program is stored in the computer-readable storage medium, which computer program, when being executed by a processor, carries out the method steps of any one of the claims 1-5.
CN202210668315.8A 2022-06-14 2022-06-14 Method and device for obtaining effective quantum key Pending CN115189865A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202210668315.8A CN115189865A (en) 2022-06-14 2022-06-14 Method and device for obtaining effective quantum key
PCT/CN2022/141137 WO2023240986A1 (en) 2022-06-14 2022-12-22 Method and apparatus for obtaining effective quantum key

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210668315.8A CN115189865A (en) 2022-06-14 2022-06-14 Method and device for obtaining effective quantum key

Publications (1)

Publication Number Publication Date
CN115189865A true CN115189865A (en) 2022-10-14

Family

ID=83512913

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210668315.8A Pending CN115189865A (en) 2022-06-14 2022-06-14 Method and device for obtaining effective quantum key

Country Status (2)

Country Link
CN (1) CN115189865A (en)
WO (1) WO2023240986A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023240986A1 (en) * 2022-06-14 2023-12-21 中国电信股份有限公司 Method and apparatus for obtaining effective quantum key

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105553648B (en) * 2014-10-30 2019-10-29 阿里巴巴集团控股有限公司 Quantum key distribution, privacy amplification and data transmission method, apparatus and system
CN106301769B (en) * 2015-06-08 2020-04-10 阿里巴巴集团控股有限公司 Quantum key output method, storage consistency verification method, device and system
CN108449145B (en) * 2018-03-21 2019-03-29 广州大学 A kind of ciphertext transmission method based on quantum key
CN110011792B (en) * 2019-03-06 2021-10-26 暨南大学 Single-step quantum key distribution post-processing method, system, medium and equipment based on polar code
CN113922956A (en) * 2021-10-09 2022-01-11 天翼物联科技有限公司 Quantum key based Internet of things data interaction method, system, device and medium
CN114338005A (en) * 2021-12-24 2022-04-12 北京海泰方圆科技股份有限公司 Data transmission encryption method and device, electronic equipment and storage medium
CN115189865A (en) * 2022-06-14 2022-10-14 中国电信股份有限公司 Method and device for obtaining effective quantum key

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023240986A1 (en) * 2022-06-14 2023-12-21 中国电信股份有限公司 Method and apparatus for obtaining effective quantum key

Also Published As

Publication number Publication date
WO2023240986A1 (en) 2023-12-21

Similar Documents

Publication Publication Date Title
CN114175568B (en) Secure multiparty arrival rate and frequency estimation
CN108712261B (en) Key generation method, device and medium based on block chain
US9948460B2 (en) Multivariate cryptography based on clipped hopfield neural network
CN109947740B (en) Performance optimization method and device of block chain system
CN112560091B (en) Digital signature method, signature information verification method, related device and electronic equipment
CN112347498B (en) Encryption method, encryption device, electronic equipment and readable storage medium
Tang et al. High-speed and large-scale privacy amplification scheme for quantum key distribution
Schlegel et al. CodedPaddedFL and CodedSecAgg: Straggler mitigation and secure aggregation in federated learning
CN112637836A (en) Data processing method and device, electronic equipment and storage medium
CN115580396B (en) Tight trace query system and method
CN115189865A (en) Method and device for obtaining effective quantum key
KR20210081471A (en) Non-transitory computer-readable medium storing program code, decryption device, and communication system including encryption device and decryption device
CN111193741B (en) Information sending method, information obtaining method, device and equipment
US20220085998A1 (en) System and method to generate prime numbers in cryptographic applications
US20230396432A1 (en) Methods and systems for updatable encryption
CN116488919B (en) Data processing method, communication node and storage medium
CN110611568B (en) Dynamic encryption and decryption method, device and equipment based on multiple encryption and decryption algorithms
CN114221753B (en) Key data processing method and electronic equipment
CN116032470A (en) Data transmission system, method and device based on careless transmission protocol
CN115277684A (en) File transmission method, device, equipment and storage medium
WO2023077627A1 (en) Blockchain-based privacy protection scheme aggregation method and apparatus
US20230344628A1 (en) Secure massively parallel computation for dishonest majority
CN111953473B (en) Signal processing method and device
Nikiforov et al. Side-channel analysis of privacy amplification in postprocessing software for a quantum key distribution system
KR20220163493A (en) Apparatus and method for performing statistical calculation on homomorphic ciphertext

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination