CN108737075B - Method, device and system for generating shared key - Google Patents

Method, device and system for generating shared key Download PDF

Info

Publication number
CN108737075B
CN108737075B CN201710240078.4A CN201710240078A CN108737075B CN 108737075 B CN108737075 B CN 108737075B CN 201710240078 A CN201710240078 A CN 201710240078A CN 108737075 B CN108737075 B CN 108737075B
Authority
CN
China
Prior art keywords
network node
error rate
relay
shared data
data
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.)
Active
Application number
CN201710240078.4A
Other languages
Chinese (zh)
Other versions
CN108737075A (en
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.)
Shandong Institute Of Quantum Science And Technology Co ltd
Original Assignee
Shandong Institute Of Quantum Science And Technology Co 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 Shandong Institute Of Quantum Science And Technology Co ltd filed Critical Shandong Institute Of Quantum Science And Technology Co ltd
Priority to CN201710240078.4A priority Critical patent/CN108737075B/en
Publication of CN108737075A publication Critical patent/CN108737075A/en
Application granted granted Critical
Publication of CN108737075B publication Critical patent/CN108737075B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/085Secret sharing or secret splitting, e.g. threshold schemes
    • 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
    • H04L9/0855Quantum cryptography involving additional nodes, e.g. quantum relays, repeaters, intermediate nodes or remote nodes
    • 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
    • H04L9/0858Details about key distillation or coding, e.g. reconciliation, error correction, privacy amplification, polarisation coding or phase coding

Abstract

The embodiment of the invention provides a method, a device and a system for generating a shared key. The preset link relay node does not need to carry out privacy amplification operation, and not every relay node needs to carry out error correction operation, so that the load of the preset link relay node is reduced, and the scheme can be applied to a link with any plurality of relay network nodes, and the efficiency of network communication is improved.

Description

Method, device and system for generating shared key
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a method, an apparatus, and a system for generating a shared key.
Background
Quantum communication is a new communication technology combining quantum theory and information theory, and can realize high-performance communication by using quantum effect under physical limit. Quantum cryptography based on Quantum Key Distribution (QKD) protocols is one of the most important practical applications in Quantum communication. The quantum cryptography network is a secure communication network using quantum cryptography.
The quantum cryptography network comprises two network nodes, one is a terminal network node and the other is a relay network node, and each network node comprises a QKD device. One terminal network node may communicate cryptographically with another terminal network node via the at least one relay network node using the shared key.
The method for obtaining the shared key by the two terminal network nodes is as follows: quantum communication is carried out between every two adjacent network nodes by utilizing the respective QKD equipment to obtain quantum data shared by the two adjacent network nodes; screening the obtained shared quantum data between every two adjacent network nodes to obtain the shared data of the two adjacent network nodes, and estimating the error rate of the shared data; exchanging check information between every two adjacent network nodes, performing data error correction operation on the obtained shared data according to the check information, and performing privacy amplification operation to obtain a shared key between the two adjacent network nodes; and a link comprising the first terminal network node and the second terminal network node performs encrypted communication by using the shared key between every two adjacent network nodes in the link, and finally generates the shared keys of the first terminal network node and the second terminal network node.
In the method for generating the shared key of the two terminal nodes, check information needs to be exchanged between every two network nodes, and data error correction operation and privacy amplification operation need to be performed, so that the load of relay network nodes belonging to a plurality of different links is large, and the communication quality of the quantum cryptography network is affected.
Disclosure of Invention
The invention aims to provide a method, a device and a system for generating a shared key, thereby reducing the load of a relay network node and improving the communication quality of a quantum cryptography network.
Therefore, the technical scheme for solving the technical problem is as follows:
a method of generating a shared key, the method comprising:
a first network node encodes initial data according to a preset error correcting code to obtain relay data and check information, wherein the first network node is a terminal network node;
the first network node acquires shared data and the error rate of the shared data, wherein the shared data is the shared data of the first network node and a second network node, the first network node and the second network node are directly connected in a preset link, and the second network node is a relay network node;
the first network node encrypts the relay data by using the shared data to obtain a relay ciphertext;
the first network node transmits the relay ciphertext, the check information, the error rate of the shared data and an accumulated error rate to the second network node, wherein the accumulated error rate is the error rate of the shared data;
when receiving the privacy amplification factor sent by a third network node in the preset link, the first network node performs privacy amplification operation on the initial data according to the privacy amplification factor to obtain a shared key of the first network node and the third network node, wherein the third network node is a terminal network node.
In one example, the method further comprises:
and the first network node judges whether the error rate of the shared data is greater than a preset threshold value, if not, the first network node encrypts the relay data by using the shared data to obtain a relay ciphertext.
In one example of the above-mentioned method,
the initial data is a random number.
In one example of the above-mentioned method,
the initial data is shared data of the first network node and the second network node.
A method of generating a shared key, the method comprising:
the method comprises the steps that a second network node receives a first relay ciphertext, check information, a first accumulated bit error rate and a first bit error rate set which are sent by a first network node, wherein the first bit error rate set comprises bit error rates of all shared data which are encrypted for relay data, the first network node is a terminal network node or a relay network node, the second network node is a relay network node, and the first network node and the second network node are directly connected in a preset link;
the second network node acquires first shared data, decrypts the first relay ciphertext by using the first shared data, and acquires the relay data, wherein the first shared data is shared data of the second network node and the first network node;
the second network node acquires second shared data and the error rate of the second shared data, wherein the second shared data is shared data of the second network node and a third network node, the third network node is a relay network node or a terminal network node, and the second network node and the third network node are directly connected in the preset link;
the second network node calculates the sum of the first accumulated error rate and the error rate of the second shared data to obtain a second accumulated error rate;
the second network node obtains a second relay ciphertext and a third accumulated error rate according to the second accumulated error rate and a preset error correction threshold value and the second shared data;
and the second network node sends the second relay ciphertext, the check information, the third accumulated bit error rate and a second bit error rate set to the third network node, wherein the second bit error rate set comprises the first bit error rate set and the bit error rate of the second shared data.
In one example, the obtaining, by the second network node, a second relay ciphertext and a third cumulative error rate according to the second cumulative error rate and a preset error correction threshold by the second shared data includes:
when the second accumulated error rate is greater than the preset error correction threshold value, the second network node performs error correction operation on the relay data by using the check information, encrypts the error-corrected relay data by using the second shared data to obtain a first ciphertext, uses the first ciphertext as the second relay ciphertext, and uses the error rate of the second shared data as the third accumulated error rate.
In one example, the obtaining, by the second network node, a second relay ciphertext and a third cumulative error rate according to the second cumulative error rate and a preset error correction threshold by the second shared data includes:
and when the second accumulated bit error rate is not greater than the preset error correction threshold value, the second network node encrypts the relay data by using the second shared data to obtain a second ciphertext, the second ciphertext is used as the second relay ciphertext, and the second accumulated bit error rate is used as the third accumulated bit error rate.
A method of generating a shared key, the method comprising:
a third network node receives a relay ciphertext, check information, an accumulated bit error rate and a bit error rate set sent by a second network node, wherein the bit error rate set comprises bit error rates of shared data of all network nodes in a preset link, the third network node is a terminal network node, and the second network node is a relay network node;
the third network node acquires shared data, decrypts the relay ciphertext by using the shared data, and acquires relay data, wherein the shared data is shared data of the second network node and the third network node;
the third network node obtains initial data according to the relay data, the verification information and the accumulated bit error rate;
the third network node obtains privacy amplification times according to the bit information digits of the initial data and the bit error rate set;
the third network node sends the privacy amplification factor to a first network node, wherein the first network node is a terminal network node;
and the third network node performs privacy amplification operation on the initial data according to the privacy amplification factor to obtain a shared key of the first network node and the third network node.
In one example, the third network node obtains initial data according to the relay data, the check information, and the cumulative bit error rate by:
when the accumulated error rate is not 0, the third network node performs error correction operation on the relay data according to the check information;
and the third network node decodes the relay data subjected to error correction by adopting a preset error correcting code to obtain initial data.
In one example, the third network node obtains initial data according to the relay data, the check information, and the cumulative bit error rate by:
and when the accumulated error rate is 0, the third network node decodes the relay data by adopting a preset error correcting code to obtain initial data.
In one example, the third network node obtains the privacy amplification factor according to the bit information number of the initial data and the bit error rate set comprises:
the third network node calculates the noise entropy of the error rate of each shared data in the error rate set;
the third network node calculates the sum of the noise entropies of all the shared data as a single amount of discarded information;
the third network node calculates a difference between a total amount of bit information, which is a product of the number of bits of the initial data and the amount of 1-bit information, and a total amount of discarded information, which is a product of the number of bits of the initial data and the amount of the discarded information, as the privacy amplification factor.
A first network node for generating a shared key, the first network node being a terminal network node, the first network node being directly connected to a second network node in a predetermined link, the second network node being a relay network node, a third network node being a terminal network node, the first network node comprising:
the encoding unit is used for encoding the initial data according to a preset error correcting code to obtain relay data and check information;
an obtaining unit, configured to obtain shared data and an error rate of the shared data, where the shared data is shared data of the first network node and a second network node;
the encryption unit is used for encrypting the relay data by using the shared data to obtain a relay ciphertext;
a sending unit, configured to send the relay ciphertext, the check information, the error rate of the shared data, and an accumulated error rate to the second network node, where the accumulated error rate is the error rate of the shared data;
and the operation unit is used for performing privacy amplification operation on the initial data according to the privacy amplification factor when the privacy amplification factor sent by a third network node in the preset link is received, so as to obtain a shared key of the first network node and the third network node.
In one example, the first network node further comprises:
and the judging unit is used for judging whether the error rate of the shared data is greater than a preset threshold value, if not, the encrypting unit encrypts the relay data by using the shared data to obtain a relay ciphertext.
A second network node for generating a shared key, wherein a first network node is directly connected to the second network node in a preset link, the first network node is a terminal network node or a relay network node, the second network node is directly connected to a third network node in the preset link, the third network node is a relay network node or a terminal network node, and the second network node comprises:
the receiving unit is used for receiving a first relay ciphertext, check information, a first accumulated error rate and a first error rate set which are sent by a first network node, wherein the first error rate set comprises error rates of all shared data which are encrypted for relay data;
a first obtaining unit, configured to obtain first shared data, decrypt the first relay ciphertext by using the first shared data, and obtain the relay data, where the first shared data is shared data of the second network node and the first network node;
a second obtaining unit, configured to obtain second shared data and an error rate of the second shared data, where the second shared data is shared data of the second network node and a third network node;
the calculating unit is used for calculating the sum of the first accumulated error rate and the error rate of the second shared data to obtain a second accumulated error rate;
a third obtaining unit, configured to obtain a second relay ciphertext and a third accumulated error rate according to the second accumulated error rate and a preset error correction threshold, where the second shared data is a second relay ciphertext;
and the transmitting unit is used for transmitting the second relay ciphertext, the check information, the third accumulated bit error rate and a second bit error rate set to the third network node, wherein the second bit error rate set comprises the first bit error rate set and the bit error rate of the second shared data.
In one example of the above-mentioned method,
the third obtaining unit is further configured to, when the second accumulated bit error rate is greater than the preset error correction threshold value, perform error correction operation on the relay data by using the check information, encrypt the error-corrected relay data by using the second shared data to obtain a first ciphertext, use the first ciphertext as the second relay ciphertext, and use the bit error rate of the second shared data as the third accumulated bit error rate.
In one example of the above-mentioned method,
the third obtaining unit is further configured to, when the second accumulated bit error rate is not greater than the preset error correction threshold value, encrypt the relay data by using the second shared data to obtain a second ciphertext, use the second ciphertext as the second relay ciphertext, and use the second accumulated bit error rate as the third accumulated bit error rate.
A third network node generating a shared secret,
a second network node is directly connected to the third network node in a preset link, the second network node is a relay network node, the third network node is a terminal network node, and the third network node includes:
the receiving unit is used for receiving a relay ciphertext, check information, an accumulated bit error rate and a bit error rate set which are sent by a second network node, wherein the bit error rate set comprises bit error rates of shared data of all network nodes in a preset link;
a first obtaining unit, configured to obtain shared data, decrypt the relay ciphertext by using the shared data, and obtain relay data, where the shared data is shared data of the second network node and the third network node;
a second obtaining unit, configured to obtain initial data according to the relay data, the verification information, and the accumulated bit error rate;
the third obtaining unit is used for obtaining privacy amplification factors according to the bit information digits of the initial data and the bit error rate set;
a sending unit, configured to send the privacy amplification factor to a first network node, where the first network node is a terminal network node;
and the fourth obtaining unit is used for performing privacy amplification operation on the initial data according to the privacy amplification factor to obtain a shared key of the first network node and the third network node.
In one example of the above-mentioned method,
the second obtaining unit is further configured to perform error correction operation on the relay data according to the check information when the accumulated bit error rate is not 0; and decoding the relay data after error correction by adopting a preset error correcting code to obtain initial data.
In one example of the above-mentioned method,
the second obtaining unit is further configured to decode the relay data by using a preset error correcting code when the cumulative bit error rate is 0, so as to obtain initial data.
In one example, the third obtaining unit includes:
the first calculating subunit is used for calculating the noise entropy of the error rate of each shared data in the error rate set;
the second calculating subunit is used for calculating the sum of the noise entropies of all the shared data as the single amount of the discarded information;
and a third calculating subunit, configured to calculate, as the privacy amplification factor, a difference between a total amount of bit information, which is a product of a bit information bit number of the initial data and a 1-bit information amount, and a total amount of discarded information, which is a product of the bit information bit number of the initial data and the single amount of discarded information.
A system for generating a shared key, the system comprising:
a first network node as described above, at least a second network node as described above, and a third network node as described above.
According to the technical scheme, the invention has the following beneficial effects:
the embodiment of the invention provides a method, a device and a system for generating a shared key. The preset link relay node does not need to carry out privacy amplification operation, and not every relay node needs to carry out error correction operation, so that the load of the preset link relay node is reduced, and the scheme can be applied to a link with any plurality of relay network nodes, and the efficiency of network communication is improved.
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 for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic diagram of a quantum cryptography network structure according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating an example of a method for generating a shared secret according to an embodiment of the present invention;
FIG. 3 is a flowchart illustrating another example of a method for generating a shared secret according to an embodiment of the present invention;
FIG. 4 is a flowchart illustrating another example of a method for generating a shared secret according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a first network node for generating a shared key according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of a second network node for generating a shared key according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of a third network node for generating a shared key according to an embodiment of the present invention;
fig. 8 is a schematic structural diagram of a system for generating a shared key according to an embodiment of the present invention.
Detailed Description
In order to provide an implementation scheme for reducing the load of a relay network node, embodiments of the present invention provide a method, an apparatus, and a system for generating a shared key, and a preferred embodiment of the present invention is described below with reference to the drawings of the specification.
The structure shown in fig. 1 includes a source terminal network node, at least one relay network node, and a destination terminal network node, where the source terminal network node communicates with the destination terminal network node through the at least one relay network node, that is, a link where the source terminal network node communicates with the destination terminal network node is the preset link. The preset link can indicate not only the network nodes included in the link but also the transmission sequence of data between the network nodes in the link.
In a preset link, the QKD devices of every two adjacent network nodes obtain quantum data shared by the two adjacent network nodes through quantum communication, the obtained shared quantum data is screened between every two adjacent network nodes, the shared data of the two adjacent network nodes is obtained, and the error rate of the shared data is estimated.
And if the error rate of the shared data of the two adjacent network nodes exceeds the preset discarding error rate, the QKD devices of the two adjacent network nodes perform quantum communication, the obtained quantum data shared by the two adjacent network nodes is unavailable, the shared data of the two adjacent network nodes is deleted, and the QKD devices are reused for quantum data distribution. The preset abandoned bit error rate can be set to 11% according to the actual experience of technicians, and other specific values can be set according to the actual situation, which is not described herein again.
The error rate of the shared data of two adjacent network nodes is related to many factors such as the node distance of the two adjacent network nodes, environmental noise and the like, and the error rate of the shared data may be any value between 0 and a preset discard error rate. If the error rate of the shared data exceeds a preset threshold value, the error rate of the shared data is over large, and the error of a ciphertext obtained by encrypting the shared data is large and exceeds the error correction capability of a preset error correction code. At this time, the shared check information is interacted between the two adjacent network nodes, the shared data is subjected to error correction operation by using the shared check information, privacy amplification operation is further performed, the shared key between the two adjacent network nodes is obtained as new shared data, and the error rate of the shared data is set to be 0. The preset threshold may be set to 6% according to the actual experience of the technician, and other specific values may also be set according to the actual situation, which is not described herein again.
Before the method provided by the embodiment of the present invention is executed, the above steps are executed, and finally, the shared data of each two adjacent network nodes in the preset link and the error rate of the shared data of the two adjacent network nodes are obtained. A method for obtaining the shared key of the source terminal network node and the destination terminal network node in the preset link is described in detail below.
Fig. 2 is a flowchart of a method for generating a shared key according to an embodiment of the present invention, where the method shown in fig. 2 is implemented by using a source terminal network node in a preset link as an execution entity, and includes:
201: and the first network node encodes the initial data according to a preset error correcting code to obtain the relay data and the check information, wherein the first network node is a terminal network node.
The first network node is one of the terminating network nodes in the pre-set link, i.e. the source terminating network node shown in fig. 1. The first network node obtains an initial data, which is a source data of the generated shared key. There are two possible implementations for the first network node to obtain the initial data: in a first possible implementation manner, a true random number generator is used for generating a true random number with a preset length as the initial data; in a second possible implementation manner, the shared data of the first network node and the second network node is used as the initial data. The second network node is a relay network node directly connected with the first network node in a preset link.
The first network node obtains a preset error correction code, which can characterize the employed encoding and decoding modes and the maximum error rate that can be corrected. For example, the predetermined error correction code may be any one of a polarization code, a hamming code, a convolutional code, a BCH (Bose Ray-Chaudhuri Hocquenghem) code, a trellis code, or an RS (Reed-solomon, lee) code.
The first network node encodes initial data according to a preset error correcting code to obtain relay data and check information, and takes a polarization code as an example for explanation, a fixed bit and a bit value of the fixed bit in the polarization code are determined, the initial data is used as an information bit in the polarization code, the information bit and the fixed bit are encoded by adopting an encoding matrix of the polarization code to obtain the relay data, and position information and the bit value of the fixed bit are used as the check information. Of course, other error correcting codes can be selected according to practical application, and are not described in detail herein.
202: the method comprises the steps that a first network node obtains shared data and the error rate of the shared data, the shared data are shared data of the first network node and a second network node, the first network node and the second network node are directly connected in a preset link, and the second network node is a relay network node.
203: and the first network node encrypts the relay data by using the shared data to obtain a relay ciphertext.
As described above in detail, before the method provided by the embodiment of the present invention is executed, the quantum communication between each two adjacent network nodes in the preset link through the QKD device obtains the shared data and the error rate of the shared data. Therefore, the first network node obtains the shared data of the first network node and the second network node and the error rate of the shared data, and in the preset link, the second network node is a relay network node directly connected with the first network node.
The first network node encrypts the relay data by using the shared data of the second network node to obtain a relay ciphertext. After receiving the relay ciphertext, the second network node may decrypt the relay ciphertext using the shared data with the first network node to obtain the relay data.
The first network node and the second network node are two adjacent network nodes in a preset link, and the relay ciphertext obtained by the first network node is obtained by encrypting shared data of the first network node and the second network node but not a shared key of the first network node and the second network node. That is to say, after the first network node and the second network node obtain the shared data, the shared key of the first network node and the second network node does not need to be obtained through complicated operations.
204: and the first network node transmits the relay ciphertext, the check information, the error rate of the shared data and an accumulated error rate to a second network node, wherein the accumulated error rate is the error rate of the shared data.
And the first network node transmits the relay ciphertext, the check information, the error rate of the shared data of the first network node and the second network node and the accumulated error rate to the second network node. Because the first network node is the first network node in the preset link, the accumulated error rate is the error rate of the shared data of the first network node and the second network node.
And after receiving the relay ciphertext sent by the first network node, the second network node decrypts the relay ciphertext by using the shared data of the first network node and the second network node to obtain the relay data. The second network node may find, according to the routing table, a next hop network node directly connected to the second network node in the preset link. The second network node obtains shared data of the second network node and a next hop network node in a preset link, encrypts the relay data or the relay data after error correction by using the shared data of the second network node and the next hop network node in the preset link, and obtains another relay ciphertext to send to the next hop network node directly connected with the second network node in the preset link. According to the method, the relay data is sequentially encrypted and forwarded by each network node in the preset link until the relay data is forwarded to another terminal network node in the preset link, namely a third network node, and the whole process is the key relay.
After a third network node in a preset link obtains a relay ciphertext, the relay ciphertext is decrypted to obtain relay data, error correction operation is carried out on the relay data, the error-corrected relay data is decoded to obtain initial data, privacy amplification factor is calculated, privacy amplification operation (also called privacy amplification operation) is carried out on the initial data by utilizing the privacy amplification factor, and a shared key of the first network node and the third network node is obtained. The third network node transmits the privacy amplification to the first network node.
205: when receiving the privacy amplification factor sent by a third network node in a preset link, the first network node performs privacy amplification operation on initial data according to the privacy amplification factor to obtain a shared key of the first network node and the third network node, wherein the third network node is a terminal network node.
And when the first network node receives the privacy amplification factor sent by the third network node, the privacy amplification factor is utilized to carry out privacy amplification operation on the initial data, and a shared key of the first network node and the third network node is obtained. And the first network node and the third network node adopt the same algorithm of privacy amplification operation. There are many algorithms for the privacy amplification operation, and any one of the algorithms for the privacy amplification operation available in the prior art may be adopted, for example: the algorithm of privacy amplification operation described in the paper "research on quantum key distribution privacy amplification" (the author dubpenc swallow, 6 months 2013). Of course, other algorithms for privacy amplification operation may be adopted, and are not described in detail here.
The method shown in fig. 2 mainly describes in detail the operation method of the source terminal network node in the preset link. The following describes in detail an operation method of each relay network node in a preset link, that is, how each relay network node performs key relay on relay data.
Fig. 3 is a flowchart of a method for generating a shared key according to an embodiment of the present invention, where the method shown in fig. 3 is implemented by using a relay network node in a preset link as an execution entity, and includes:
301: the method comprises the steps that a second network node receives a first relay ciphertext, check information, a first accumulated bit error rate and a first bit error rate set which are sent by a first network node, the first bit error rate set comprises bit error rates of all shared data which are encrypted for relay data, the first network node is a terminal network node or a relay network node, the second network node is a relay network node, and the first network node and the second network node are directly connected in a preset link.
The second network node is a relay network node, the first network node is a previous hop network node directly connected with the second network node in a preset link, the first network node may be a terminal network node, and the first network node may also be a relay network node.
And the second network node receives a first relay ciphertext sent by the first network node, wherein the first relay ciphertext is a ciphertext obtained by encrypting a shared key of the first network node and the second network node. The second network node also receives a first accumulated error rate sent by the first network node, wherein the first accumulated error rate is the accumulated sum of the error rates of at least one shared data which has encrypted the relay key data.
There are three implementation scenarios for obtaining the first cumulative bit error rate:
in a first scenario, if the first network node is a terminal network node, the first cumulative error rate is an error rate of shared data of the first network node and the second network node, and the shared data of the first network node and the second network node is shared data obtained by encrypting relay data.
In a second scenario, if the first network node is a relay network node, and the source terminal network node is directly connected with the first network node in the preset link, if the error rates of the shared data of the source terminal network node and the first network node and the error rates of the shared data of the first network node and the second network node are respectively higher than a preset error correction threshold, the first accumulated error rate is the sum of the error rates of the two shared data; and if the sum of the error rates of the two shared data is greater than a preset error correction threshold value, the first accumulated error rate is the error rate of the shared data of the first network node and the second network node.
In a third scenario, if the first network node is a relay network node, and the source terminal network node is connected to the first network node via a plurality of relay network nodes in a preset link, the first cumulative bit error rate is a cumulative sum of at least one shared data that is not greater than the preset error correction threshold value and has been encrypted for the relay data recently according to a time sequence.
Since the third scenario is relatively complex, the third scenario is exemplified below. In the preset link, the relay network node a1, the relay network node a2, the relay network node A3 and the relay network node a4 are included between the source terminal network node and the first network node. The error rate of the shared data between the source terminal network node and the relay network node a1 is B1, the error rate of the shared data between the relay network node a1 and the relay network node a2 is B2, the error rate of the shared data between the relay network node a2 and the relay network node A3 is B3, the error rate of the shared data between the relay network node A3 and the relay network node a4 is B4, the error rate of the shared data between the relay network node a4 and the first network node is B5, and the error rate of the shared data between the first network node and the second network node is B6. It is assumed that the sum of B1, B2, and B3 is greater than a preset error correction threshold, the sum of B3 and B4 is greater than a preset error correction threshold, and the sum of B4, B5, and B6 is not greater than a preset error correction threshold. The cumulative error rate transmitted by the relay network node a2 to the relay network node A3 is B3, the cumulative error rate transmitted by the relay network node A3 to the relay network node a4 is B4, and the cumulative error rate transmitted by the first network node to the second network node is the sum of B4, B5 and B6.
The first set of bit error rates includes bit error rates of all shared data that has encrypted the relay data. In the first scenario, the first error rate set only includes error rates of shared data of the first network node and the second network node. In the second scenario, the first error rate set includes error rates of shared data of the source terminal network node and the first network node, and error rates of shared data of the first network node and the second network node. In the third scenario, the first error rate set includes an error rate of shared data between every two network nodes in a preset link from the source terminal network node to the second network node. I.e., the sum of B1, B2, B3, B4, B5, and B6 in the above example.
302: and the second network node acquires the first shared data, decrypts the first relay ciphertext by using the first shared data to acquire the relay data, wherein the first shared data is shared data of the second network node and the first network node.
303: the second network node acquires second shared data and the error rate of the second shared data, the second shared data is shared data of the second network node and a third network node, the third network node is a relay network node or a terminal network node, and the second network node and the third network node are directly connected in a preset link.
The second network node acquires shared data with the first network node as first shared data, the first relay ciphertext is obtained by encrypting the first shared data, and the first relay ciphertext is decrypted by using the first shared data to obtain the relay data.
The second network node obtains shared data of the second network node and the third network node as second shared data in order to forward the obtained relay data to the third network node, and obtains an error rate of the second shared data. The third network node is a network node of a next hop directly connected to the second network node in a preset link, and the third network node may be a terminal network node or a relay network node.
304: and the second network node calculates the sum of the first accumulated error rate and the error rate of the second shared data to obtain a second accumulated error rate.
305: and the second network node obtains a second relay ciphertext and a third accumulated error rate according to the second accumulated error rate, the preset error correction threshold value and the second shared data.
The second network node calculates the sum of the first accumulated error rate and the error rate of the second shared data to obtain a second accumulated error rate. And the second network node obtains a second relay ciphertext and a third accumulated error rate according to the second accumulated error rate, the preset error correction threshold value and the second shared data.
In an example, the obtaining, according to the second accumulated error rate and the preset error correction threshold, the second relay ciphertext and the third accumulated error rate by the second shared data includes:
when the second accumulated error rate is greater than the preset error correction threshold value, the second network node performs error correction operation on the relay data by using the check information, encrypts the error-corrected relay data by using the second shared data to obtain a first ciphertext, uses the first ciphertext as the second relay ciphertext, and uses the error rate of the second shared data as the third accumulated error rate.
In another example, the obtaining, by the second shared data, the second relay ciphertext and the third cumulative error rate according to the second cumulative error rate and the preset error correction threshold value includes:
and when the second accumulated bit error rate is not greater than the preset error correction threshold value, the second network node encrypts the relay data by using the second shared data to obtain a second ciphertext, the second ciphertext is used as the second relay ciphertext, and the second accumulated bit error rate is used as the third accumulated bit error rate.
The preset error correction threshold value represents the maximum error correction capability of the check information, that is, the check information can only correct errors not greater than the preset error correction threshold value. Therefore, the preset error correction threshold value cannot be smaller than the error rate of the shared data of any two adjacent network nodes in the preset link. Certainly, the preset error correction threshold cannot be set too large, and the larger the verification information is, the more the exposed relay information is, which may reduce the efficiency of the finally negotiated shared secret key. The preset error correction threshold value may be set to a value slightly larger than the maximum error rate of the shared data in the preset link. For example, the preset error correction threshold is set to 6%, that is, the error rates of the shared data of any two adjacent network nodes in the preset link are all less than 6%.
If the second accumulated error rate exceeds the preset error correction threshold value, it indicates that, after the relay data is encrypted by using the second shared data, an error in new relay data obtained after decryption by using the second shared data exceeds the error correction capability of the check information, and at this time, correct relay data cannot be obtained by error correction, and thus correct initial data cannot be obtained. At this time, before the second network node encrypts the relay data by using the second shared data, error correction operation is performed on the relay data by using the check information to obtain error-corrected relay data, where the error-corrected relay data is the relay data generated by the source terminal network node. And then, encrypting the relay data after error correction by using second shared data to obtain a first ciphertext serving as a second relay ciphertext.
If the second accumulated error rate does not exceed the preset error correction threshold value, the error in the new relay data obtained after the relay data is encrypted by using the second shared data and decrypted by using the second shared data does not exceed the error correction capability of the check information. At this time, the second network node directly encrypts the relay data by using the second shared data without performing error correction operation, and obtains a second ciphertext as a second relay ciphertext.
It can be understood that, when the second accumulated error rate exceeds the preset error correction threshold value, the second network node performs error correction operation on the relay data by using the check data to obtain error-corrected relay data, where the error-corrected relay data is the initial relay data generated by the source terminal network node, that is, the error of the error-corrected relay data is 0, and the error rate of the second shared data is taken as a third accumulated error rate. And when the second accumulated error rate does not exceed the preset error correction threshold value, the second network node does not correct the decrypted relay data, and the second accumulated error rate is used as a third accumulated error rate.
Therefore, the third cumulative bit error rate can be obtained according to the following equation:
Figure BDA0001269128440000161
306: and the second network node sends the second relay ciphertext, the check information, the third accumulated bit error rate and a second bit error rate set to a third network node, wherein the second bit error rate set comprises the first bit error rate set and the bit error rate of second shared data, and the third network node is a relay network node or a terminal network node.
And the second network node sends the second relay ciphertext, the check information, the third accumulated bit error rate and the second bit error rate set to a third network node. The second error rate set not only includes the error rates of all shared data in the first error rate set, but also includes the error rate of the second shared data.
In a preset link, each relay network node operates according to the steps from 301 to 306 to obtain relay data, and then the relay data is encrypted and forwarded to a network node of the next hop in the preset link, so that key relay of the relay data is realized. According to the process, in the preset link, each relay network node does not carry out privacy amplification operation, and each relay network node does not need to carry out error correction operation, so that the load of the relay network node is reduced.
The method shown in fig. 3 mainly describes the operation method of the preset link relay network node in detail. The operation method of the destination terminal network node in the preset link will be described in detail below.
Fig. 4 is a flowchart of a method for generating a shared key according to an embodiment of the present invention, where the method shown in fig. 4 is implemented by using a destination terminal network node in a preset link as an execution subject, and includes:
401: the third network node receives a relay ciphertext, check information, an accumulated bit error rate and a bit error rate set which are sent by the second network node, wherein the bit error rate set comprises bit error rates of shared data of all network nodes in a preset link, the third network node is a terminal network node, and the second network node is a relay network node.
402: and the third network node acquires shared data, decrypts the relay ciphertext by using the shared data to acquire the relay data, wherein the shared data is shared data of the second network node and the third network node.
The third network node is a destination terminal network node at the other end of the preset link, and the second network node is a relay network node directly connected with the third network node in the preset link, that is, the third network node is a next hop network node of the second network node in the preset link.
And after receiving the relay ciphertext, the third network node obtains shared data of the second network node and the third network node, wherein the relay ciphertext is a ciphertext obtained by encrypting the relay ciphertext by using the shared data by the second network node, and then the relay ciphertext is decrypted by using the shared data to obtain the relay data.
403: and the third network node acquires initial data according to the relay data, the check information and the accumulated bit error rate.
In one example, the third network node obtains initial data according to the relay data, the check information, and the cumulative bit error rate by:
when the accumulated error rate is not 0, the third network node performs error correction operation on the relay data according to the check information;
and the third network node decodes the relay data subjected to error correction by adopting a preset error correcting code to obtain initial data.
In another example, the third network node obtains initial data according to the relay data, the check information, and the accumulated bit error rate includes:
and when the accumulated error rate is 0, the third network node decodes the relay data by adopting a preset error correcting code to obtain initial data.
The third network node determines whether the cumulative bit error rate is 0.
And when the accumulated error rate is not 0, indicating that the relay data has errors, and performing error correction operation on the relay data by using the check information by the third network node to obtain error-corrected relay data, wherein the error-corrected relay data is the relay data generated by the source terminal network node. And the third network node decodes the relay data after error correction according to a preset error correcting code to obtain initial data.
When the cumulative error rate is 0, it indicates that there is no error in the relay data, and the relay data is the relay data generated by the source terminal network node. And the third network node directly decodes the relay data according to a preset error correcting code to obtain initial data.
404: and the third network node acquires privacy amplification factors according to the bit information digits and the bit error rate set of the initial data.
In one example, the third network node obtains the privacy amplification factor according to the bit information number of the initial data and the bit error rate set comprises:
the third network node calculates the noise entropy of the error rate of each shared data in the error rate set;
the third network node calculates the sum of the noise entropies of all the shared data as a single amount of discarded information;
and the third network node calculates the difference between the total bit information and the total discarded information as the privacy amplification factor, wherein the total bit information is the product of the bit information digit of the initial data and the 1-bit information, and the total discarded information is the product of the bit information digit of the initial data and the single discarded information.
And the third network node obtains the bit information number of the initial data, and if each bit information bit in the initial data contains 1 bit information quantity, the total bit information quantity contained in the initial data is the product of the bit information number of the initial data and the 1 bit information quantity.
The error rate set comprises the error rates of shared data of all adjacent two network nodes in a preset link. The third network node calculates a noise entropy of the error rate of each shared data in the error rate set. The third network node calculates the sum of the noise entropies of all shared data as a single amount of discard information, which represents the amount of bit information that 1 bit of information needs to be discarded. The total amount of the discarded information to be discarded in the original data is the product of the bit information number of the original data and the single amount of the discarded information.
The privacy amplification factor is the difference between the total amount of bit information contained in the original data and the total amount of discarded information of the original data.
For example, the following steps are carried out: setting the error rate of any one shared data in the error rate set as PiI is 1, 2, 3,4, …, n, i is the number of the error rate of the shared data, and n is the number of the error rate of the shared data. I.e. the bit error rate of any one shared data has a noise entropy of h (P)i) Then the rejection information unit is the sum of the noise entropies of all the shared data
Figure BDA0001269128440000191
I.e. 1 bit of information needs to be discarded
Figure BDA0001269128440000192
Amount of bit information. The bit information bit number of the initial data is k, assuming that each bit information bit in the initial data contains 1 bit information quantity, the total bit information quantity contained in the initial data is k bit information quantity, and the total discarded information quantity contained in the initial data is k bit information quantity
Figure BDA0001269128440000193
Thus, the privacy magnification is
Figure BDA0001269128440000194
405: the third network node sends the privacy amplification factor to the first network node, which is a terminal network node.
406: and the third network node performs privacy amplification operation on the initial data according to the privacy amplification factor to obtain a shared key of the first network node and the third network node.
The third network node sends the privacy amplification factor to a first network node, wherein the first network node is a source terminal network node in a preset link. And the third network node performs privacy amplification operation on the initial data according to the privacy amplification factor to obtain a shared key of the first network node and the third network node. And the first network node also performs privacy amplification operation on the initial data according to the privacy amplification factor to obtain a shared key of the first network node and the third network node. The first network node and the third network node adopt the same privacy amplification operation method, so that the first network node and the third network node can obtain the same shared secret key. The first network node and the third network node perform encrypted communication using the shared key.
In the prior art, after obtaining shared data, each two adjacent network nodes interact with shared check information, perform error correction operation on the shared data by using the shared check information, then perform privacy amplification operation, finally obtain shared keys of the two adjacent network nodes, and encrypt the shared keys by using the shared keys. However, this causes a large load on relay network nodes belonging to a plurality of links among the preset links.
In the embodiment of the invention, in the preset link, after the shared data of the two adjacent network nodes is obtained between the two adjacent network nodes, the shared key is obtained without error correction operation and privacy amplification operation, and the shared data of the two adjacent network nodes is directly used for encryption. Therefore, in the preset link, the relay node does not need to perform privacy amplification operation, and not every relay node needs to perform error correction operation, so that the load of the relay node in the preset link is reduced.
It should be noted that, although the method shown in fig. 2, the method shown in fig. 3, and the method shown in fig. 4 are logically related to each other, each method is independent from each other in terms of nomenclature, and even if the same name is used, the specific content represented by the method is not necessarily the same in nature, and the specific description in the description of the method controls.
Fig. 5 is a schematic structural diagram of a first network node for generating a shared key according to an embodiment of the present invention, where the first network node is a terminal network node, the first network node is directly connected to a second network node in a preset link, the second network node is a relay network node, a third network node is a terminal network node, and the first network node includes:
the encoding unit 501 is configured to encode the initial data according to a preset error correction code, so as to obtain the relay data and the check information.
An obtaining unit 502, configured to obtain shared data and an error rate of the shared data, where the shared data is shared data of the first network node and a second network node.
An encrypting unit 503, configured to encrypt the relay data by using the shared data to obtain a relay ciphertext.
A sending unit 504, configured to send the relay ciphertext, the check information, the error rate of the shared data, and an accumulated error rate to the second network node, where the accumulated error rate is the error rate of the shared data.
And an operation unit 505, configured to, when receiving the privacy amplification factor sent by a third network node in the preset link, perform privacy amplification operation on the initial data according to the privacy amplification factor, to obtain a shared key of the first network node and the third network node.
In one example, the first network node further comprises:
a determining unit, configured to determine whether an error rate of the shared data is greater than a preset threshold, if not, the encrypting unit 503 encrypts the relay data by using the shared data to obtain a relay ciphertext.
The first network node shown in fig. 5 is a network node corresponding to the method shown in fig. 2, and the specific implementation manner is similar to the method shown in fig. 2, and reference is made to the description of the method shown in fig. 2, which is not described herein again.
Fig. 6 is a schematic structural diagram of a second network node for generating a shared key according to an embodiment of the present invention, where a first network node is directly connected to the second network node in a preset link, the first network node is a terminal network node or a relay network node, the second network node is directly connected to a third network node in the preset link, the third network node is a relay network node or a terminal network node, and the second network node includes:
the receiving unit 601 is configured to receive a first relay ciphertext, check information, a first cumulative error rate, and a first error rate set sent by a first network node, where the first error rate set includes error rates of all shared data encrypted for relay data.
A first obtaining unit 602, configured to obtain first shared data, and decrypt the first relay ciphertext by using the first shared data to obtain the relay data, where the first shared data is shared data of the second network node and the first network node.
A second obtaining unit 603, configured to obtain second shared data and an error rate of the second shared data, where the second shared data is shared data of the second network node and a third network node.
The calculating unit 604 is configured to calculate a sum of the first cumulative bit error rate and the bit error rate of the second shared data, so as to obtain a second cumulative bit error rate.
A third obtaining unit 605, configured to obtain a second relay ciphertext and a third accumulated error rate according to the second accumulated error rate and a preset error correction threshold, where the second shared data is a second relay ciphertext and a third accumulated error rate.
A sending unit 606, configured to send the second relay ciphertext, the check information, the third cumulative bit error rate, and a second bit error rate set to the third network node, where the second bit error rate set includes the first bit error rate set and the bit error rate of the second shared data.
In an example, the third obtaining unit 605 is further configured to, when the second cumulative bit error rate is greater than the preset error correction threshold value, perform error correction operation on the relay data by using the check information, encrypt the error-corrected relay data by using the second shared data to obtain a first ciphertext, use the first ciphertext as the second relay ciphertext, and use the bit error rate of the second shared data as the third cumulative bit error rate.
In an example, the third obtaining unit 605 is further configured to, when the second cumulative bit error rate is not greater than the preset error correction threshold, encrypt the relay data by using the second shared data to obtain a second ciphertext, use the second ciphertext as the second relay ciphertext, and use the second cumulative bit error rate as the third cumulative bit error rate.
The first network node shown in fig. 6 is a network node corresponding to the method shown in fig. 3, and the specific implementation manner is similar to the method shown in fig. 3, and reference is made to the description of the method shown in fig. 3, which is not described herein again.
Fig. 7 is a schematic structural diagram of a third network node for generating a shared key according to an embodiment of the present invention, where the second network node is directly connected to the third network node in a preset link, the second network node is a relay network node, the third network node is a terminal network node, and the third network node includes:
the receiving unit 701 is configured to receive a relay ciphertext, check information, an accumulated bit error rate, and a bit error rate set sent by a second network node, where the bit error rate set includes bit error rates of shared data of all network nodes in a preset link.
A first obtaining unit 702, configured to obtain shared data, and decrypt the relay ciphertext by using the shared data to obtain relay data, where the shared data is shared data of the second network node and the third network node.
A second obtaining unit 703 is configured to obtain initial data according to the relay data, the verification information, and the accumulated bit error rate.
A third obtaining unit 704, configured to obtain a privacy amplification factor according to the bit information bit number of the initial data and the bit error rate set.
A sending unit 705, configured to send the privacy amplification factor to a first network node, where the first network node is a terminal network node.
A fourth obtaining unit 706, configured to perform privacy amplification operation on the initial data according to the privacy amplification factor, so as to obtain a shared key of the first network node and the third network node.
In an example, the second obtaining unit 703 is further configured to perform error correction operation on the relay data according to the check information when the cumulative bit error rate is not 0; and decoding the relay data after error correction by adopting a preset error correcting code to obtain initial data.
In an example, the second obtaining unit 703 is further configured to, when the cumulative bit error rate is 0, decode the relay data by using a preset error correcting code to obtain initial data.
In one example, the third obtaining unit 704 includes:
the first calculating subunit is used for calculating the noise entropy of the error rate of each shared data in the error rate set;
the second calculating subunit is used for calculating the sum of the noise entropies of all the shared data as the single amount of the discarded information;
and a third calculating subunit, configured to calculate, as the privacy amplification factor, a difference between a total amount of bit information, which is a product of a bit information bit number of the initial data and a 1-bit information amount, and a total amount of discarded information, which is a product of the bit information bit number of the initial data and the single amount of discarded information.
The first network node shown in fig. 7 is a network node corresponding to the method shown in fig. 4, and the specific implementation manner is similar to the method shown in fig. 4, and reference is made to the description of the method shown in fig. 4, which is not described herein again.
Fig. 8 is a schematic structural diagram of a system for generating a shared key according to an embodiment of the present invention, where the system includes:
a first network node 801 as shown in fig. 5, at least a second network node 802 as shown in fig. 6, and a third network node 803 as shown in fig. 7.
The foregoing is only a preferred embodiment of the present invention, and it should be noted that those skilled in the art can make various improvements and modifications without departing from the principle of the present invention, and these improvements and modifications should also be construed as the protection scope of the present invention.

Claims (21)

1. A method of generating a shared key, the method comprising:
a first network node encodes initial data according to a preset error correcting code to obtain relay data and check information, wherein the first network node is a terminal network node;
the first network node acquires shared data and the error rate of the shared data, wherein the shared data is the shared data of the first network node and a second network node, the first network node and the second network node are directly connected in a preset link, and the second network node is a relay network node;
the first network node encrypts the relay data by using the shared data to obtain a relay ciphertext;
the first network node sends the relay ciphertext, the check information, the error rate of the shared data and an accumulated error rate to the second network node, so that the second network node decrypts the relay ciphertext by using the shared data after acquiring the shared data to acquire the relay data, and calculates the sum of the accumulated error rate and the error rate of the second shared data after acquiring the second shared data and the error rate of the second shared data to acquire a second accumulated error rate; obtaining a second relay ciphertext and a third accumulated bit error rate according to the second accumulated bit error rate, a preset error correction threshold value and the second shared data, so as to send the second relay ciphertext, the check information, the third accumulated bit error rate, the bit error rate of the shared data and the bit error rate of the second shared data to a third network node or a next relay network node; wherein, when the first network node is a source terminal network node in the preset link, the accumulated bit error rate is a bit error rate of the shared data; when the second shared data is shared data of the second network node and the third network node is directly connected with the second network node in the preset link, the second network node sends the second relay ciphertext, the check information, the third accumulated error rate, the error rate of the shared data and the error rate of the second shared data to the third network node; when the second shared data is shared data between the second network node and the next relay network node is directly connected with the second network node in the preset link, the second network node sends the second relay ciphertext, the check information, the third accumulated error rate, the error rate of the shared data and the error rate of the second shared data to the next relay network node;
when receiving the privacy amplification factor sent by a third network node in the preset link, the first network node performs privacy amplification operation on the initial data according to the privacy amplification factor to obtain a shared key of the first network node and the third network node, wherein the third network node is a terminal network node.
2. The method of claim 1, further comprising:
and the first network node judges whether the error rate of the shared data is greater than a preset threshold value, if not, the first network node encrypts the relay data by using the shared data to obtain a relay ciphertext.
3. The method according to any one of claims 1 to 2,
the initial data is a random number.
4. The method according to any one of claims 1 to 2,
the initial data is shared data of the first network node and the second network node.
5. A method of generating a shared key, the method comprising:
the method comprises the steps that a second network node receives a first relay ciphertext, check information, a first accumulated bit error rate and a first bit error rate set which are sent by a first network node, wherein the first bit error rate set comprises bit error rates of all shared data which are encrypted for relay data, the first network node is a terminal network node or a relay network node, the second network node is a relay network node, and the first network node and the second network node are directly connected in a preset link; the first cumulative bit error rate is the cumulative sum of the bit error rates of at least one shared data encrypted for the relay data;
the second network node acquires first shared data, decrypts the first relay ciphertext by using the first shared data, and acquires the relay data, wherein the first shared data is shared data of the second network node and the first network node;
the second network node acquires second shared data and the error rate of the second shared data, wherein the second shared data is shared data of the second network node and a third network node, the third network node is a relay network node or a terminal network node, and the second network node and the third network node are directly connected in the preset link;
the second network node calculates the sum of the first accumulated error rate and the error rate of the second shared data to obtain a second accumulated error rate;
the second network node obtains a second relay ciphertext and a third accumulated error rate according to the second accumulated error rate and a preset error correction threshold value and the second shared data;
and the second network node sends the second relay ciphertext, the check information, the third accumulated bit error rate and a second bit error rate set to the third network node, wherein the second bit error rate set comprises the first bit error rate set and the bit error rate of the second shared data.
6. The method of claim 5, wherein the second network node obtains a second relay ciphertext and a third cumulative error rate according to the second cumulative error rate and a preset error correction threshold, and the second shared data comprises:
when the second accumulated error rate is greater than the preset error correction threshold value, the second network node performs error correction operation on the relay data by using the check information, encrypts the error-corrected relay data by using the second shared data to obtain a first ciphertext, uses the first ciphertext as the second relay ciphertext, and uses the error rate of the second shared data as the third accumulated error rate.
7. The method of claim 5, wherein the second network node obtains a second relay ciphertext and a third cumulative error rate according to the second cumulative error rate and a preset error correction threshold, and the second shared data comprises:
and when the second accumulated bit error rate is not greater than the preset error correction threshold value, the second network node encrypts the relay data by using the second shared data to obtain a second ciphertext, the second ciphertext is used as the second relay ciphertext, and the second accumulated bit error rate is used as the third accumulated bit error rate.
8. A method of generating a shared key, the method comprising:
the third network node receives the relay ciphertext, the check information, the accumulated bit error rate and the bit error rate set sent by the second network node; the error rate set comprises error rates of shared data of all network nodes in a preset link, the third network node is a terminal network node, and the second network node is a relay network node; when the error rate set is a second error rate set, the accumulated error rate is a third accumulated error rate, and the relay ciphertext is a second relay ciphertext, the second network node is configured to receive a first relay ciphertext, check information, a first accumulated error rate and a first error rate set, which are sent by a first network node, where the first error rate set includes error rates of all shared data encrypted for the relay data, the first network node is a terminal network node or a relay network node, and the first network node and the second network node are directly connected in a preset link; the first cumulative bit error rate is the cumulative sum of the bit error rates of at least one shared data encrypted for the relay data; the second network node acquires first shared data, decrypts the first relay ciphertext by using the first shared data, and acquires the relay data, wherein the first shared data is shared data of the second network node and the first network node; the second network node acquires second shared data and the error rate of the second shared data, wherein the second shared data is shared data of the second network node and a third network node, and the second network node and the third network node are directly connected in the preset link; the second network node calculates the sum of the first accumulated error rate and the error rate of the second shared data to obtain a second accumulated error rate; the second network node obtains a second relay ciphertext and a third accumulated error rate according to the second accumulated error rate and a preset error correction threshold value and the second shared data; the second network node sends the second relay ciphertext, the check information, the third accumulated bit error rate and a second bit error rate set to the third network node, wherein the second bit error rate set comprises the first bit error rate set and the bit error rate of the second shared data;
the third network node acquires shared data, decrypts the relay ciphertext by using the shared data, and acquires relay data, wherein the shared data is shared data of the second network node and the third network node;
the third network node obtains initial data according to the relay data, the verification information and the accumulated bit error rate;
the third network node obtains privacy amplification times according to the bit information digits of the initial data and the bit error rate set;
the third network node sends the privacy amplification factor to a first network node, wherein the first network node is a terminal network node;
and the third network node performs privacy amplification operation on the initial data according to the privacy amplification factor to obtain a shared key of the first network node and the third network node.
9. The method of claim 8, wherein the third network node obtaining initial data according to the relay data, the check information, and the cumulative bit error rate comprises:
when the accumulated error rate is not 0, the third network node performs error correction operation on the relay data according to the check information;
and the third network node decodes the relay data subjected to error correction by adopting a preset error correcting code to obtain initial data.
10. The method of claim 8, wherein the third network node obtaining initial data according to the relay data, the check information, and the cumulative bit error rate comprises:
and when the accumulated error rate is 0, the third network node decodes the relay data by adopting a preset error correcting code to obtain initial data.
11. The method according to any of claims 8-10, wherein the third network node obtains a privacy amplification factor according to the bit information bits of the initial data, and wherein the obtaining, by the set of bit error rates, comprises:
the third network node calculates the noise entropy of the error rate of each shared data in the error rate set;
the third network node calculates the sum of the noise entropies of all the shared data as a single amount of discarded information;
the third network node calculates a difference between a total amount of bit information, which is a product of the number of bits of the initial data and the amount of 1-bit information, and a total amount of discarded information, which is a product of the number of bits of the initial data and the amount of the discarded information, as the privacy amplification factor.
12. A first network node for generating a shared key, characterized in that,
the first network node is a terminal network node, the first network node is directly connected with a second network node in a preset link, the second network node is a relay network node, a third network node is a terminal network node, and the first network node comprises:
the encoding unit is used for encoding the initial data according to a preset error correcting code to obtain relay data and check information;
an obtaining unit, configured to obtain shared data and an error rate of the shared data, where the shared data is shared data of the first network node and a second network node;
the encryption unit is used for encrypting the relay data by using the shared data to obtain a relay ciphertext;
a sending unit, configured to send the relay ciphertext, the check information, the error rate of the shared data, and an accumulated error rate to the second network node, so that the second network node decrypts the relay ciphertext by using the shared data after acquiring the shared data, acquires the relay data, and calculates a sum of the accumulated error rate and the error rate of the second shared data after acquiring the second shared data and the error rate of the second shared data, to acquire a second accumulated error rate; obtaining a second relay ciphertext and a third accumulated bit error rate according to the second accumulated bit error rate, a preset error correction threshold value and the second shared data, so as to send the second relay ciphertext, the check information, the third accumulated bit error rate, the bit error rate of the shared data and the bit error rate of the second shared data to a third network node or a next relay network node; wherein, when the first network node is a source terminal network node in the preset link, the accumulated bit error rate is a bit error rate of the shared data; when the second shared data is shared data of the second network node and the third network node is directly connected with the second network node in the preset link, the second network node sends the second relay ciphertext, the check information, the third accumulated error rate, the error rate of the shared data and the error rate of the second shared data to the third network node; when the second shared data is shared data between the second network node and the next relay network node is directly connected with the second network node in the preset link, the second network node sends the second relay ciphertext, the check information, the third accumulated error rate, the error rate of the shared data and the error rate of the second shared data to the next relay network node;
and the operation unit is used for performing privacy amplification operation on the initial data according to the privacy amplification factor when the privacy amplification factor sent by a third network node in the preset link is received, so as to obtain a shared key of the first network node and the third network node.
13. The first network node of claim 12, wherein the first network node further comprises:
and the judging unit is used for judging whether the error rate of the shared data is greater than a preset threshold value, if not, the encrypting unit encrypts the relay data by using the shared data to obtain a relay ciphertext.
14. A second network node for generating a shared secret, characterized in that,
a first network node and the second network node are directly connected in a preset link, the first network node is a terminal network node or a relay network node, the second network node is a relay network node, the second network node and a third network node are directly connected in the preset link, the third network node is a relay network node or a terminal network node, and the second network node comprises:
the receiving unit is used for receiving a first relay ciphertext, check information, a first accumulated error rate and a first error rate set which are sent by a first network node, wherein the first error rate set comprises error rates of all shared data which are encrypted for relay data; the first cumulative bit error rate is the cumulative sum of the bit error rates of at least one shared data encrypted for the relay data;
a first obtaining unit, configured to obtain first shared data, decrypt the first relay ciphertext by using the first shared data, and obtain the relay data, where the first shared data is shared data of the second network node and the first network node;
a second obtaining unit, configured to obtain second shared data and an error rate of the second shared data, where the second shared data is shared data of the second network node and a third network node;
the calculating unit is used for calculating the sum of the first accumulated error rate and the error rate of the second shared data to obtain a second accumulated error rate;
a third obtaining unit, configured to obtain a second relay ciphertext and a third accumulated error rate according to the second accumulated error rate and a preset error correction threshold, where the second shared data is a second relay ciphertext;
and the transmitting unit is used for transmitting the second relay ciphertext, the check information, the third accumulated bit error rate and a second bit error rate set to the third network node, wherein the second bit error rate set comprises the first bit error rate set and the bit error rate of the second shared data.
15. The second network node of claim 14,
the third obtaining unit is further configured to, when the second accumulated bit error rate is greater than the preset error correction threshold value, perform error correction operation on the relay data by using the check information, encrypt the error-corrected relay data by using the second shared data to obtain a first ciphertext, use the first ciphertext as the second relay ciphertext, and use the bit error rate of the second shared data as the third accumulated bit error rate.
16. The second network node of claim 14,
the third obtaining unit is further configured to, when the second accumulated bit error rate is not greater than the preset error correction threshold value, encrypt the relay data by using the second shared data to obtain a second ciphertext, use the second ciphertext as the second relay ciphertext, and use the second accumulated bit error rate as the third accumulated bit error rate.
17. A third network node for generating a shared secret, characterized in that,
a second network node is directly connected to the third network node in a preset link, the second network node is a relay network node, the third network node is a terminal network node, and the third network node includes:
the receiving unit is used for receiving the relay ciphertext, the check information, the accumulated bit error rate and the bit error rate set sent by the second network node; the error rate set comprises error rates of shared data of all network nodes in a preset link; when the error rate set is a second error rate set, the accumulated error rate is a third accumulated error rate, and the relay ciphertext is a second relay ciphertext, the second network node is configured to receive a first relay ciphertext, check information, a first accumulated error rate and a first error rate set, which are sent by a first network node, where the first error rate set includes error rates of all shared data encrypted for the relay data, the first network node is a terminal network node or a relay network node, and the first network node and the second network node are directly connected in a preset link; the first cumulative bit error rate is the cumulative sum of the bit error rates of at least one shared data encrypted for the relay data; the second network node acquires first shared data, decrypts the first relay ciphertext by using the first shared data, and acquires the relay data, wherein the first shared data is shared data of the second network node and the first network node; the second network node acquires second shared data and the error rate of the second shared data, wherein the second shared data is shared data of the second network node and a third network node, and the second network node and the third network node are directly connected in the preset link; the second network node calculates the sum of the first accumulated error rate and the error rate of the second shared data to obtain a second accumulated error rate; the second network node obtains a second relay ciphertext and a third accumulated error rate according to the second accumulated error rate and a preset error correction threshold value and the second shared data; the second network node sends the second relay ciphertext, the check information, the third accumulated bit error rate and a second bit error rate set to the third network node, wherein the second bit error rate set comprises the first bit error rate set and the bit error rate of the second shared data;
a first obtaining unit, configured to obtain shared data, decrypt the relay ciphertext by using the shared data, and obtain relay data, where the shared data is shared data of the second network node and the third network node;
a second obtaining unit, configured to obtain initial data according to the relay data, the verification information, and the accumulated bit error rate;
the third obtaining unit is used for obtaining privacy amplification factors according to the bit information digits of the initial data and the bit error rate set;
a sending unit, configured to send the privacy amplification factor to a first network node, where the first network node is a terminal network node;
and the fourth obtaining unit is used for performing privacy amplification operation on the initial data according to the privacy amplification factor to obtain a shared key of the first network node and the third network node.
18. The third network node of claim 17,
the second obtaining unit is further configured to perform error correction operation on the relay data according to the check information when the accumulated bit error rate is not 0; and decoding the relay data after error correction by adopting a preset error correcting code to obtain initial data.
19. The third network node of claim 17,
the second obtaining unit is further configured to decode the relay data by using a preset error correcting code when the cumulative bit error rate is 0, so as to obtain initial data.
20. The third network node according to any of claims 17-19, wherein the third obtaining unit comprises:
the first calculating subunit is used for calculating the noise entropy of the error rate of each shared data in the error rate set;
the second calculating subunit is used for calculating the sum of the noise entropies of all the shared data as the single amount of the discarded information;
and a third calculating subunit, configured to calculate, as the privacy amplification factor, a difference between a total amount of bit information, which is a product of a bit information bit number of the initial data and a 1-bit information amount, and a total amount of discarded information, which is a product of the bit information bit number of the initial data and the single amount of discarded information.
21. A system for generating a shared key, the system comprising:
a first network node according to any of the claims 12-13, at least a second network node according to any of the claims 14-16, and a third network node according to any of the claims 17-20.
CN201710240078.4A 2017-04-13 2017-04-13 Method, device and system for generating shared key Active CN108737075B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710240078.4A CN108737075B (en) 2017-04-13 2017-04-13 Method, device and system for generating shared key

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710240078.4A CN108737075B (en) 2017-04-13 2017-04-13 Method, device and system for generating shared key

Publications (2)

Publication Number Publication Date
CN108737075A CN108737075A (en) 2018-11-02
CN108737075B true CN108737075B (en) 2021-03-30

Family

ID=63923731

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710240078.4A Active CN108737075B (en) 2017-04-13 2017-04-13 Method, device and system for generating shared key

Country Status (1)

Country Link
CN (1) CN108737075B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109547118B (en) * 2018-12-03 2020-09-25 北京捷安通科技有限公司 Method for data transmission by using near-noise bit and client

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101888358A (en) * 2010-07-15 2010-11-17 华中科技大学 Transmission method for reducing computational complexity of two-way relay nodes based on network coding

Family Cites Families (2)

* 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
CN106161012B (en) * 2016-08-26 2019-07-19 暨南大学 A kind of quantum key distribution after-treatment system and method based on polarization code error correction

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101888358A (en) * 2010-07-15 2010-11-17 华中科技大学 Transmission method for reducing computational complexity of two-way relay nodes based on network coding

Also Published As

Publication number Publication date
CN108737075A (en) 2018-11-02

Similar Documents

Publication Publication Date Title
US9503257B2 (en) Quantum key distribution device, quantum key distribution system, and quantum key distribution method
JP5564434B2 (en) Methods and entities for probabilistic symmetric encryption
EP2556613B1 (en) Processing transport packets
JP4885960B2 (en) Secret communication method and secret communication device
US8347084B2 (en) Information transmission security method
JP4346929B2 (en) Quantum key distribution method and communication apparatus
JP5871142B2 (en) Communication device and encryption key generation method in encryption key sharing system
JP4554523B2 (en) Quantum key distribution method and communication apparatus
US10623187B2 (en) Generating cryptographic checksums
JP2016513825A (en) Safety communication method and apparatus
EP0511420A1 (en) A cryptographic system based on information difference
CN112715016B (en) Key Encapsulation Protocol
CN114244507B (en) Quantum direct communication method, device, equipment and system based on single-path transmission
JP2017524291A (en) Cryptographic checksum generation
US7260222B2 (en) Shared data refining device and shared data refining method
JP2011254459A (en) Method for safely transmitting packet for wireless remote communication system
CN108737075B (en) Method, device and system for generating shared key
US11196447B2 (en) Computer-implemented method for error-correction-encoding and encrypting of a file
RU2481715C1 (en) Method for block encryption of messages and transmission of encrypted data with closed key
NL9202284A (en) Block encryption based on algebraic encoding methods.
JP2006054638A (en) Quantum key delivering method and communication apparatus
WO2018092313A1 (en) Communication device, communication system and communication method
JPS6129234A (en) Encipherment system
JPH11327436A (en) Ciphering device

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
GR01 Patent grant
GR01 Patent grant