Quantum key distribution method and device, and storage medium
11595196 · 2023-02-28
Assignee
Inventors
Cpc classification
H04L9/0855
ELECTRICITY
H04L9/0819
ELECTRICITY
H04L9/12
ELECTRICITY
H04L9/083
ELECTRICITY
G06N10/00
PHYSICS
H04L9/0866
ELECTRICITY
H04L9/0618
ELECTRICITY
H04L63/06
ELECTRICITY
H04L63/18
ELECTRICITY
H04L9/0894
ELECTRICITY
International classification
H04L9/08
ELECTRICITY
G06N10/00
PHYSICS
Abstract
This application provide quantum key distribution methods, devices, and storage media. In an implementation, a method comprises: determining, based on a first mapping, a first quantum key of N first quantum keys corresponding to an i.sup.th node on a target routing path; determining, based on a second mapping, a second quantum key of N second quantum keys corresponding to the i.sup.th node; and generating, by the i.sup.th node based on the first quantum key corresponding to the i.sup.th node and the second quantum key corresponding to the i.sup.th node, a third quantum key corresponding to the i.sup.th node on the target routing path.
Claims
1. A method for quantum key distribution, comprising: determining, by an i.sup.th node on a target routing path and based on a first mapping, a first quantum key of N first quantum keys corresponding to the i.sup.th node, wherein the first quantum key is obtained by the i.sup.th node for sharing between the i.sup.th node and an (i−1).sup.th node on the target routing path, the first mapping comprises N one-to-one correspondences between N routing paths passing through the i.sup.th node and the N first quantum keys, the target routing path is comprised in the N routing paths; determining, by the i.sup.th node based on a second mapping, a second quantum key of N second quantum keys corresponding to the i.sup.th node, wherein the second quantum key corresponding to the i.sup.th node on the target routing path is obtained by the i.sup.th node for sharing between the i.sup.th node and an (i+1).sup.th node on the target routing path, the second mapping comprises N one-to-one correspondences between the N routing paths passing through the i.sup.th node and the N second quantum keys; generating, by the i.sup.th node based on the first quantum key corresponding to the i.sup.th node and the second quantum key corresponding to the i.sup.th node, a third quantum key corresponding to the i.sup.th node on the target routing path; encrypting, by the i.sup.th node by using the third quantum key, a first ciphertext received from the (i−1).sup.th node to obtain a second ciphertext; and sending, by the i.sup.th node, the second ciphertext corresponding to the i.sup.th node to the (i+1).sup.th node, wherein the first ciphertext is the second ciphertext sent by and corresponding to the (i−1).sup.th node, and when i=1, a 0th node is a source node on the target routing path, and the second ciphertext corresponding to the 0.sup.th node is obtained by encrypting a quantum key to be shared between the source node and a destination node on the target routing path by using a second quantum key of the N second quantum keys corresponding to the source node, wherein a second quantum key of the N second quantum keys corresponding to the (i−1).sup.th node is same as the first quantum key corresponding to the i.sup.th node, and the second quantum key corresponding to the i.sup.th node is same as a first quantum key corresponding to the (i+1).sup.th node.
2. The method according to claim 1, further comprises sending, by the i.sup.th node, the third quantum key to a destination node on the target routing path.
3. The method according to claim 1, wherein the first quantum key is further determined based on a ranking of the N routing paths, and wherein the ranking of the N routing paths is determined by the i.sup.th node based on one or more of (1) a ranking relationship between N index numbers of the (i−1).sup.th node on the N routing paths passing through the i.sup.th node, (2) a ranking relationship between the N index numbers of the (i+1).sup.th node on the N routing paths passing through the i.sup.th node, and (3) a ranking relationship between N index numbers of the N routing paths passing through the i.sup.th node.
4. The method according to claim 1, wherein the first ciphertext is encrypted by using the third quantum key based on a first algorithm that satisfies: g(ƒ.sub.E(K.sub.i−1,i−2(L.sub.j),K.sub.i−1,i(L.sub.j)),ƒ.sub.E(K.sub.i,j−1(L.sub.j),K.sub.i,j+1(L.sub.j)))=ƒ.sub.E(K.sub.i−1,i−2(L.sub.j),K.sub.i,j+1(L.sub.j)), wherein L.sub.j is an identifier of the target routing path; K.sub.i−1,i−2(L.sub.j) is a first quantum key corresponding to the (i−1).sup.th node on the target routing path L.sub.j; K.sub.i−1,j(L.sub.j) is the second quantum key corresponding to the (i−1).sup.th node on the target routing path L.sub.j; K.sub.i,j−1(L.sub.j) is the first quantum key corresponding to the i.sup.th node on the target routing path L.sub.j; K.sub.i,j+1(L.sub.j) is the second quantum key corresponding to the i.sup.th node on the target routing path L.sub.j; ƒ.sub.E(•) is a function corresponding to the second algorithm used when the third quantum key is generated; and g(•) is a function corresponding to the first algorithm.
5. The method according to claim 1, wherein if N is greater than 1, for a first routing path and a second routing path in the N routing paths passing through the i.sup.th node, a first quantum key corresponding to the i.sup.th node on the first routing path is different from a first quantum key corresponding to the i.sup.th node on the second routing path; and a second quantum key corresponding to the i.sup.th node on the first routing path is different from a second quantum key corresponding to the i.sup.th node on the second routing path.
6. The method according to claim 1, wherein the first quantum key corresponding to the i.sup.th node is determined based on: (1) indication information received by the i.sup.th node from a centralized controller or the (i−1).sup.th node, or (2) network topology information of a quantum communication system and a first preset rule.
7. The method according to claim 1, wherein the second quantum key corresponding to the i.sup.th node is determined based on: (1) indication information received by the i.sup.th node from a centralized controller or the (i+1).sup.th node, or (2) network topology information of a quantum communication system and a second preset rule.
8. The method according to claim 1, wherein the first quantum key is further determined based on a ranking of W routing paths, and wherein the ranking of the W routing paths is determined by the i.sup.th node based on one or more of (1) a ranking relationship between W index numbers of W routing paths passing through the i.sup.th node and the (i+1).sup.th node, (2) a ranking of the W routing paths passing through the i.sup.th node and the (i+1).sup.th node, and (3) a ranking relationship between W index numbers of an (i+2).sup.th node on W routing paths passing through the i.sup.th node and the (i+1).sup.th node.
9. A device for quantum key distribution, comprising: at least one processor; and a non-transitory computer-readable storage medium coupled to the at least one processor and storing programming instructions for execution by the at least one processor, the programming instructions instruct the device to perform operations comprising: determining, and based on a first mapping, a first quantum key of N first quantum keys corresponding to an i.sup.th node on a target routing path, wherein the first quantum key is obtained by the i.sup.th node for sharing between the i.sup.th node and an (i−1).sup.th node on the target routing path, the first mapping comprises N one-to-one correspondences between N routing paths passing through the i.sup.th node and the N first quantum keys, the target routing path is comprised in the N routing paths; determining, based on a second mapping, a second quantum key of N second quantum keys corresponding to the i.sup.th node, wherein the second quantum key corresponding to the i.sup.th node on the target routing path is obtained by the i.sup.th node for sharing between the i.sup.th node and an (i+1).sup.th node on the target routing path, the second mapping comprises N one-to-one correspondences between the N routing paths passing through the i.sup.th node and the N second quantum keys; generating, based on the first quantum key corresponding to the i.sup.th node and the second quantum key corresponding to the i.sup.th node, a third quantum key corresponding to the i.sup.th node on the target routing path; encrypting, by the i.sup.th node by using the third quantum key, a first ciphertext received from the (i−1).sup.th node to obtain a second ciphertext; and sending, by the i.sup.th node, the second ciphertext corresponding to the i.sup.th node to the (i+1).sup.th node, wherein the first ciphertext is the second ciphertext sent by and corresponding to the (i−1).sup.th node, and when i=1, a 0.sup.th node is a source node on the target routing path, and the second ciphertext corresponding to the 0.sup.th node is obtained by encrypting a quantum key to be shared between the source node and a destination node on the target routing path by using a second quantum key of the N second quantum keys corresponding to the source node, wherein a second quantum key of the N second quantum keys corresponding to the (i−1).sup.th node is same as the first quantum key corresponding to the i.sup.th node, and the second quantum key corresponding to the i.sup.th node is same as a first quantum key corresponding to the (i+1).sup.th node.
10. The device according to claim 9, the operations further comprising: sending the third quantum key to a destination node on the target routing path.
11. The device according to claim 9, wherein the first quantum key is further determined based on a ranking of the N routing paths, and wherein the ranking of the N routing paths is determined by the i.sup.th node based on one or more of (1) a ranking relationship between N index numbers of the (i−1).sup.th node on the N routing paths passing through the i.sup.th node, (2) a ranking relationship between the N index numbers of the (i+1).sup.th node on the N routing paths passing through the i.sup.th node, and (3) a ranking relationship between N index numbers of the N routing paths passing through the i.sup.th node.
12. The device according to claim 9, wherein the first ciphertext is encrypted by using the third quantum key based on a first algorithm that satisfies: g(ƒ.sub.E(K.sub.i−1,i−2(L.sub.j),K.sub.i−1,i(L.sub.j)),ƒ.sub.E(K.sub.i,j−1(L.sub.j),K.sub.i,j+1(L.sub.j)))=ƒ.sub.E(K.sub.i−1,i−2(L.sub.j),K.sub.i,j+1(L.sub.j)), wherein L.sub.j is an identifier of the target routing path; K.sub.i−1,i−2(L.sub.j) is a first quantum key corresponding to the (i−1).sup.th node on the target routing path L.sub.j; K.sub.i−1,j(L.sub.j) is the second quantum key corresponding to the (i−1).sup.th node on the target routing path L.sub.j; K.sub.i,j−1(L.sub.j) is the first quantum key corresponding to the i.sup.th node on the target routing path L.sub.j; K.sub.i,j+1(L.sub.j) is the second quantum key corresponding to the i.sup.th node on the target routing path L.sub.j; ƒ.sub.E(•) is a function corresponding to the second algorithm used when the third quantum key is generated; and g(•) is a function corresponding to the first algorithm.
13. The device according to claim 9, wherein if N is greater than 1, for a first routing path and a second routing path in the N routing paths passing through the i.sup.th node, a first quantum key corresponding to the i.sup.th node on the first routing path is different from a first quantum key corresponding to the i.sup.th node on the second routing path; and a second quantum key corresponding to the i.sup.th node on the first routing path is different from a second quantum key corresponding to the i.sup.th node on the second routing path.
14. The device according to claim 9, wherein the first quantum key corresponding to the i.sup.th node is determined based on: (1) indication information received by the i.sup.th node from a centralized controller or the (i−1).sup.th node, or (2) network topology information of a quantum communication system and a first preset rule.
15. The device according to claim 9, wherein the second quantum key corresponding to the i.sup.th node is determined based on: (1) indication information received by the i.sup.th node from a centralized controller or the (i+1).sup.th node, or (2) network topology information of a quantum communication system and a second preset rule.
16. The device according to claim 9, wherein the first quantum key is further determined based on a ranking of W routing paths, and wherein the ranking of the W routing paths is determined by the i.sup.th node based on one or more of (1) a ranking relationship between W index numbers of W routing paths passing through the i.sup.th node and the (i+1).sup.th node, (2) a ranking of the W routing paths passing through the i.sup.th node and the (i+1).sup.th node, and (3) a ranking relationship between W index numbers of an (i+2).sup.th node on W routing paths passing through the i.sup.th node and the (i+1).sup.th node.
17. A non-transitory, computer-readable medium storing one or more instructions executable by at least one processor to perform operations comprising: determining, based on a first mapping, a first quantum key of N first quantum keys corresponding to an i.sup.th node on a target routing path, wherein the first quantum key is obtained by the i.sup.th node for sharing between the i.sup.th node and an (i−1).sup.th node on the target routing path, the first mapping comprises N one-to-one correspondences between N routing paths passing through the i.sup.th node and the N first quantum keys, the target routing path is comprised in the N routing paths; determining, based on a second mapping, a second quantum key of N second quantum keys corresponding to the i.sup.th node, wherein the second quantum key corresponding to the i.sup.th node on the target routing path is obtained by the i.sup.th node for sharing between the i.sup.th node and an (i+1).sup.th node on the target routing path, the second mapping comprises N one-to-one correspondences between the N routing paths passing through the i.sup.th node and the N second quantum keys; generating, by the i.sup.th node based on the first quantum key corresponding to the i.sup.th node and the second quantum key corresponding to the i.sup.th node, a third quantum key corresponding to the i.sup.th node on the target routing path; encrypting, by the i.sup.th node by using the third quantum key, a first ciphertext received from the (i−1).sup.th node to obtain a second ciphertext; and sending, by the i.sup.th node, the second ciphertext corresponding to the i.sup.th node to the (i+1).sup.th node, wherein the first ciphertext is the second ciphertext sent by and corresponding to the (i−1).sup.th node, and when i=1, a 0.sup.th node is a source node on the target routing path, and the second ciphertext corresponding to the 0.sup.th node is obtained by encrypting a quantum key to be shared between the source node and a destination node on the target routing path by using a second quantum key of the N second quantum keys corresponding to the source node, wherein a second quantum key of the N second quantum keys corresponding to the (i−1).sup.th node is same as the first quantum key corresponding to the i.sup.th node, and the second quantum key corresponding to the i.sup.th node is same as a first quantum key corresponding to the (i+1).sup.th node.
18. The non-transitory, computer-readable medium according to claim 17, the operations further comprising: sending the third quantum key to a destination node on the target routing path.
Description
BRIEF DESCRIPTION OF DRAWINGS
(1)
(2)
(3)
(4)
(5)
(6)
(7)
(8)
(9)
(10)
(11)
(12)
(13)
(14)
DESCRIPTION OF EMBODIMENTS
(15)
(16) a routing path L.sub.1: “source node B.fwdarw.relay node D.fwdarw.relay node E.fwdarw.relay node G.fwdarw.destination node P”:
(17) a routing path L.sub.2: “source node B.fwdarw.relay node D.fwdarw.relay node E.fwdarw.relay node G.fwdarw.destination node Q”;
(18) a routing path L.sub.3: “source node B.fwdarw.relay node D.fwdarw.relay node E.fwdarw.destination node H”;
(19) a routing path L.sub.4: “source node C.fwdarw.relay node D.fwdarw.destination node F”:
(20) a routing path L.sub.5: “source node B.fwdarw.relay node D.fwdarw.destination node F”; and
(21) a routing path L.sub.6: “source node R.fwdarw.relay node E.fwdarw.destination node H”.
(22) Based on the schematic architectural diagram of the quantum communication system shown in
(23) Step 301: An i.sup.th node determines, based on a first correspondence, a first quantum key corresponding to the i.sup.th node on a target routing path. In an optional implementation, the i.sup.th node is an i.sup.th relay node on the target routing path.
(24) The i.sup.th node is the i.sup.th node on the target routing path. The first quantum key corresponding to the i.sup.th node on the target routing path is a quantum key that is obtained by the i.sup.th node and that is shared or to be shared between the i.sup.th node and an (i−1).sup.th node on the target routing path. The first correspondence includes a correspondence between each of N routing paths passing through the i.sup.th node and each of N first quantum keys corresponding to the i.sup.th node, and the N routing paths are in a one-to-one correspondence with the N first quantum keys corresponding to the i.sup.th node, where N is a positive integer, and i is a positive integer. The target routing path is any one of the N routing paths. In this embodiment of this application, the target routing path is merely a name for ease of description, and does not constitute a limitation.
(25) Step 302: The i.sup.th node determines, based on a second correspondence, a second quantum key corresponding to the i.sup.th node on the target routing path.
(26) The second quantum key corresponding to the i.sup.th node on the target routing path is a quantum key that is obtained by the i.sup.th node and that is shared or to be shared between the i.sup.th node and an (i+1).sup.th node on the target routing path. The second correspondence includes a correspondence between each of the N routing paths passing through the i.sup.th node and each of N second quantum keys corresponding to the i.sup.th node, and the N routing paths are in a one-to-one correspondence with the N second quantum keys corresponding to the i.sup.th node.
(27) Step 303: The i.sup.th node generates, based on the first quantum key corresponding to the i.sup.th node on the target routing path and the second quantum key corresponding to the i.sup.th node on the target routing path, a third quantum key corresponding to the i.sup.th node on the target routing path. After step 303, this embodiment of this application provides two optional implementations. In one optional implementations, step 304 is performed after step 303. In the other optional implementations, step 305 is performed after step 303. Whether step 304 or step 305 is performed after step 303 may be flexibly selected by a person skilled in the art based on an actual application scenario.
(28) Step 304: The i.sup.th node sends the third quantum key corresponding to the i.sup.th node on the target routing path to a destination node on the target routing path.
(29) Step 305: The i.sup.th node encrypts, by using the third quantum key corresponding to the i.sup.th node on the target routing path, a first ciphertext received from the (i−1).sup.th node on the target routing path, and sends an obtained second ciphertext corresponding to the i.sup.th node to the (i+1).sup.th node on the target routing path.
(30) The first ciphertext received by the i.sup.th node from the (i−1).sup.th node on the target routing path is a second ciphertext that is sent by the (i−1).sup.th node and that corresponds to the (i−1).sup.th node. When i is 1, a 0.sup.th node is a source node on the target routing path, and a second ciphertext corresponding to the source node on the target routing path is obtained by encrypting a to-be-shared quantum key between the source node on the target routing path and the destination node on the target routing path by using a second quantum key corresponding to the source node on the target routing path.
(31) A second quantum key corresponding to the (i−1).sup.th node on the target routing path is the same as the first quantum key corresponding to the i.sup.th node on the target routing path, and the second quantum key corresponding to the i.sup.th node on the target routing path is the same as a first quantum key corresponding to the (i+1).sup.th node on the target routing path.
(32) In this embodiment of this application, an algorithm used when the i.sup.th node encrypts, by using the third quantum key corresponding to the i.sup.th node on the target routing path, the first ciphertext received from the (i−1).sup.th node on the target routing path may be referred to as a first algorithm. In this embodiment of this application, an algorithm used when the third quantum key corresponding to the i.sup.th node on the target routing path is generated based on the first quantum key corresponding to the i.sup.th node on the target routing path and the second quantum key corresponding to the i.sup.th node on the target routing path may be referred to as a second algorithm.
(33) The quantum key distribution method shown in
(34) As shown in
(35) The source node B encrypts, by using the second quantum key K.sub.BD(L.sub.2) corresponding to the source node B, the to-be-shared quantum key K.sub.BQ(L.sub.2) between the source node on the target routing path and the destination node on the target routing path, to obtain a second ciphertext K.sub.B(L.sub.2) corresponding to the source node B. The source node B sends the second ciphertext K.sub.B(L.sub.2) corresponding to the source node to the relay node D. An algorithm used to encrypt K.sub.BQ(L.sub.2) by using K.sub.BD(L.sub.2) may be referred to as a third algorithm. The third algorithm may be the same as the first algorithm, or may be another algorithm.
(36) Correspondingly, the relay node D receives a first ciphertext K.sub.B(L.sub.2) from the source node B. In other words, the second ciphertext that is sent by the source node B and that corresponds to the source node B is the same as the first ciphertext received by the relay node D. In this embodiment of this application, a first ciphertext received by a relay node may also be referred to as the first ciphertext corresponding to the relay node. For example, the first ciphertext K.sub.B(L.sub.2) received by the relay node D may also be referred to as the first ciphertext K.sub.B(L.sub.2) corresponding to the relay node D. If the target routing path is the routing path L.sub.2, and the node D is an i.sup.th node on the target routing path, the node B is an (i−1).sup.th node on the target routing path, the node E is an (i+1).sup.th node on the target routing path, and the node G is an (i+.sub.2).sup.th node on the target routing path. This is the same for subsequent descriptions, and is not described below. The relay node D generates, based on a first quantum key K.sub.DB(L.sub.2) corresponding to the relay node D on the target routing path and a second quantum key K.sub.DE(L.sub.2) corresponding to the relay node D on the target routing path, a third quantum key K.sub.BE(L.sub.2) corresponding to the relay node D on the target routing path.
(37) Further, the relay node D encrypts, by using the third quantum key K.sub.BE(L.sub.2), the received first ciphertext K.sub.B(L.sub.2) corresponding to the relay node D, to obtain a second ciphertext K.sub.D(L.sub.2) corresponding to the relay node D. The relay node D sends the second ciphertext K.sub.D(L.sub.2) corresponding to the relay node D to the relay node E. An algorithm used to encrypt the first ciphertext K.sub.B(L.sub.2) by using the third quantum key K.sub.BE(L.sub.2) to generate the second ciphertext K.sub.D(L.sub.2) may be the first algorithm.
(38) Correspondingly, the relay node E receives a first ciphertext K.sub.D(L.sub.2) from the relay node D. In other words, the second ciphertext that is sent by the relay node D and that corresponds to the relay node D is the same as the first ciphertext received by the relay node E. The relay node E generates, based on a first quantum key K.sub.ED(L.sub.2) corresponding to the relay node E on the routing path L.sub.2 and a second quantum key K.sub.EG(L.sub.2) corresponding to the relay node E on the routing path L.sub.2, a third quantum key K.sub.DG(L.sub.2) corresponding to the relay node E on the routing path L.sub.2. Further, the relay node E encrypts the first ciphertext K.sub.D(L.sub.2) by using the third quantum key K.sub.DG(L.sub.2), to obtain a second ciphertext K.sub.E(L.sub.2) corresponding to the relay node E. The relay node E sends the second ciphertext K.sub.E(L.sub.2) corresponding to the relay node E to the relay node G.
(39) Correspondingly, the relay node G receives a first ciphertext K.sub.E(L.sub.2) from the relay node E. In other words, the second ciphertext that is sent by the relay node E and that corresponds to the relay node E is the same as the first ciphertext received by the relay node G. The relay node G generates, based on a first quantum key K.sub.GE(L.sub.2) corresponding to the relay node G on the routing path L.sub.2 and a second quantum key K.sub.GQ(L.sub.2) corresponding to the relay node G on the routing path L.sub.2, a third quantum key K.sub.EQ(L.sub.2) corresponding to the relay node G on the routing path L.sub.2. Further, the relay node G encrypts the first ciphertext K.sub.E(L.sub.2) by using the third quantum key K.sub.EQ(L.sub.2), to obtain a second ciphertext K.sub.G(L.sub.2) corresponding to the relay node G. The relay node G sends the second ciphertext K.sub.G(L.sub.2) corresponding to the relay node G to the destination node Q.
(40) Further, the destination node Q receives a first ciphertext K.sub.G(L.sub.2) from the relay node G. and K.sub.G(L.sub.2) may be referred to as the first ciphertext corresponding to the destination node Q. The destination node Q decrypts the first ciphertext K.sub.G(L.sub.2) by using a first quantum key K.sub.QG(L.sub.2) corresponding to the destination node Q on the routing path L.sub.2, to obtain the to-be-shared quantum key K.sub.BQ(L.sub.2). An algorithm used for decryption processing may be referred to as a fourth algorithm. The fourth algorithm may be the same as the first algorithm, or may be another algorithm.
(41) For a process in which the destination node decrypts, by using the first quantum key corresponding to the destination node on the target routing path, the first ciphertext corresponding to the destination node, to obtain the to-be-shared quantum key, refer to related descriptions of a formula (1) in the following content.
(42)
(43) The following content can be learned from the examples shown in
(44) Second, a relay node does not encrypt and decrypt information sent by a previous node of the relay node, so that a time and a resource occupied for performing optical-to-electrical conversion on a to-be-shared quantum key on a routing path can be saved.
(45) Third, in this embodiment of this application, after generating a third quantum key, a relay node may delete a first quantum key and a second quantum key that correspond to the relay node. It can be learned that the relay node may not leave a time window within which an attack is made, so that a capability of an eavesdropper for decrypting a to-be-shared quantum key is deteriorated. This can further improve information transmission security in a quantum key distribution process.
(46) Fourth, related information of a third quantum key corresponding to a relay node may be publicized, so that an information storage security requirement can be lowered. This provides a basis for further publicizing all related attribute information of the relay node. A node may publicize a log including a corresponding operation and a corresponding access status that are generated when the node is used as a relay node on a routing path, and a resource utilization status of the node. In this process, an intermediate step of obtaining a third quantum key corresponding to the relay node through calculation and a related information result used in the intermediate step cannot be publicized. In this embodiment of this application, the relay node may publicize related information of the relay node, for example, a log including an operation and an access status of the relay node. This can help analyze a network running status, and further improves transparency to a customer.
(47) In this embodiment of this application, the second quantum key corresponding to the (i−1).sup.th node on the target routing path is the same as the first quantum key corresponding to the i.sup.th node on the target routing path, and the second quantum key corresponding to the i.sup.th node on the target routing path is the same as the first quantum key corresponding to the (i+1).sup.th node on the target routing path. For example, in
(48) In
(49) In an optional implementation, the first algorithm meets the formula (1):
g(ƒ.sub.E(K.sub.i−1,i−2(L.sub.j),K.sub.i−1,i(L.sub.j)),ƒ.sub.E(K.sub.i,i−1(L.sub.j),K.sub.i,i+1(L.sub.j)))=ƒ.sub.E(K.sub.i−1,i−2(L.sub.j),K.sub.i,j+1(L.sub.j))
(50) In the formula (1), L.sub.j is an identifier of the target routing path;
(51) K.sub.i−1,i−2(L.sub.j) is a first quantum key corresponding to the (i−1).sup.th node on the target routing path L.sub.j;
(52) K.sub.i−1,i(L.sub.j) is the second quantum key corresponding to the (i−1).sup.th node on the target routing path L.sub.j;
(53) K.sub.i,i−1(L.sub.j) is the first quantum key corresponding to the i.sup.th node on the target routing path L.sub.j;
(54) K.sub.i,j+1(L.sub.j) is the second quantum key corresponding to the i.sup.th node on the target routing path;
(55) ƒ.sub.E(•) is a function corresponding to the second algorithm, where the second algorithm is an algorithm used when the third quantum key corresponding to the i.sup.th node on the target routing path is generated based on the first quantum key corresponding to the i.sup.th node on the target routing path and the second quantum key corresponding to the i.sup.th node on the target routing path; and
(56) g(•) is a function corresponding to the first algorithm.
(57) With reference to
g(ƒ.sub.E(K.sub.DB(L.sub.2),K.sub.DE(L.sub.2)),ƒ.sub.E(k.sub.ED(L.sub.2),K.sub.EG(L.sub.2)))=ƒ.sub.E(K.sub.EG(L.sub.2),K.sub.EG(L.sub.2)).
(58) Herein, ƒ.sub.E(K.sub.D (L.sub.2),K.sub.E (L.sub.2)) means that an operation corresponding to the second algorithm is performed on the first quantum key K.sub.DB(L.sub.2) corresponding to the relay node D on the routing path L.sub.2 and the second quantum key K.sub.DE(L.sub.2) corresponding to the relay node D on the routing path L.sub.2, and a calculation result of ƒ.sub.E(K.sub.DB(L.sub.2),K.sub.DE(L.sub.2)) is the third quantum key K.sub.BE(L.sub.2), shown in
(59) ƒ.sub.E(K.sub.ED(L.sub.2),K.sub.EG(L.sub.2)) means that an operation corresponding to the second algorithm is performed on the first quantum key K.sub.ED(L.sub.2) corresponding to the relay node E on the routing path L.sub.2 and the second quantum key K.sub.EG(L.sub.2) corresponding to the relay node E on the routing path L.sub.2, and a calculation result of ƒ.sub.E(K.sub.ED(L.sub.2),K.sub.EG(L.sub.2)) is the third quantum key K.sub.DG(L.sub.2), shown in
(60) g(ƒ.sub.D(K.sub.DB(L.sub.2),K.sub.DE(L.sub.2)),ƒ.sub.E(K.sub.EG(L.sub.2),K.sub.EG(L.sub.2))) means that an operation corresponding to the first algorithm is performed on the third quantum key K.sub.BE(L.sub.2) corresponding to the relay node D on the routing path L.sub.2 and the third quantum key K.sub.DG(L.sub.2) corresponding to the relay node E on the routing path L.sub.2, and when K.sub.DE(L.sub.2) is the same as K.sub.ED(L.sub.2), a result of g(ƒ.sub.E(K.sub.DB(L.sub.2),K.sub.DE(L.sub.2)),ƒ.sub.E(K.sub.ED(L.sub.2),K.sub.EG(L.sub.2))) is ƒ.sub.E(K.sub.DB(L.sub.2),K.sub.EG(L.sub.2)).
(61) When the foregoing formula (1) is used, with reference to a calculation manner of a third quantum key corresponding to each node in
(62)
(63) It can be learned from the formula (2) that, after performing an operation on the received first ciphertext K.sub.G(L.sub.2), the destination node may obtain the to-be-shared quantum key. A person skilled in the art may learn that, in an actual operation, the destination node may not perform the detailed calculation shown in the foregoing formula (2), but performs, by using K.sub.QG(L.sub.2), only the operation corresponding to the first algorithm on received K.sub.G(L.sub.2).
(64) In
(65) For example, ƒ.sub.E(•) may be a function set, may include a series of encryption functions {ƒ.sub.E0, ƒ.sub.E1 . . . }, and may further include a decryption function ƒ.sub.D. ƒ.sub.E0 is the foregoing third algorithm used to encrypt a to-be-shared quantum key between the source node and the destination node, and ƒ.sub.E1, ƒ.sub.E2 . . . is a function used by each relay node to calculate a third quantum key and encrypt a received first ciphertext. In other words, a function corresponding to the first algorithm is the same as a function corresponding to the second algorithm (for example, ƒ.sub.E1 is a function used by the first relay node on a routing path to calculate a third quantum key corresponding to the first relay node and encrypt a received first ciphertext). ƒ.sub.D is the fourth algorithm. In other words, the destination node decrypts a received first ciphertext, to obtain a to-be-shared quantum key. Any two functions in {ƒ.sub.E0, ƒ.sub.E1 . . . } and ƒ.sub.D may be the same or may be different. This is not limited in this embodiment of this application.
(66) It can be learned from the foregoing example that, in this embodiment of this application, when a quantum key shared or to be shared between two adjacent nodes used in a quantum key distribution process is unknown (for example, a quantum key shared or to be shared between the destination node and a previous node of the destination node is unknown), the to-be-shared quantum key cannot be obtained through calculation by using obtained third quantum keys of some or all nodes and an obtained second ciphertext sent by the source node, so that security of the quantum key distribution process can be improved.
(67) An optional implementation of the first algorithm and the second algorithm is further enumerated in this embodiment of this application. For example, the second algorithm may be defined as an operation of performing modulo 4 subtraction on every two bits. Details are as follows:
(68) For example, for any function in {ƒ.sub.E0, ƒ.sub.E1 . . . } in the function set ƒ.sub.E(•), an input is two binary sequences whose lengths each are 2n, for example, X=x.sub.1x.sub.2 . . . x.sub.2k−1x.sub.2k . . . x.sub.2n−1x.sub.2n, Y=y.sub.1y.sub.2 . . . y.sub.2k−1y.sub.2k . . . y.sub.2n−1y.sub.2n, and an output is still one binary sequence whose length is 2n, for example, Z=z.sub.1z.sub.2 . . . z.sub.2k−1z.sub.2k . . . z.sub.2n−1z.sub.n=ƒ.sub.E(X,Y). In this case, z.sub.2k−1z.sub.2k may be obtained by using the following calculation method:
(69) calculating a function “a.sub.k=2x.sub.2k−1+x.sub.2k, b.sub.k=2y.sub.2k−1+y.sub.2k”; and
(70) if a.sub.k≥b.sub.k, determining that z.sub.2k−1z.sub.2k is a binary representation of a.sub.k−b.sub.k;
(71) or if a.sub.k<b.sub.k, determining that z.sub.2k−1z.sub.2k is a binary representation of a.sub.k−b.sub.k+4.
(72) However, the decryption function ƒ.sub.D may be an operation of performing modulo 4 addition on every two bits, and it is not difficult to verify that the function in this example may also meet the foregoing implementations. It should be further noted that the foregoing formula (1) is not a necessary and sufficient condition for meeting the solution provided in this embodiment of this application, but is only a sufficient condition. Alternatively, there may be another form of function that meets a mathematical feature in the foregoing embodiment. This is not limited in this embodiment of this application.
(73) The communications system applicable to this embodiment of this application may include a plurality of routing paths. If N is an integer greater than 1, for a first routing path and a second routing path in N routing paths passing through an i.sup.th node, a first quantum key corresponding to the i.sup.th node on the first routing path is different from a first quantum key corresponding to the i.sup.th node on the second routing path, and a second quantum key corresponding to the i.sup.th node on the first routing path is different from a second quantum key corresponding to the i.sup.th node on the second routing path. The first routing path and the second routing path are two different routing paths in the N routing paths. As shown in
(74) In actual application, the quantum communication system continuously generates quantum keys to push the quantum keys to a key management layer. Therefore, each quantum key may be numbered, and the number corresponding to the quantum key may also be referred to as an identifier corresponding to the quantum key. For example, in
(75) The first correspondence in step 301 and the second correspondence in step 302 may be obtained in a plurality of manners. The following describes several manners of obtaining the first quantum key corresponding to the i.sup.th node on the target routing path in the first correspondence: an optional implementation a1, an optional implementation a2, and an optional implementation a3.
(76) In the implementation a1, indication information used to indicate the first quantum key corresponding to the i.sup.th node on the target routing path in the first correspondence is delivered by a centralized controller.
(77) The i.sup.th node receives the indication information that is sent by the centralized controller and that is used to indicate the first quantum key corresponding to the i.sup.th node on the target routing path. In this embodiment of this application, the indication information used to indicate the first quantum key corresponding to the i.sup.th node on the target routing path may be directly the first quantum key corresponding to the i.sup.th node on the target routing path, or may be other information that can indicate the correspondence. Optionally, the i.sup.th node receives indication information that is sent by the centralized controller and that is used to indicate the second quantum key corresponding to the i.sup.th node on the target routing path. The centralized controller may collect service requests in an entire network, and may better calculate a routing path in the entire network. Subsequently, the centralized controller may calculate a first correspondence corresponding to each node, and then deliver the first correspondence to each node.
(78) In the implementation a2, indication information used to indicate the first quantum key corresponding to the i.sup.th node on the target routing path in the first correspondence is sent by the (i−1).sup.th node on the target routing path.
(79) In this implementation, the (i−1).sup.th node on the target routing path may obtain the second quantum key corresponding to the (i−1).sup.th node on the target routing path through calculation, and then send the second quantum key to the i.sup.th node. Because the second quantum key corresponding to the (i−1).sup.th node on the target routing path is the same as the first quantum key corresponding to the i.sup.th node on the target routing path, the i.sup.th node may learn of the first quantum key corresponding to the i.sup.th node on the target routing path in the first correspondence.
(80) Based on this implementation, in an optional implementation, each node (other than the destination node) on the target routing path obtains a second quantum key corresponding to each node on the target routing path through calculation, and then sends the second quantum key corresponding to each node on the target routing path to a next node of each node on the target routing path. Because the second quantum key corresponding to each node on the target routing path is the same as a first quantum key corresponding to the next node of each node on the target routing path, the i.sup.th node on the target routing path may obtain, in the implementation a2, the first quantum key corresponding to the i.sup.th node on the target routing path in the first correspondence.
(81) In the implementation a3, the i.sup.th node determines, based on obtained network topology information of the quantum communication system and a first preset rule, the first quantum key corresponding to the i.sup.th node on the target routing path.
(82) For the implementation a3, there may be a plurality of implementations in which the i.sup.th node determines, based on the obtained network topology information of the quantum communication system and the first preset rule, the first quantum key corresponding to the i.sup.th node on the target routing path. The following describes an optional implementation a3-1, an optional implementation a3-2, and an optional implementation a3-3.
Implementation a3-1
(83) The i.sup.th node determines, based on a ranking relationship between numbers of a plurality of (i−1).sup.th nodes on the N routing paths passing through the i.sup.th node, a ranking relationship between numbers of N (i+1).sup.th nodes on a plurality of routing paths passing through the i.sup.th node, and a ranking relationship between numbers of the N routing paths passing through the i.sup.th node, a ranking of the plurality of routing paths passing through the i.sup.th node, and determines, based on the ranking of the plurality of routing paths, the first quantum key corresponding to the i.sup.th node on the target routing path.
(84)
(85) Further, next-hop nodes of the node D on four routing paths on which the previous-hop node of the node D is the node B are ranked. As shown in
(86) Further, when there are a plurality of routing paths passing through a same previous-hop node of the node D and a same next-hop node of the node D, the plurality of routing paths may be ranked based on global numbers of the routing paths. Optionally, each routing path may have a global number, and there may be a ranking relationship between the numbers of the routing paths. It is assumed that global numbers of the six routing paths in
(87) It can be learned from
(88) Optionally, because consumption of a quantum key on a specific routing path may be relatively high, a weight may be set for each routing path based on consumption of a quantum key on each routing path and/or service attribute information, to determine a quantity of quantum keys distributed to each routing path in each quantum key distribution period. In other words, K.sub.DB(L) is only an identifier corresponding to the first quantum key distributed by the node D to the routing path L.sub.1. When only one quantum key is distributed to the routing path L.sub.1 in one quantum key distribution period, assuming that a length of a quantum key is 256 bits, K.sub.DB(L.sub.1) may be an identifier corresponding to a 256-bit quantum key in each quantum key distribution period. If a plurality of (for example, three) quantum keys are distributed to the routing path L.sub.1 in one quantum key distribution period, assuming that a length of a quantum key is 256 bits, K.sub.DB(L.sub.1) may be identifiers corresponding to the three 256-bit quantum keys in each quantum key distribution period.
(89) During specific implementation, routing paths are flexibly ranked.
Implementation a3-2
(90) The i.sup.th node determines, based on a ranking relationship between numbers of a plurality of (i+1).sup.th nodes on the N routing paths passing through the i.sup.th node, and a ranking relationship between numbers of the N routing paths passing through the i.sup.th node, a ranking of a plurality of routing paths passing through the i.sup.th node, and determines, based on the ranking of the plurality of routing paths, the first quantum key corresponding to the i.sup.th node on the target routing path.
(91)
Implementation a3-3
(92) The i.sup.th node determines, based on a ranking relationship between numbers of the N routing paths passing through the i.sup.th node, a ranking of the N routing paths passing through the i.sup.th node, and determines, based on the ranking of the N routing paths, the first quantum key corresponding to the i.sup.th node on the target routing path.
(93)
(94) In this embodiment of this application, several manners of obtaining the second quantum key corresponding to the i.sup.th node on the routing path in the second correspondence are described: an optional implementation b1, an optional implementation b2, and an optional implementation b3.
(95) In the implementation b1, indication information used to indicate the second quantum key corresponding to the i.sup.th node on the routing path in the second correspondence is delivered by the centralized controller.
(96) In this embodiment of this application, the indication information used to indicate the second quantum key corresponding to the i.sup.th node on the routing path in the second correspondence may be directly the second quantum key corresponding to the i.sup.th node on the target routing path, or may be other information that can indicate the correspondence. Optionally, the i.sup.th node receives indication information that is sent by the centralized controller and that is used to indicate the first quantum key corresponding to the i.sup.th node on the target routing path. The centralized controller may collect service requests in an entire network, and may better calculate a routing path in the entire network. Subsequently, the centralized controller may calculate a second correspondence corresponding to each node, and then deliver the second correspondence to each node.
(97) In the implementation b2, indication information used to indicate the second quantum key corresponding to the i.sup.th node on the routing path in the second correspondence is sent by the (i+1).sup.th node on the target routing path.
(98) In this implementation, the (i+1).sup.th node corresponding to the target routing path may obtain a first quantum key corresponding to the (i+1).sup.th node on the target routing path through calculation, and then send the first quantum key to the i.sup.th node. Because the first quantum key corresponding to the (i+1).sup.th node on the target routing path is the same as the second quantum key corresponding to the i.sup.th node on the target routing path, the i.sup.th node may learn of the second quantum key corresponding to the i.sup.th node on the target routing path in the second correspondence.
(99) Based on this implementation, in an optional implementation, each node (other than the source node) on the target routing path obtains a first quantum key corresponding to each node on the target routing path through calculation, and then sends the first quantum key corresponding to each node on the target routing path to a previous node of each node on the target routing path. Because the first quantum key corresponding to each node on the target routing path is the same as a second quantum key corresponding to the previous node of each node on the target routing path, the node on the target routing path may obtain, in the implementation b2, the second quantum key corresponding to the i.sup.th node on the routing path in the second correspondence.
(100) In the implementation b3, the i.sup.th node determines, based on the obtained network topology information of the quantum communication system and a second preset rule, the second quantum key corresponding to the i.sup.th node on the target routing path.
(101) For the implementation b3, there may be a plurality of implementations in which the i.sup.th node determines, based on the obtained network topology information of the quantum communication system and the second preset rule, the second quantum key corresponding to the i.sup.th node on the target routing path. The following describes an optional implementation b3-1 and an optional implementation b3-2.
Implementation b3-1
(102) The i.sup.th node determines, based on a ranking relationship between numbers of a plurality of (i+2).sup.th nodes on a plurality of routing paths passing through the i.sup.th node and the (i+1).sup.th node on the target routing path, and a ranking relationship between numbers of the plurality of routing paths passing through the i.sup.th node and the (i+1).sup.th node on the target routing path, a ranking of the plurality of routing paths passing through the i.sup.th node and the (i+1).sup.th node on the target routing path, and determines, based on the ranking of the plurality of routing paths, the second quantum key corresponding to the i.sup.th node on the target routing path.
(103)
(104) It can be learned that, in the implementation b3-1, a plurality of routing paths passing through the i.sup.th node and the (i+1).sup.th node on the target routing path are first selected, and then these routing paths are ranked.
(105)
(106) Further, next-hop nodes of the node E on three routing paths on which the previous-hop node of the node E is the node D are ranked. As shown in
(107) Further, as shown in
(108) It can be learned from
(109) It can be learned from
Implementation b3-2
(110) The i.sup.th node determines, based on a ranking relationship between numbers of a plurality of routing paths passing through the i.sup.th node and the (i+1).sup.th node on the target routing path, a ranking of the plurality of routing paths passing through the i.sup.th node and the (i+1).sup.th node on the target routing path, and determines, based on the ranking of the plurality of routing paths, the second quantum key corresponding to the i.sup.th node in the target routing path.
(111)
(112) It can be learned that, compared with the implementation b3-1, in the implementation b3-2, a plurality of routing paths passing through the i.sup.th node and the (i+1).sup.th node on the target routing path are first selected, and then the plurality of routing paths are directly ranked based on numbers of the plurality of routing paths passing through the i.sup.th node and the (i+1).sup.th node on the target routing path. However, in the implementation b3-1, the next-hop nodes of the node E on plurality of routing paths are first ranked, and then the plurality of routing paths are ranked based on numbers of the plurality of routing paths.
(113) In the foregoing implementations,
(114) In the implementation a2, the implementation a3, the implementation b2, and the implementation b3, each node may voluntarily calculate a first correspondence and/or a second correspondence. The foregoing implementations may be based on a distributed information method. To be specific, service requests in the entire network may not be collected together. However, a routing path of each service request is obtained by using a typical routing method, and then each routing path is correspondingly stored in each node through which the target routing path passes. Each node may voluntarily calculate the first correspondence and/or the second correspondence based on topology information that is stored in the node and that is of all routing paths passing through the node.
(115) Any one of the implementation at, the implementation a2, and the implementation a3 may be used in combination with any one of the implementation b1, the implementation b2, and the implementation b3. For example, the first quantum key corresponding to the i.sup.th node on the routing path in the first correspondence may be delivered by the centralized controller in the implementation a1, and the second quantum key corresponding to the i.sup.th node on the routing path in the second correspondence may be voluntarily calculated by the i.sup.th node in the implementation b3.
(116) For another example, the first quantum key corresponding to the i.sup.th node on the routing path in the first correspondence may be sent by the (i−1).sup.th node in the implementation a2, and the second quantum key corresponding to the i.sup.th node on the routing path in the second correspondence may be calculated by the i.sup.th node in the implementation b3.
(117) For another example, the first quantum key corresponding to the i.sup.th node on the routing path in the first correspondence may be voluntarily calculated by the i.sup.th node in the implementation a3, and the second quantum key corresponding to the i.sup.th node on the routing path in the second correspondence may be sent by the (i+1).sup.th node in the implementation b2.
(118) For another example, the first quantum key corresponding to the i.sup.th node on the routing path in the first correspondence may be voluntarily calculated by the i.sup.th node in the implementation a3, and the second quantum key corresponding to the i.sup.th node on the routing path in the second correspondence may be voluntarily calculated by the i.sup.th node in the implementation b3. In this example, the i.sup.th node may determine, in any one of the implementation a3-1 to the implementation a3-3, the first quantum key corresponding to the i.sup.th node on the routing path, or may determine, in either of the implementation b3-1 and the implementation b3-2, the second quantum key corresponding to the i.sup.th node on the routing path. A selection manner is flexible. For example, the implementation a3-1 may be used in combination with the implementation b3-1, or the implementation a3-2 may be used in combination with the implementation b3-2, or the implementation a3-3 may be used in combination with the implementation b3-2.
(119) Optionally, in this embodiment of this application, the table shown in
(120) In the embodiments of this application, the quantum communication system may be divided into a plurality of local area networks.
(121) Based on the foregoing content, an embodiment of this application provides a quantum communication method. A specific operation procedure is as follows:
(122) From a moment 0 to a moment T1, one or more nodes initiate encryption service requests. The encryption service request may include an encryption service request corresponding to a newly added service, or may include an encryption service request corresponding to a cancelled existing service.
(123) Optionally, in an implementation, an encryption service request initiated by a node may be sent to the centralized controller, or may be sent to a gateway node in a local area network including the node. Alternatively, a centralized control end is disposed, and an encryption service request initiated by a node may be sent to the centralized control end.
(124) When the node sends an encryption service request to the centralized controller, the centralized controller may plan a routing path corresponding to the encryption service request. The centralized controller may globally optimize the routing path during routing path planning. In this embodiment of this application, the centralized controller may be replaced with the centralized control end, or another device having a function of the centralized controller in this embodiment of this application.
(125) When the node sends an encryption service request to the gateway node in the local area network including the node, the gateway node may plan a routing path in the local area network including the gateway node. When the encryption service request needs to cross at least two local area networks, the centralized controller may plan routing paths between gateway nodes in different local area networks, so that pressure of the centralized controller can be alleviated.
(126) The routing path may be delivered to all nodes on the routing path.
(127) Optionally, a key update rate required for each encryption service may be further recorded. For a pair of nodes with a relatively high key update rate, a plurality of parallel routing paths may be used to increase a final total key obtaining rate, or increase a weight on a specific routing path. When a routing path is calculated, the routing path may be optimized and adjusted based on a maximum key generation rate of each actual QKD link, so as to avoid a case in which key generation rates of many routing paths are limited because these routing paths pass through a same link.
(128) From the moment T1 to a moment T2, each node determines, based on information about a newly delivered routing path, a first correspondence and a second correspondence that corresponds to each node. A specific manner may be shown in the implementation a1 to the implementation b2. Details are not described herein again.
(129) If each node still stores a historical first correspondence and a historical second correspondence, the historical first correspondence and the historical second correspondence may be replaced with the newly obtained first correspondence and second correspondence.
(130) Optionally, in this time period, a destination node may properly process various types of information received in this time period.
(131) From the moment T2 to a moment T3, for each node, the node calculates, based on the updated first correspondence and the updated second correspondence, a third quantum key corresponding to the node on each routing path passing through the node, and after obtaining a calculation result, deletes, within preset duration, a first quantum key and a second quantum key that correspond to the node on each routing path passing through the node. The preset duration may be set to a relatively small value, for example, may be 1 minute or 30 seconds. Therefore, quantum key distribution can be improved.
(132) Optionally, the node may publicize the third quantum key corresponding to the node on each routing path passing through the node, and related information of each routing path passing through the node. The node may publicize information in a plurality of manners. For example, the node may report the information only to a centralized control node, or may publicize information for internal use, in other words, among a specific group in a quantum network, or may publicize the information to a third party, for example, to a third-party supervision organization, or even may publicize the information to an entire network because the information does not affect security. However, it is generally considered that different information may be publicized in different domains. Because the publicized information can help analyze a network status if being properly used, authentication needs to be performed when the information is publicized, to ensure that the information is sent by the current node. In addition, the publicized information may be further uploaded to a blockchain, to further prevent the publicized information from being tampered with.
(133) Optionally, for a source node on a routing path, after receiving information publicized by each of nodes on the routing path, the source node may send a second ciphertext corresponding to the source node, where the node may publicize a third quantum key corresponding to the node on each routing path passing through the node, and related information of each routing path passing through the node.
(134) Optionally, for a destination node on a routing path, after receiving information publicized by each of nodes on the routing path, the destination node may obtain a to-be-shared quantum key between a source node and the destination node from a second ciphertext corresponding to the source node through decryption, where the node may publicize a third quantum key corresponding to the node on each routing path passing through the node, and related information of each routing path passing through the node. Optionally, the to-be-shared quantum key may be stored in a service key pool, and the service key pool is confidential storage space.
(135) Based on a same concept, this application provides a quantum key distribution device 1301, configured to perform any solution on a receive side in the foregoing method.
(136) The memory 1305 may include a volatile memory such as a random access memory (RAM), or the memory 1305 may include a nonvolatile memory such as a flash memory, a hard disk drive (HDD), or a solid-state drive (SSD), or the memory 1305 may include a combination of the foregoing types of memories.
(137) The communications interface 1304 may be a wired communications interface, a wireless communications interface, or a combination thereof. The wired communications interface may be, for example, an Ethernet interface, and the Ethernet interface may be an optical interface, an electrical interface, or a combination thereof. The wireless communications interface may be a WLAN interface.
(138) The processor 1303 may be a central processing unit (CPU), a network processor (NP), or a combination of the CPU and the NP. The processor 1303 may further include a hardware chip. The foregoing hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The PLD may be a complex programmable logic device (CPLD), a field programmable logic gate array (FPGA), generic array logic (GAL), or any combination thereof.
(139) Optionally, the memory 1305 may be further configured to store a program instruction. The processor 1303 can perform one or more steps or an optional implementation in the embodiment in the foregoing solution by invoking the program instruction stored in the memory 1305, so that the quantum key distribution device 1301 implements functions of the i.sup.th node in the foregoing method. The quantum key distribution device 1301 is an i.sup.th node on a routing path of a quantum communication system. The processor 1303 in the quantum key distribution device 1301 is configured to: determine, based on a first correspondence, a first quantum key corresponding to the i.sup.th node on a target routing path: determine, based on a second correspondence, a second quantum key corresponding to the i.sup.th node on the target routing path; and generate, based on the first quantum key corresponding to the i.sup.th node on the target routing path and the second quantum key corresponding to the i.sup.th node on the target routing path, a third quantum key corresponding to the i.sup.th node on the target routing path, where the i.sup.th node is the i.sup.th node on the target routing path, the first quantum key corresponding to the i.sup.th node on the target routing path is a quantum key that is obtained by the i.sup.th node and that is shared or to be shared between the i.sup.th node and an (i−1).sup.th node on the target routing path, the first correspondence includes a correspondence between each of N routing paths passing through the i.sup.th node and each of N first quantum keys corresponding to the i.sup.th node, the N routing paths are in a one-to-one correspondence with the N first quantum keys corresponding to the i.sup.th node, the target routing path is one of the N routing paths, N is a positive integer, and i is a positive integer: and the second quantum key corresponding to the i.sup.th node on the target routing path is a quantum key that is obtained by the i.sup.th node and that is shared or to be shared between the i.sup.th node and an (i+1).sup.th node on the target routing path, the second correspondence includes a correspondence between each of the N routing paths passing through the i.sup.th node and each of N second quantum keys corresponding to the i.sup.th node, and the N routing paths are in a one-to-one correspondence with the N second quantum keys corresponding to the i.sup.th node. The transceiver 1302 is configured to: send the third quantum key corresponding to the i.sup.th node on the target routing path to a destination node on the target routing path; or encrypt, by using the processor 1303 by using the third quantum key corresponding to the i.sup.th node on the target routing path, a first ciphertext received from the (i−1).sup.th node on the target routing path, and send an obtained second ciphertext corresponding to the i.sup.th node to the (i+1).sup.th node on the target routing path.
(140) The first ciphertext received by the i.sup.th node from the (i−1).sup.th node on the target routing path is a second ciphertext that is sent by the (i−1).sup.th node and that corresponds to the (i−1).sup.th node, and when i is 1, a 0.sup.th node is a source node on the target routing path, and a second ciphertext corresponding to the source node on the target routing path is obtained by encrypting a to-be-shared quantum key between the source node on the target routing path and the destination node on the target routing path by using a second quantum key corresponding to the source node on the target routing path.
(141) A second quantum key corresponding to the (i−1).sup.th node on the target routing path is the same as the first quantum key corresponding to the i.sup.th node on the target routing path, and the second quantum key corresponding to the i.sup.th node on the target routing path is the same as a first quantum key corresponding to the (i+1).sup.th node on the target routing path.
(142) In a possible implementation, if N is an integer greater than 1, for a first routing path and a second routing path in the N routing paths passing through the i.sup.th node, a first quantum key corresponding to the i.sup.th node on the first routing path is different from a first quantum key corresponding to the i.sup.th node on the second routing path; and a second quantum key corresponding to the i.sup.th node on the first routing path is different from a second quantum key corresponding to the i.sup.th node on the second routing path.
(143) In a possible implementation, the transceiver 1302 is further configured to receive indication information that is sent by a centralized controller or the (i−1).sup.th node on the target routing path and that is used to indicate the first quantum key corresponding to the i.sup.th node on the target routing path in the first correspondence; or the processor 1303 is further configured to determine, based on obtained network topology information of a quantum communication system and a first preset rule, the first quantum key corresponding to the i.sup.th node on the target routing path in the first correspondence.
(144) The first quantum key corresponding to the i.sup.th node on the target routing path is determined in a plurality of manners. For details, refer to the descriptions of the implementation a3-1, the implementation a3-2, and the implementation a3-3 in the foregoing content. Details are not described herein again.
(145) In a possible implementation, the transceiver 1302 is configured to receive indication information that is sent by the centralized controller or the (i+1).sup.th node corresponding to the target routing path and that is used to indicate the second quantum key corresponding to the i.sup.th node on the target routing path in the second correspondence; or the processor 1303 is configured to determine, based on the obtained network topology information of the quantum communication system and a second preset rule, the second quantum key corresponding to the i.sup.th node on the target routing path in the second correspondence.
(146) The second quantum key corresponding to the i.sup.th node on the target routing path is determined in a plurality of manners. For details, refer to the descriptions of the implementation b3-1 and the implementation b3-2 in the foregoing content. Details are not described herein again.
(147) Based on a same concept, an embodiment of this application provides a quantum key distribution device, configured to perform any solution on an i.sup.th node side in the foregoing method procedure.
(148) The processing unit 1403 is configured to: determine, based on a first correspondence, a first quantum key corresponding to the i.sup.th node on a target routing path; determine, based on a second correspondence, a second quantum key corresponding to the i.sup.th node on the target routing path; and generate, based on the first quantum key corresponding to the i.sup.th node on the target routing path and the second quantum key corresponding to the i.sup.th node on the target routing path, a third quantum key corresponding to the i.sup.th node on the target routing path, where the i.sup.th node is the i.sup.th node on the target routing path, the first quantum key corresponding to the i.sup.th node on the target routing path is a quantum key that is obtained by the i.sup.th node and that is shared or to be shared between the i.sup.th node and an (i−1).sup.th node on the target routing path, the first correspondence includes a correspondence between each of N routing paths passing through the i.sup.th node and each of N first quantum keys corresponding to the i.sup.th node, the N routing paths are in a one-to-one correspondence with the N first quantum keys corresponding to the i.sup.th node, the target routing path is one of the N routing paths, N is a positive integer, and i is a positive integer; and the second quantum key corresponding to the i.sup.th node on the target routing path is a quantum key that is obtained by the i.sup.th node and that is shared or to be shared between the i.sup.th node and an (i+1).sup.th node on the target routing path, the second correspondence includes a correspondence between each of the N routing paths passing through the i.sup.th node and each of N second quantum keys corresponding to the i.sup.th node, and the N routing paths are in a one-to-one correspondence with the N second quantum keys corresponding to the i.sup.th node. The transceiver 1402 is configured to: send the third quantum key corresponding to the i.sup.th node on the target routing path to a destination node on the target routing path: or encrypt, by using the processor by using the third quantum key corresponding to the i.sup.th node on the target routing path, a first ciphertext received from the (i−1).sup.th node on the target routing path, and send an obtained second ciphertext corresponding to the i.sup.th node to the (i+1).sup.th node on the target routing path.
(149) The first ciphertext received by the i.sup.th node from the (i−1).sup.th node on the target routing path is a second ciphertext that is sent by the (i−1).sup.th node and that corresponds to the (i−1).sup.th node, and when i is 1, a 0.sup.th node is a source node on the target routing path, and a second ciphertext corresponding to the source node on the target routing path is obtained by encrypting a to-be-shared quantum key between the source node on the target routing path and the destination node on the target routing path by using a second quantum key corresponding to the source node on the target routing path. A second quantum key corresponding to the (i−1).sup.th node on the target routing path is the same as the first quantum key corresponding to the i.sup.th node on the target routing path, and the second quantum key corresponding to the i.sup.th node on the target routing path is the same as a first quantum key corresponding to the (i+1).sup.th node on the target routing path.
(150) It should be understood that division of the units of the foregoing quantum key distribution device is merely logical function division. During actual implementation, all or some of the units may be integrated into one physical entity, or may be physically separated. In this embodiment of this application, the transceiver unit 1402 may be implemented by the transceiver 1302 in
(151) All or some of the foregoing embodiments may be implemented by using software, hardware, firmware, or any combination thereof. When the software is used to implement the embodiments, all or some of the foregoing embodiments may be implemented in a form of a computer program product. The computer program product includes one or more instructions. When the computer program instructions are loaded and executed on a computer, the procedures or functions according to the embodiments of this application are all or partially generated. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or another programmable apparatus. The instructions may be stored in a computer storage medium, or may be transmitted from a computer storage medium to another computer storage medium. For example, the instructions may be transmitted from a website, computer, server, or data center to another website, computer, server, or data center in a wired (for example, a coaxial cable, an optical fiber, or a digital subscriber line (DSL)) or wireless (for example, infrared, radio, or microwave) manner. The computer storage medium may be any usable medium accessible by the computer, or a data storage device, such as a server or a data center, integrating one or more usable media. The usable medium may be a magnetic medium (for example, a floppy disk, a hard disk, a magnetic tape, or a magneto-optical disc (MO)), an optical medium (for example, a CD, a DVD, a BD, or an HVD), a semiconductor medium (for example, a ROM, an EPROM, an EEPROM, a nonvolatile memory (NVM), or a solid state disk (SSD), or the like.
(152) A person skilled in the art should understand that the embodiments of this application may be provided as a method, a system, or a computer program product. Therefore, the embodiments of this application may use a form of hardware only embodiments, software only embodiments, or embodiments with a combination of software and hardware. In addition, the embodiments of this application may use a form of a computer program product that is implemented on one or more computer-usable storage media (including but not limited to a disk memory, a CD-ROM, an optical memory, and the like) that include computer-usable program code.
(153) The embodiments of this application are described with reference to the flowcharts and/or block diagrams of the method, the device (system), and the computer program product according to the embodiments of this application. It should be understood that instructions may be used to implement each process and/or each block in the flowcharts and/or the block diagrams and a combination of a process and/or a block in the flowcharts and/or the block diagrams. These instructions may be provided for a general-purpose computer, a special-purpose computer, an embedded processor, or a processor of any other programmable data processing device to generate a machine, so that the instructions executed by a computer or a processor of any other programmable data processing device generate an apparatus for implementing a specific function in one or more processes in the flowcharts and/or in one or more blocks in the block diagrams.
(154) These computer program instructions may be stored in a computer readable memory that can instruct the computer or any other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory generate an artifact that includes an instruction apparatus. The instruction apparatus implements a specific function in one or more processes in the flowcharts and/or in one or more blocks in the block diagrams.
(155) These instructions may be loaded onto a computer or another programmable data processing device, so that a series of operations and steps are performed on the computer or the another programmable device, thereby generating computer-implemented processing. Therefore, the instructions executed on the computer or the another programmable device provide steps for implementing a specific function in one or more processes in the flowcharts and/or in one or more blocks in the block diagrams.
(156) Apparently, a person skilled in the art can make various modifications and variations to the embodiments of this application without departing from the spirit and scope of this application. This application is intended to cover these modifications and variations provided that they fall within the scope of protection defined by the following claims and their equivalent technologies.