CN117176345B - Quantum cryptography network key relay dynamic routing method, device and system - Google Patents

Quantum cryptography network key relay dynamic routing method, device and system Download PDF

Info

Publication number
CN117176345B
CN117176345B CN202311426981.1A CN202311426981A CN117176345B CN 117176345 B CN117176345 B CN 117176345B CN 202311426981 A CN202311426981 A CN 202311426981A CN 117176345 B CN117176345 B CN 117176345B
Authority
CN
China
Prior art keywords
key
relay
path
derived
pool
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
CN202311426981.1A
Other languages
Chinese (zh)
Other versions
CN117176345A (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.)
China Telecom Quantum Technology Co ltd
Original Assignee
China Telecom Quantum 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 China Telecom Quantum Technology Co ltd filed Critical China Telecom Quantum Technology Co ltd
Priority to CN202311426981.1A priority Critical patent/CN117176345B/en
Publication of CN117176345A publication Critical patent/CN117176345A/en
Application granted granted Critical
Publication of CN117176345B publication Critical patent/CN117176345B/en
Priority to PCT/CN2024/107650 priority patent/WO2025092052A1/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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/06Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols the encryption apparatus using shift registers or memories for block-wise or stream coding, e.g. DES systems or RC4; Hash functions; Pseudorandom sequence generators
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

本发明公开一种量子密码网络密钥中继动态路由方法、装置及系统,方法包括查询量子密码网络中所有可达的密钥中继路径;选定所述密钥中继路径上每个中继节点为分配到该所述密钥中继路径上的业务生成派生密钥池;根据每条所述密钥中继路径上各中继节点生成的派生密钥池的数量及密钥生成速度,计算每条所述密钥中继路径各中继节点的路径权值;根据每条所述密钥中继路径上最大的路径权值和中继节点的数量,确定最优的密钥中继路径;本发明解决密钥中继的密钥生成速率瓶颈问题,且路由计算方法简单,提高了并发性能。

The invention discloses a quantum cryptography network key relay dynamic routing method, device and system. The method includes querying all reachable key relay paths in the quantum cryptography network; selecting each key relay path on the key relay path. The relay node generates a derived key pool for the business assigned to the key relay path; based on the number of derived key pools generated by each relay node on each key relay path and the key generation speed , calculate the path weight of each relay node of each key relay path; determine the optimal key based on the maximum path weight and the number of relay nodes on each key relay path. relay path; the invention solves the key generation rate bottleneck problem of key relay, has a simple route calculation method and improves concurrency performance.

Description

量子密码网络密钥中继动态路由方法、装置及系统Quantum cryptography network key relay dynamic routing method, device and system

技术领域Technical field

本发明涉及量子通信技术领域,具体涉及一种量子密码网络密钥中继动态路由方法、装置及系统。The invention relates to the field of quantum communication technology, and in particular to a quantum cryptographic network key relay dynamic routing method, device and system.

背景技术Background technique

量子通信是近二十年发展起来的新型交叉学科,是量子理论和信息理论相结合的新的研究领域。物理学上,量子通信可以被理解为在物理极限下,利用量子效应实现的高性能通信。信息学上,则认为量子通信是利用量子力学的基本原理(如量子态不可克隆原理和量子态的测量塌缩性质等)或者利用量子态隐形传输等量子系统特有属性,以及量子测量的方法来完成两地之间的信息传递。量子通信因其具有无条件安全和高效率等特点,给信息安全带来了革命式的发展,是目前数据保密传输的主要研究方向。Quantum communication is a new interdisciplinary subject developed in the past two decades. It is a new research field that combines quantum theory and information theory. In physics, quantum communication can be understood as high-performance communication using quantum effects under physical limits. In informatics, it is believed that quantum communication uses the basic principles of quantum mechanics (such as the principle of non-cloning of quantum states and the measurement collapse properties of quantum states, etc.) or the unique properties of quantum systems such as quantum state teleportation, as well as quantum measurement methods. Complete information transfer between the two places. Quantum communication has brought revolutionary development to information security because of its unconditional security and high efficiency. It is currently the main research direction for secure data transmission.

以量子密钥分发(Quantum key distribution,QKD)协议为基础的量子密码技术是现阶段量子通信最重要的实际应用之一。传统的密码学是以数学为基础的密码体制,而量子密码是以量子力学为基础,它的安全性建立在测不准原理、量子的不可克隆及量子相干性等物理特性之上,被证明是绝对安全的,因此量子密码技术引起了学术界的高度重视。Quantum cryptography technology based on the Quantum Key Distribution (QKD) protocol is one of the most important practical applications of quantum communication at this stage. Traditional cryptography is a cryptography system based on mathematics, while quantum cryptography is based on quantum mechanics. Its security is based on physical properties such as the uncertainty principle, quantum non-cloning and quantum coherence, which has been proven It is absolutely safe, so quantum cryptography technology has attracted great attention from the academic community.

量子密码网络便是采用量子密码技术的一种安全通信网络,量子密码网络是由经典通信网络和量子密钥分发网络共同构建而成。量子密钥分发网络主要由量子密钥分发终端设备和量子链路组成,用于密钥的分发。经典通信网络使用量子密钥实现数据的加解密和加密数据的传输。一个量子密码网络节点一般是由连接于经典通信网络的经典通信终端和连接于量子通信网络的量子密钥分发设备终端组成,量子密码网络的网络节点一般分为终端节点和中继节点两种。由于量子通信最大距离的限制以及出于网络搭建成本的考虑,许多终端之间并不存在直连的量子链路,不能实现量子密钥的直接分发,它们之间的加密通信数据需要借助中继节点转发。Quantum cryptography network is a secure communication network that uses quantum cryptography technology. The quantum cryptography network is constructed by a classical communication network and a quantum key distribution network. The quantum key distribution network is mainly composed of quantum key distribution terminal equipment and quantum links, which are used for key distribution. Classical communication networks use quantum keys to encrypt and decrypt data and transmit encrypted data. A quantum cryptography network node is generally composed of a classical communication terminal connected to a classical communication network and a quantum key distribution equipment terminal connected to a quantum communication network. The network nodes of a quantum cryptography network are generally divided into terminal nodes and relay nodes. Due to the limitation of the maximum distance of quantum communication and the cost of network construction, there are no direct quantum links between many terminals, and the direct distribution of quantum keys cannot be achieved. The encrypted communication data between them requires the use of relays. Node forwarding.

规模较大的量子密码网络会具有大量的中继节点,终端节点间的加密通信数据会借助一个或几个中继节点进行中转,而且在数据中转时会有不同的可选的中继节点。如何对量子密码网络中任意两个节点的通信数据由初始节点到达目的节点所要按顺序经过的中继节点进行选择,称之为量子密码网络路由。A large-scale quantum cryptography network will have a large number of relay nodes. Encrypted communication data between terminal nodes will be relayed through one or several relay nodes, and there will be different optional relay nodes during data transfer. How to select the relay nodes that the communication data of any two nodes in the quantum cryptography network must pass through in order from the initial node to the destination node is called quantum cryptography network routing.

相关技术中,公布号为CN103001875A的专利申请文献公开了一种量子密码网络路由的完整解决方案,在该解决方案中,需要按照加权最短路径法则计算并确定目的中继节点为任意一个其他中继节点的通信数据的下一跳路由,其权值为路径上的密钥量,即在最短路径法则下,密钥量较大的路径为路由的下一跳。公布号为CN109962774A的专利申请文献中公开了一种量子密码网络密钥中继动态路由方法,在该路由方法中,中继路径的路径权值与该路径上的量子密钥供求程度有关,需要利用复杂的泊松分布,路由权值计算方式复杂。公布号为CN116418492A的专利申请文献所提出的路由建立方法,需要关注剩余可中继的密钥量,计算复杂。In related technology, the patent application document with publication number CN103001875A discloses a complete solution for quantum cryptographic network routing. In this solution, it is necessary to calculate and determine the destination relay node as any other relay according to the weighted shortest path rule. The weight of the next hop route of the node's communication data is the key amount on the path. That is, under the shortest path rule, the path with a larger key amount is the next hop of the route. The patent application document with publication number CN109962774A discloses a dynamic routing method for quantum cryptography network key relay. In this routing method, the path weight of the relay path is related to the degree of supply and demand of quantum keys on the path. It requires Using the complex Poisson distribution, the routing weight calculation method is complex. The route establishment method proposed in the patent application document with publication number CN116418492A requires attention to the amount of remaining keys that can be relayed, and the calculation is complicated.

实际上,路径上的密钥量并不能够真实反映本路径在下一个路由周期内满足数据路由加密的需求度,因为路径上的现存密钥量是否充足不但与密钥量相关,还与本路径的密钥消耗速度有关。上述提及的相关技术均未考虑远距离QKD中继成码率低的问题及密钥生成速度小于密钥消耗速度无法满足业务并发需求的情况,例如:在一百公里左右的距离上,基于BB84协议的QKD密钥成码率仅为1 Kbps左右,QKD成码率低下是由物理原理所决定的,QKD密钥协商要通过光子偏振态的制备、传输、偏振态过滤、检测、偏振态的一致性核对、密钥块奇偶校验等一系列操作,这个复杂的过程会进一步降低QKD的成码率。In fact, the amount of keys on the path cannot truly reflect the path's ability to meet the data routing encryption requirements in the next routing cycle, because whether the amount of existing keys on the path is sufficient is not only related to the amount of keys, but also to the path. related to the speed of key consumption. The related technologies mentioned above do not consider the problem of low code rate of long-distance QKD relay and the situation that the key generation speed is lower than the key consumption speed and cannot meet the business concurrency requirements. For example: at a distance of about one hundred kilometers, based on The QKD key code rate of the BB84 protocol is only about 1 Kbps. The low QKD code rate is determined by physical principles. QKD key negotiation requires the preparation, transmission, polarization filtering, detection, and polarization state of photons. A series of operations such as consistency check, key block parity check, etc. This complex process will further reduce the code rate of QKD.

另外复杂的路由计算算法,在高并发场景下存在密钥中继资源竞争带来的性能下降问题。In addition, complex routing calculation algorithms have performance degradation problems caused by competition for key relay resources in high concurrency scenarios.

发明内容Contents of the invention

本发明所要解决的技术问题在于如何解决密钥中继的密钥生成速率瓶颈问题。The technical problem to be solved by the present invention is how to solve the key generation rate bottleneck problem of key relay.

本发明通过以下技术手段解决上述技术问题的:The present invention solves the above technical problems through the following technical means:

第一方面,本发明提出了一种量子密码网络密钥中继动态路由方法,所述方法包括:In a first aspect, the present invention proposes a quantum cryptography network key relay dynamic routing method, which method includes:

查询量子密码网络中所有可达的密钥中继路径;Query all reachable key relay paths in the quantum cryptography network;

选定所述密钥中继路径上每个中继节点为分配到该所述密钥中继路径上的任务生成派生密钥池;Select each relay node on the key relay path to generate a derived key pool for tasks assigned to the key relay path;

根据每条所述密钥中继路径上各中继节点生成的派生密钥池的数量及密钥生成速度,计算每条所述密钥中继路径各中继节点的路径权值;Calculate the path weight of each relay node of each key relay path based on the number of derived key pools generated by each relay node on each key relay path and the key generation speed;

根据每条所述密钥中继路径上最大的路径权值和中继节点的数量,确定最优的密钥中继路径。The optimal key relay path is determined based on the maximum path weight and the number of relay nodes on each key relay path.

进一步地,所述查询量子密码网络中所有可达的密钥中继路径,包括:Further, the query for all reachable key relay paths in the quantum cryptography network includes:

向密码管理服务平台查询本端业务系统所属QKD节点和对端业务系统所属QKD节点的信息;Query the password management service platform for information about the QKD node to which the local business system belongs and the QKD node to which the opposite business system belongs;

接收所述密码管理服务平台返回的本端业务系统所属QKD节点的信息以及对端业务系统所属QKD节点的信息,并通过本端业务系统所属QKD节点对应的密钥管理器向QKDN控制器查询所述量子密码网络中所有可达的密钥中继路径。Receive the information returned by the password management service platform about the QKD node to which the local business system belongs and the information about the QKD node to which the opposite business system belongs, and query the QKDN controller through the key manager corresponding to the QKD node to which the local business system belongs. Describe all reachable key relay paths in the quantum cryptography network.

进一步地,所述选定所述密钥中继路径上每个中继节点为分配到该所述密钥中继路径上的任务生成派生密钥池,包括:Further, each relay node on the selected key relay path generates a derived key pool for the tasks assigned to the key relay path, including:

本端业务系统生成全局唯一的业务标识businessId,选定所述密钥中继路径上的每个中继节点初始化生成与该businessId相关的派生密钥池;The local business system generates a globally unique business identifier businessId, and selects each relay node on the key relay path to initialize and generate a derived key pool related to the businessId;

为分配到当前密钥中继路径的业务分配至少1个派生密钥池。Allocate at least 1 derived key pool for services assigned to the current key relay path.

进一步地,不同业务之间的派生密钥池相互隔离。Furthermore, the derived key pools between different services are isolated from each other.

进一步地,所述方法还包括:Further, the method also includes:

根据所述派生密钥池的扩容触发条件,对派生密钥池进行扩容;Expand the derived key pool according to the expansion trigger condition of the derived key pool;

所述扩容触发条件为在业务的密钥消耗速度达到密钥生成速度的a%时,或者派生密钥池的存量密钥低于阈值时,或者当已使用的派生密钥池达到总体派生密钥池的b%时。The expansion triggering condition is when the key consumption rate of the business reaches a% of the key generation rate, or when the stock keys of the derived key pool are lower than the threshold, or when the used derived key pool reaches the total derived key level. When b% of the key pool.

进一步地,所述方法还包括:Further, the method also includes:

根据所述派生密钥池的缩容触发条件,对派生密钥池进行缩容;Shrink the derived key pool according to the shrinkage triggering condition of the derived key pool;

所述缩容触发条件为连续m个时间窗口业务的消耗密钥速度低于密钥生成速度的c%时,或者当已使用的派生密钥池低于总体派生密钥池的d%时。The shrinkage triggering condition is when the key consumption speed of m consecutive time window services is lower than c% of the key generation speed, or when the used derived key pool is lower than d% of the overall derived key pool.

进一步地,所述派生密钥池为具有最大长度的先进先出队列FIFO结构。Further, the derived key pool is a first-in-first-out queue FIFO structure with a maximum length.

进一步地,所述方法还包括:Further, the method also includes:

采用PBKDF2算法生成派生密钥;Use the PBKDF2 algorithm to generate the derived key;

采用批量入队的方式将设定数量n个所述派生密钥增加至所述派生密钥池中,并将所述派生密钥池中原有的派生密钥作为历史派生密钥移出n个,对所述派生密钥池中的密钥进行更新。Add a set number n of the derived keys to the derived key pool by batch enqueuing, and remove n original derived keys in the derived key pool as historical derived keys, Update keys in the derived key pool.

进一步地,所述采用PBKDF2算法生成派生密钥的计算公式为:Further, the calculation formula for generating a derived key using the PBKDF2 algorithm is:

key=PBKDF2(password,salt,iterations-count,hash-function,derived-key-len)key=PBKDF2(password,salt,iterations-count,hash-function,derived-key-len)

其中,password为密码/口令;salt为密码学安全伪随机数组;iterations-count为迭代次数;hash-function为用于HMAC的散列函数;derived-key-len为派生密钥长度;PBKDF2( )为PBKDF2运算操作;key为派生密钥。Among them, password is the password/password; salt is a cryptographically secure pseudo-random array; iterations-count is the number of iterations; hash-function is the hash function used for HMAC; derived-key-len is the derived key length; PBKDF2( ) It is the PBKDF2 operation; key is the derived key.

进一步地,采用QKD中继产生的主密钥池中的随机密钥作为所述password;Further, use the random key in the master key pool generated by the QKD relay as the password;

采用作为所述salt;use As the salt;

以业务密钥池编号作为所述iterations-count,以SM3算法作为所述hash-function;Use the business key pool number as the iterations-count, and use the SM3 algorithm as the hash-function;

所述derived-key-len取值为128。The value of derived-key-len is 128.

进一步地,在业务并发调用派生密钥时,所述方法还包括:Further, when the business concurrently calls to derive the key, the method also includes:

根据业务标识进行Hash来将所述派生密钥分配到业务对应的派生密钥池中;Hash according to the business identifier to distribute the derived key to the derived key pool corresponding to the business;

采用CAS无锁机制对同一个业务对应的派生密钥池进行并发调用。The CAS lock-free mechanism is used to make concurrent calls to the derived key pool corresponding to the same business.

进一步地,所述采用CAS无锁机制对同一个业务对应的派生密钥池进行并发调用,包括:Further, the CAS lock-free mechanism is used to concurrently call the derived key pool corresponding to the same business, including:

为同一个派生密钥池分配唯一的顺序编号,对经过CAS无锁机制的业务对应的业务编号+1;Allocate a unique sequence number to the same derived key pool, and add 1 to the service number corresponding to the service that has passed the CAS lock-free mechanism;

将业务编号、派生密钥池编号、派生密钥池的密钥编号作为参数向QKD中继/协商的对端业务系统传递,进行派生密钥中继。Pass the service number, derived key pool number, and key number of the derived key pool as parameters to the peer business system of QKD relay/negotiation to perform derived key relay.

进一步地,对所述派生密钥池中的密钥进行更新时,CAS编号+n,并保留移出的n个历史派生密钥设定时长。Further, when the keys in the derived key pool are updated, the CAS number is +n, and the removed n historical derived keys are retained for a set duration.

进一步地,所述根据每条所述密钥中继路径上各中继节点生成的派生密钥池的数量及密钥生成速度,计算每条所述密钥中继路径各中继节点的路径权值,包括:Further, the path of each relay node of each key relay path is calculated based on the number of derived key pools generated by each relay node on each key relay path and the key generation speed. Weights, including:

基于滑动窗口计算每个中继节点的路径权值为:该中继节点生成的派生密钥池的数量/密钥生成速度。The path weight of each relay node is calculated based on the sliding window as: the number of derived key pools generated by the relay node/key generation speed.

进一步地,在中继节点未进行密钥派生时,将该中继节点对应的派生密钥池数量设为1。Further, when the relay node does not perform key derivation, the number of derived key pools corresponding to the relay node is set to 1.

进一步地,所述根据每条所述密钥中继路径上最大的路径权值和中继节点的数量,确定最优的密钥中继路径,包括:Further, determining the optimal key relay path based on the maximum path weight and the number of relay nodes on each key relay path includes:

根据每条所述密钥中继路径上最大的路径权值和中继节点的数量,计算对应的密钥中继路径的权重P = 中继节点数量λw,λ为控制权值比重的经验值,w为密钥中继路径上最大的路径权值,/>为相乘符号;According to the maximum path weight and the number of relay nodes on each key relay path, calculate the weight of the corresponding key relay path P = number of relay nodes λw, λ is the empirical value of the proportion of control weight, w is the largest path weight on the key relay path,/> is the multiplication sign;

将权重P值最小的密钥中继路径确定为最优的密钥中继路径。The key relay path with the smallest weight P value is determined as the optimal key relay path.

第二方面,本发明还提出了一种量子密码网络密钥中继动态路由装置,所述装置包括:In a second aspect, the present invention also proposes a quantum cryptography network key relay dynamic routing device, which includes:

中继路径查询模块,用于查询量子密码网络中所有可达的密钥中继路径;Relay path query module, used to query all reachable key relay paths in the quantum cryptography network;

派生模块,用于选定所述密钥中继路径上每个中继节点为分配到该所述密钥中继路径上的任务生成派生密钥池;A derivation module, configured to select each relay node on the key relay path to generate a derived key pool for tasks assigned to the key relay path;

路径权值计算模块,用于根据每条所述密钥中继路径上各中继节点生成的派生密钥池的数量及密钥生成速度,计算每条所述密钥中继路径各中继节点的路径权值;The path weight calculation module is used to calculate the number of derived key pools generated by each relay node on each key relay path and the key generation speed. The path weight of the node;

路径确定模块,用于根据每条所述密钥中继路径上最大的路径权值和中继节点的数量,确定最优的密钥中继路径。A path determination module is used to determine the optimal key relay path based on the maximum path weight and the number of relay nodes on each key relay path.

第三方面,本发明提出了一种量子密码网络密钥中继动态路由系统,所述系统包括量子密钥分发网络、密钥管理器、QKDN控制器、密钥管理系统和密码管理服务平台,密码管理服务平台与业务通信终端连接,所述业务通信终端用于执行如上所述的量子密码网络密钥中继动态路由方法。In the third aspect, the present invention proposes a quantum cryptographic network key relay dynamic routing system. The system includes a quantum key distribution network, a key manager, a QKDN controller, a key management system and a password management service platform. The password management service platform is connected to a business communication terminal, and the business communication terminal is used to execute the quantum cryptography network key relay dynamic routing method as described above.

本发明的优点在于:The advantages of the present invention are:

(1)本发明通过利用密钥中继路径上的中继节点为分配到该密钥中继路径上的任务生成派生密钥池,利用中继节点生成的派生密钥池的数量及密钥生成速度,计算每条密钥中继路径各中继节点的路径权值,从而确定最优的密钥中继路径,路由计算方法简单,性能更高,不同的业务使用单独的密钥池,不需要考虑多个业务共用一个密钥池并发加锁的问题,解决密钥中继的密钥生成速率瓶颈问题,且路由计算方法简单,提高了并发性能。(1) The present invention uses the relay nodes on the key relay path to generate a derived key pool for the tasks assigned to the key relay path, and uses the number of derived key pools and keys generated by the relay nodes. Generation speed, calculate the path weight of each relay node of each key relay path, thereby determining the optimal key relay path. The routing calculation method is simple and has higher performance. Different services use separate key pools. There is no need to consider the problem of concurrent locking of multiple services sharing a key pool, solving the key generation rate bottleneck problem of key relay, and the route calculation method is simple, improving concurrency performance.

本发明附加的方面和优点将在下面的描述中部分给出,部分将从下面的描述中变得明显,或通过本发明的实践了解到。Additional aspects and advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention.

附图说明Description of the drawings

图1是本发明一实施例提出的一种量子密码网络密钥中继动态路由方法的流程示意图;Figure 1 is a schematic flow chart of a quantum cryptography network key relay dynamic routing method proposed by an embodiment of the present invention;

图2是本发明一实施例提出的一种量子密码网络密钥中继动态路由装置的结构示意图;Figure 2 is a schematic structural diagram of a quantum cryptography network key relay dynamic routing device proposed by an embodiment of the present invention;

图3是本发明一实施例提出的一种量子密码网络密钥中继动态路由系统的结构示意图。Figure 3 is a schematic structural diagram of a quantum cryptography network key relay dynamic routing system proposed by an embodiment of the present invention.

具体实施方式Detailed ways

为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the embodiments of the present invention. Obviously, the described embodiments are part of the present invention. Examples, not all examples. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without making creative efforts fall within the scope of protection of the present invention.

如图1所示,本发明第一实施例公开了一种量子密码网络密钥中继动态路由方法,所述方法包括以下步骤:As shown in Figure 1, the first embodiment of the present invention discloses a quantum cryptography network key relay dynamic routing method. The method includes the following steps:

S10、查询量子密码网络中所有可达的密钥中继路径;S10. Query all reachable key relay paths in the quantum cryptography network;

S20、选定所述密钥中继路径上每个中继节点为分配到该所述密钥中继路径上的任务生成派生密钥池;S20. Select each relay node on the key relay path to generate a derived key pool for the tasks assigned to the key relay path;

S30、根据每条所述密钥中继路径上各中继节点生成的派生密钥池的数量及密钥生成速度,计算每条所述密钥中继路径各中继节点的路径权值;S30. Calculate the path weight of each relay node of each key relay path based on the number of derived key pools generated by each relay node on each key relay path and the key generation speed;

S40、根据每条所述密钥中继路径上最大的路径权值和中继节点的数量,确定最优的密钥中继路径。S40. Determine the optimal key relay path based on the maximum path weight and the number of relay nodes on each key relay path.

需要说明的是,本实施例通过利用密钥中继路径上的中继节点为分配到该密钥中继路径上的任务生成派生密钥池,利用中继节点生成的派生密钥池的数量及密钥生成速度,计算每条密钥中继路径各中继节点的路径权值,从而确定最优的密钥中继路径,通过采用派生密钥池的方式突破QKD中继的密钥成码率瓶颈,解决密钥中继的密钥生成速率瓶颈问题。It should be noted that in this embodiment, the relay node on the key relay path is used to generate a derived key pool for the tasks assigned to the key relay path, and the number of derived key pools generated by the relay node is used. and key generation speed, calculate the path weight of each relay node of each key relay path, thereby determining the optimal key relay path, and breaking through the key generation of QKD relay by using a derived key pool. Code rate bottleneck solves the key generation rate bottleneck problem of key relay.

在一实施例中,所述步骤S10:查询量子密码网络中所有可达的密钥中继路径,包括以下步骤:In one embodiment, the step S10: querying all reachable key relay paths in the quantum cryptography network includes the following steps:

S11、向密码管理服务平台查询本端业务系统所属QKD节点和对端业务系统所属QKD节点的信息;S11. Query the password management service platform for information about the QKD node to which the local business system belongs and the QKD node to which the opposite business system belongs;

S12、接收所述密码管理服务平台返回的本端业务系统所属QKD节点的信息以及对端业务系统所属QKD节点的信息,并通过本端业务系统所属QKD节点对应的密钥管理器向QKDN控制器查询所述量子密码网络中所有可达的密钥中继路径。S12. Receive the information returned by the password management service platform about the QKD node to which the local business system belongs and the information about the QKD node to which the opposite business system belongs, and provide the information to the QKDN controller through the key manager corresponding to the QKD node to which the local business system belongs. Query all reachable key relay paths in the quantum cryptography network.

具体地,假如业务系统A作为业务发起方向密码管理服务平台(CMSP)查询本节点(起始点)和对端业务系统B(终点)的QKD节点信息;业务系统A携带量子密钥网络路由的起始点和终点信息通过本节点对应的密钥管理器(KM)向QKDN控制器查询所述量子密码网络中所有可达的密钥中继路径。Specifically, if business system A serves as the business initiating direction password management service platform (CMSP) to query the QKD node information of this node (starting point) and the opposite end business system B (end point); business system A carries the origin of quantum key network routing The start point and end point information queries the QKDN controller through the key manager (KM) corresponding to this node for all reachable key relay paths in the quantum cryptography network.

在一实施例中,所述步骤步骤S20:选定所述密钥中继路径上每个中继节点为分配到该所述密钥中继路径上的任务生成派生密钥池,包括以下步骤:In one embodiment, the step S20: selecting each relay node on the key relay path to generate a derived key pool for the tasks assigned to the key relay path includes the following steps: :

S21、本端业务系统生成全局唯一的业务标识businessId,选定所述密钥中继路径上的每个中继节点初始化生成与该businessId相关的派生密钥池;S21. The local business system generates a globally unique business identifier businessId, and selects each relay node on the key relay path to initialize and generate a derived key pool related to the businessId;

S22、为分配到当前密钥中继路径的业务分配至少1个派生密钥池。S22. Allocate at least one derived key pool to the services assigned to the current key relay path.

具体地,本端业务系统即业务发起方生成全局唯一的业务标识businessId,businessId按雪花算法生成一个64位比特位的唯一id,id为long类型的,业务标识的最高1位固定值0,接下来是41位存储毫秒级时间戳,再接下来是12位中继节点码,包括6位起始节点和6位终点,再接下来是6位存储机器码workerId(datacenterId和起始节点一致,故省略),最后4位存储序列号;同一毫秒时间戳时,通过这个递增的序列号来区分,并不是每次进行密钥协商都需要重新建立中继链路,因此并发要求没有那么高Specifically, the local business system, that is, the business initiator, generates a globally unique business identifier businessId. The businessId generates a 64-bit unique id according to the snowflake algorithm. The id is of long type, and the highest digit of the business identifier has a fixed value of 0. Next is a 41-bit storage millisecond timestamp, followed by a 12-bit relay node code, including a 6-bit starting node and a 6-bit end point, and then a 6-bit machine code workerId (datacenterId is consistent with the starting node, Therefore, it is omitted), and the last 4 bits store the sequence number; when the same millisecond timestamp is used, it is distinguished by this incremental sequence number. The relay link does not need to be re-established every time the key negotiation is performed, so the concurrency requirements are not that high.

在一实施例中,选定密钥中继链路上的每个中继节点初始化生成与该businessId相关的派生密钥池,初始化生成(一般n≥3)个派生密钥池,为已分配到当前密钥中继路径的业务分配至少1个派生密钥池,且业务之间的派生密钥池相互隔离。In one embodiment, each relay node on the selected key relay link initializes and generates a derived key pool related to the businessId. The initial generation (Generally n ≥ 3) derived key pools, allocate at least 1 derived key pool to the services that have been assigned to the current key relay path, and the derived key pools between services are isolated from each other.

在一实施例中,所述方法还包括以下步骤:In one embodiment, the method further includes the following steps:

根据所述派生密钥池的扩容触发条件,对派生密钥池进行扩容;Expand the derived key pool according to the expansion trigger condition of the derived key pool;

所述扩容触发条件为在业务的密钥消耗速度达到密钥生成速度的a%时,或者派生密钥池的存量密钥低于阈值时,或者当已使用的派生密钥池达到总体派生密钥池的b%时。The expansion triggering condition is when the key consumption rate of the business reaches a% of the key generation rate, or when the stock keys of the derived key pool are lower than the threshold, or when the used derived key pool reaches the total derived key level. When b% of the key pool.

具体地,当该业务的密钥消耗速度达到密钥生成速度的75%时触发2倍数的派生密钥池扩容或者派生密钥池的存量密钥低于阈值(比如派生密钥池的最大长度的10%)触发2倍数,当已使用的派生密钥池达到总体派生密钥池的80%时触发总体派生密钥池的2倍数扩容。本实施例通过对派生密钥池进行扩容,提高并发能力,以便提前分配资源防止业务使用时等待密钥派生。Specifically, when the key consumption rate of the business reaches 75% of the key generation rate, a 2-fold expansion of the derived key pool is triggered or the existing keys in the derived key pool are lower than the threshold (such as the maximum length of the derived key pool). 10%) triggers a 2-fold expansion, and when the used derived key pool reaches 80% of the overall derived key pool, a 2-fold expansion of the overall derived key pool is triggered. This embodiment improves the concurrency capability by expanding the derived key pool, so as to allocate resources in advance to prevent waiting for key derivation during business use.

在一实施例中,所述方法还包括以下步骤:In one embodiment, the method further includes the following steps:

根据所述派生密钥池的缩容触发条件,对派生密钥池进行缩容;Shrink the derived key pool according to the shrinkage triggering condition of the derived key pool;

所述缩容触发条件为连续m个时间窗口业务的消耗密钥速度低于密钥生成速度的c%时,或者当已使用的派生密钥池低于总体派生密钥池的d%时。The shrinkage triggering condition is when the key consumption speed of m consecutive time window services is lower than c% of the key generation speed, or when the used derived key pool is lower than d% of the overall derived key pool.

具体地,在连续m(m为一经验值,取值为3~5)个时间窗口业务的消耗密钥速度低于密钥生成速度的25%时触发2倍数的缩容,当已使用的派生密钥池低于总体派生密钥池的20%时触发总体派生密钥池的2倍数缩容,释放资源,降低成本。Specifically, when the key consumption speed of the business in consecutive m (m is an empirical value, ranging from 3 to 5) time windows is lower than 25% of the key generation speed, a 2-fold reduction is triggered. When the used When the derived key pool is less than 20% of the overall derived key pool, a 2-fold reduction in the overall derived key pool is triggered to release resources and reduce costs.

在一实施例中,所述派生密钥池为具有最大长度的先进先出队列FIFO结构。In one embodiment, the derived key pool is a first-in-first-out queue FIFO structure with a maximum length.

具体地,本实施例中的派生密钥池是具有最大长度40k(40960个)密钥的FIFO(先进先出队列)结构,当派生密钥池达到最大长度时,新的派生密钥加入队列尾部,抛弃队列头部的派生密钥,派生密钥池的最大长度太长则派生密钥的存留时间越长,存在被暴力破解的风险,最大长度太短,则会存在派生密钥池的频繁扩容或者业务请求密钥使用等待QKD密钥协商的情况,因此派生密钥池中的最大长度一般采用5~10s内主密钥池的密钥生成量。Specifically, the derived key pool in this embodiment is a FIFO (first in first out queue) structure with a maximum length of 40k (40960) keys. When the derived key pool reaches the maximum length, a new derived key is added to the queue At the end, the derived key at the head of the queue is discarded. If the maximum length of the derived key pool is too long, the derived key will last longer, and there is a risk of being cracked by brute force. If the maximum length is too short, there will be a problem with the derived key pool. In the case of frequent expansion or business requesting key use and waiting for QKD key negotiation, the maximum length in the derived key pool generally adopts the key generation amount of the master key pool within 5 to 10 seconds.

本实施例中派生密钥池是具有最大长度FIFO的结构,合理的最大长度能保护派生密钥的时效,防止暴力破解。In this embodiment, the derived key pool is a FIFO structure with a maximum length. A reasonable maximum length can protect the validity of the derived key and prevent brute force cracking.

在一实施例中,所述方法还包括对派生密钥池中的密钥进行更新,包括以下步骤:In one embodiment, the method further includes updating the key in the derived key pool, including the following steps:

采用PBKDF2算法生成派生密钥;Use the PBKDF2 algorithm to generate the derived key;

采用批量入队的方式将设定数量n个所述派生密钥增加至所述派生密钥池中,并将所述派生密钥池中原有的派生密钥作为历史派生密钥移出n个,对所述派生密钥池中的密钥进行更新。Add a set number n of the derived keys to the derived key pool by batch enqueuing, and remove n original derived keys in the derived key pool as historical derived keys, Update keys in the derived key pool.

具体地,随着QKD密钥中继的密钥协商的主密钥池不断协商产生新密钥,派生密钥池采用批量入队的方式更新密钥,一次在FIFO队列的尾部增加4k(4096个)派生密钥,并将队列头部的4k(4096个)派生密钥抛弃,这里n取值可为4096。Specifically, as the master key pool of the key negotiation of the QKD key relay continuously negotiates to generate new keys, the derived key pool updates the keys in batches, adding 4k (4096) to the end of the FIFO queue at a time. ) derived keys, and discard the 4k (4096) derived keys at the head of the queue, where n can be 4096.

在一实施例中,所述采用PBKDF2算法生成派生密钥的计算公式为:In one embodiment, the calculation formula for generating a derived key using the PBKDF2 algorithm is:

key=PBKDF2(password,salt,iterations-count,hash-function,derived-key-len)key=PBKDF2(password,salt,iterations-count,hash-function,derived-key-len)

其中,password为密码/口令;salt为密码学安全伪随机数组;iterations-count为迭代次数;hash-function为用于HMAC的散列函数;derived-key-len为派生密钥长度;PBKDF2( )为PBKDF2运算操作;key为派生密钥。Among them, password is the password/password; salt is a cryptographically secure pseudo-random array; iterations-count is the number of iterations; hash-function is the hash function used for HMAC; derived-key-len is the derived key length; PBKDF2( ) It is the PBKDF2 operation; key is the derived key.

在一实施例中,采用QKD中继产生的主密钥池中的随机密钥作为所述password;In one embodiment, a random key in the master key pool generated by the QKD relay is used as the password;

采用作为所述salt可增加随机性;use As the salt can increase randomness;

以业务密钥池编号作为所述iterations-count,以SM3作为所述hash-function;Use the business key pool number as the iterations-count and SM3 as the hash-function;

所述derived-key-len取值为128。The value of derived-key-len is 128.

需要说明的是,PBKDF2(Password-Based Key Derivation Function)算法是一种简单的密钥派生算法,在迭代次数较低的情况下具有较高的密钥生成效率,以满足高并发业务场景的需求。且由于可信中继节点为独立的物理机,不存在类似云端的共享计算问题,节点之间的QKD网络也有别于经典信道,因此可以不考虑内存时序(memory-timing)侧信道攻击(side-channel attacks)带来的威胁。It should be noted that the PBKDF2 (Password-Based Key Derivation Function) algorithm is a simple key derivation algorithm with high key generation efficiency when the number of iterations is low to meet the needs of high-concurrency business scenarios. . And because the trusted relay nodes are independent physical machines, there is no shared computing problem similar to the cloud. The QKD network between nodes is also different from the classic channel, so memory-timing side channel attacks can not be considered. -threats posed by channel attacks).

另外由于密钥派生的password是真随机数,盐值和业务相关,不同业务的派生密钥是隔离的,盐值和password进行异或确保了盐的随机性,同时密钥中继过程中是一次一密、用后废弃的,派生密钥池采用的是具有最大长度的FIFO的队列结构,有时效限制,因此即便遭受ASIC攻击(ASIC-resistant)或者FPGA攻击(FPGA-resistant),一方面GPU暴力破解的时效性达不到攻击要求,另一方面需要暴力破解整条中继链路的派生密钥才能获取最终的协商密钥,单个节点之间的派生密钥暴露不影响整体安全性。In addition, since the password derived from the key is a truly random number, the salt value is related to the business, and the derived keys for different services are isolated. The XOR of the salt value and the password ensures the randomness of the salt. At the same time, the key relay process is One-time padding is discarded after use. The derived key pool uses a FIFO queue structure with a maximum length and is time-limited. Therefore, even if it is attacked by ASIC (ASIC-resistant) or FPGA (FPGA-resistant), on the one hand The timeliness of GPU brute force cracking cannot meet the attack requirements. On the other hand, it is necessary to brute force the derived key of the entire relay link to obtain the final negotiation key. The exposure of the derived key between individual nodes does not affect the overall security. .

在一实施例中,在业务并发调用派生密钥时,所述方法还包括以下步骤:In one embodiment, when the business concurrently calls to derive the key, the method further includes the following steps:

根据业务标识进行Hash来将所述派生密钥分配到业务对应的派生密钥池中;Hash according to the business identifier to distribute the derived key to the derived key pool corresponding to the business;

采用CAS无锁机制对同一个业务对应的派生密钥池进行并发调用。The CAS lock-free mechanism is used to make concurrent calls to the derived key pool corresponding to the same business.

本实施例在业务并发调用派生密钥时,根据业务唯一标识进行Hash来分配到业务对应的派生密钥池,同一个业务派生密钥池在并发调用时采用CAS(Compare And Swap)的无锁方式,通过采用密钥协商和密钥使用分离的方式加快密钥调用效率,调用时采用CAS的无锁方式提高并发效率。In this embodiment, when the business calls the derived key concurrently, Hash is performed based on the unique business identifier to distribute it to the derived key pool corresponding to the business. The same business derived key pool uses the lock-free CAS (Compare And Swap) method during concurrent calls. This method speeds up key calling efficiency by separating key negotiation and key usage, and uses CAS's lock-free method to improve concurrency efficiency when calling.

在一实施例中,所述采用CAS无锁机制对同一个业务对应的派生密钥池进行并发调用,包括:In one embodiment, the CAS lock-free mechanism is used to concurrently call the derived key pool corresponding to the same business, including:

为同一个派生密钥池分配唯一的顺序编号,对经过CAS无锁机制的业务对应的业务编号+1;Allocate a unique sequence number to the same derived key pool, and add 1 to the service number corresponding to the service that has passed the CAS lock-free mechanism;

将业务编号、派生密钥池编号、派生密钥池的密钥编号作为参数向QKD中继/协商的对端业务系统传递,进行派生密钥中继。Pass the service number, derived key pool number, and key number of the derived key pool as parameters to the peer business system of QKD relay/negotiation to perform derived key relay.

需要说明的是,本实施例为同一个派生密钥池分配唯一的顺序编号,业务经过CAS获取编号+1,并将业务编号、派生密钥池编号、派生密钥池的密钥编号作为参数向QKD中继/协商的对端传递,避免派生密钥调用的顺序混乱。It should be noted that this embodiment allocates a unique sequence number to the same derived key pool. The business obtains the number + 1 through CAS, and uses the business number, the derived key pool number, and the key number of the derived key pool as parameters. Passed to the QKD relay/negotiation peer to avoid confusion in the order of derived key calls.

在一实施例中,对所述派生密钥池中的密钥进行更新时,CAS编号+n,并保留移出的n个历史派生密钥设定时长。In one embodiment, when the keys in the derived key pool are updated, the CAS number is +n, and the removed n historical derived keys are retained for a set duration.

本实施例在派生密钥批量更新时CAS编号+4096,为了防止派生密钥批量更新过程正在进行派生密钥中继,短暂保留出队的4096个历史派生密钥,CAS编号每天归零。In this embodiment, the CAS number is +4096 when the derived keys are updated in batches. In order to prevent the derived keys from being relayed during the batch update of derived keys, the 4096 historical derived keys that have been dequeued are temporarily retained, and the CAS number is reset to zero every day.

需要说明的是,历史派生密钥的保留时间跟密钥生成速度有关,4096个密钥的生成时间,一般不超过5s,如果生成速率特别慢的,安全起见最大不超过10s。It should be noted that the retention time of historical derived keys is related to the key generation speed. The generation time of 4096 keys generally does not exceed 5 seconds. If the generation rate is particularly slow, the maximum time for security is no more than 10 seconds.

在一实施例中,所述步骤S30:根据每条所述密钥中继路径上各中继节点生成的派生密钥池的数量及密钥生成速度,计算每条所述密钥中继路径各中继节点的路径权值,包括以下步骤:In one embodiment, the step S30: Calculate each key relay path based on the number of derived key pools generated by each relay node on each key relay path and the key generation speed. The path weight of each relay node includes the following steps:

基于滑动窗口计算每个中继节点的路径权值为:该中继节点生成的派生密钥池的数量/密钥生成速度。The path weight of each relay node is calculated based on the sliding window as: the number of derived key pools generated by the relay node/key generation speed.

需要说明的是,如果存在多条中继路径,则基于滑动窗口计算所述密钥中继路径上所有中继节点的路径权值:已派生密钥池数量/密钥生成速度,权值越小路径越短。It should be noted that if there are multiple relay paths, the path weights of all relay nodes on the key relay path are calculated based on the sliding window: number of derived key pools/key generation speed, the greater the weight Small paths are shorter.

进一步地,如果中继节点未进行任何密钥派生,则已派生密钥池数量设为1。Further, if the relay node does not perform any key derivation, the number of derived key pools is set to 1.

在一实施例中,所述步骤S40:根据每条所述密钥中继路径上最大的路径权值和中继节点的数量,确定最优的密钥中继路径,包括以下步骤:In one embodiment, the step S40: Determine the optimal key relay path based on the maximum path weight and the number of relay nodes on each key relay path, including the following steps:

S41、根据每条所述密钥中继路径上最大的路径权值和中继节点的数量,计算对应的密钥中继路径的权重P = 中继节点数量λw,λ为控制权值比重的经验值,w为密钥中继路径上最大的路径权值,/>为相乘符号;S41. Based on the maximum path weight and the number of relay nodes on each key relay path, calculate the weight of the corresponding key relay path P = number of relay nodes λw, λ is the empirical value of the proportion of control weight, w is the largest path weight on the key relay path,/> is the multiplication sign;

S42、将权重P值最小的密钥中继路径确定为最优的密钥中继路径。S42. Determine the key relay path with the smallest weight P value as the optimal key relay path.

需要说明的是,按照木桶效应,找到每条路径中的最大权值w,计算每条密钥中继路径的权重P,P越小代表路径越优,选定P值最小的最优路径。It should be noted that according to the barrel effect, find the maximum weight w in each path, and calculate the weight P of each key relay path. The smaller P means the better the path, and the optimal path with the smallest P value is selected. .

如图2所示,本发明第二实施例公开了一种量子密码网络密钥中继动态路由装置,所述装置包括:As shown in Figure 2, the second embodiment of the present invention discloses a quantum cryptography network key relay dynamic routing device. The device includes:

中继路径查询模块10,用于查询量子密码网络中所有可达的密钥中继路径;The relay path query module 10 is used to query all reachable key relay paths in the quantum cryptography network;

派生模块20,用于选定所述密钥中继路径上每个中继节点为分配到该所述密钥中继路径上的任务生成派生密钥池;The derivation module 20 is configured to select each relay node on the key relay path to generate a derived key pool for the tasks assigned to the key relay path;

路径权值计算模块30,用于根据每条所述密钥中继路径上各中继节点生成的派生密钥池的数量及密钥生成速度,计算每条所述密钥中继路径各中继节点的路径权值;The path weight calculation module 30 is used to calculate the weight of each key relay path based on the number of derived key pools generated by each relay node on each key relay path and the key generation speed. The path weight of the following node;

路径确定模块40,用于根据每条所述密钥中继路径上最大的路径权值和中继节点的数量,确定最优的密钥中继路径。The path determination module 40 is used to determine the optimal key relay path based on the maximum path weight and the number of relay nodes on each key relay path.

在一实施例中,所述中继路径查询模块10,具体用于:In one embodiment, the relay path query module 10 is specifically used to:

向密码管理服务平台查询本端业务系统所属QKD节点和对端业务系统所属QKD节点的信息;Query the password management service platform for information about the QKD node to which the local business system belongs and the QKD node to which the opposite business system belongs;

接收所述密码管理服务平台返回的本端业务系统所属QKD节点的信息以及对端业务系统所属QKD节点的信息,并通过本端业务系统所属QKD节点对应的密钥管理器向QKDN控制器查询所述量子密码网络中所有可达的密钥中继路径。Receive the information returned by the password management service platform about the QKD node to which the local business system belongs and the information about the QKD node to which the opposite business system belongs, and query the QKDN controller through the key manager corresponding to the QKD node to which the local business system belongs. Describe all reachable key relay paths in the quantum cryptography network.

在一实施例中,所述派生模块20,包括:In one embodiment, the derivation module 20 includes:

初始化单元,用于本端业务系统生成全局唯一的业务标识businessId,选定所述密钥中继路径上的每个中继节点初始化生成与该businessId相关的派生密钥池;An initialization unit, used for the local business system to generate a globally unique business identifier businessId, and select each relay node on the key relay path to initialize and generate a derived key pool related to the businessId;

分配单元,用于为分配到当前密钥中继路径的业务分配至少1个派生密钥池。The allocation unit is used to allocate at least 1 derived key pool for services allocated to the current key relay path.

在一实施例中,不同业务之间的派生密钥池相互隔离。In one embodiment, the derived key pools between different services are isolated from each other.

在一实施例中,所述装置还包括扩容模块,具体用于:In one embodiment, the device further includes a capacity expansion module, specifically used for:

根据所述派生密钥池的扩容触发条件,对派生密钥池进行扩容;Expand the derived key pool according to the expansion trigger condition of the derived key pool;

所述扩容触发条件为在业务的密钥消耗速度达到密钥生成速度的a%时,或者派生密钥池的存量密钥低于阈值时,或者当已使用的派生密钥池达到总体派生密钥池的b%时。The expansion triggering condition is when the key consumption rate of the business reaches a% of the key generation rate, or when the stock keys of the derived key pool are lower than the threshold, or when the used derived key pool reaches the total derived key level. When b% of the key pool.

在一实施例中,所述装置还包括缩容模块,具体用于:In one embodiment, the device further includes a capacity reduction module, specifically used for:

根据所述派生密钥池的缩容触发条件,对派生密钥池进行缩容;Shrink the derived key pool according to the shrinkage triggering condition of the derived key pool;

所述缩容触发条件为连续m个时间窗口业务的消耗密钥速度低于密钥生成速度的c%时,或者当已使用的派生密钥池低于总体派生密钥池的d%时。The shrinkage triggering condition is when the key consumption speed of m consecutive time window services is lower than c% of the key generation speed, or when the used derived key pool is lower than d% of the overall derived key pool.

在一实施例中,所述派生密钥池为具有最大长度的先进先出队列FIFO结构。In one embodiment, the derived key pool is a first-in-first-out queue FIFO structure with a maximum length.

在一实施例中,所述装置还包括密钥更新模块,具体用于:In one embodiment, the device further includes a key update module, specifically used for:

采用PBKDF2算法生成派生密钥;Use the PBKDF2 algorithm to generate the derived key;

采用批量入队的方式将设定数量n个所述派生密钥增加至所述派生密钥池中,并将所述派生密钥池中原有的派生密钥作为历史派生密钥移出n个,对所述派生密钥池中的密钥进行更新。Add a set number n of the derived keys to the derived key pool by batch enqueuing, and remove n original derived keys in the derived key pool as historical derived keys, Update keys in the derived key pool.

在一实施例中,所述采用PBKDF2算法生成派生密钥的计算公式为:In one embodiment, the calculation formula for generating a derived key using the PBKDF2 algorithm is:

key=PBKDF2(password,salt,iterations-count,hash-function,derived-key-len)key=PBKDF2(password,salt,iterations-count,hash-function,derived-key-len)

其中,password为密码或口令;salt为密码学安全伪随机数组;iterations-count为迭代次数;hash-function为用于HMAC的散列函数;derived-key-len为派生密钥长度;PBKDF2( )为PBKDF2运算操作;key为派生密钥。Among them, password is a password or password; salt is a cryptographically secure pseudo-random array; iterations-count is the number of iterations; hash-function is the hash function used for HMAC; derived-key-len is the derived key length; PBKDF2( ) It is the PBKDF2 operation; key is the derived key.

在一实施例中,采用QKD中继产生的主密钥池中的随机密钥作为所述password;In one embodiment, a random key in the master key pool generated by the QKD relay is used as the password;

采用作为所述salt;use As the salt;

以业务密钥池编号作为所述iterations-count,以SM3作为所述hash-function;Use the business key pool number as the iterations-count and SM3 as the hash-function;

所述derived-key-len取值为128。The value of derived-key-len is 128.

在一实施例中,所述装置还包括密钥调用模块,用于:In one embodiment, the device further includes a key calling module for:

派生密钥分配单元,用于根据业务标识进行Hash来将所述派生密钥分配到业务对应的派生密钥池中;A derived key distribution unit, configured to perform Hash according to the service identifier to distribute the derived key to the derived key pool corresponding to the service;

调用单元,用于采用CAS无锁机制对同一个业务对应的派生密钥池进行并发调用。The calling unit is used to make concurrent calls to the derived key pool corresponding to the same business using the CAS lock-free mechanism.

在一实施例中,所述调用单元,具体用于:In one embodiment, the calling unit is specifically used to:

为同一个派生密钥池分配唯一的顺序编号,对经过CAS无锁机制的业务对应的业务编号+1;Allocate a unique sequence number to the same derived key pool, and add 1 to the service number corresponding to the service that has passed the CAS lock-free mechanism;

将业务编号、派生密钥池编号、派生密钥池的密钥编号作为参数向QKD中继/协商的对端业务系统传递,进行派生密钥中继。Pass the service number, derived key pool number, and key number of the derived key pool as parameters to the peer business system of QKD relay/negotiation to perform derived key relay.

在一实施例中,对所述派生密钥池中的密钥进行更新时,CAS编号+n,并保留移出的n个历史派生密钥设定时长。In one embodiment, when the keys in the derived key pool are updated, the CAS number is +n, and the removed n historical derived keys are retained for a set duration.

在一实施例中,所述路径权值计算模块30,用于基于滑动窗口计算每个中继节点的路径权值为:该中继节点生成的派生密钥池的数量/密钥生成速度。In one embodiment, the path weight calculation module 30 is configured to calculate the path weight of each relay node based on the sliding window as: the number of derived key pools generated by the relay node/key generation speed.

在一实施例中,在中继节点未进行密钥派生时,将该中继节点对应的派生密钥池数量设为1。In one embodiment, when the relay node does not perform key derivation, the number of derived key pools corresponding to the relay node is set to 1.

在一实施例中,所述路径确定模块40,包括:In one embodiment, the path determination module 40 includes:

权重计算单元,用于根据每条所述密钥中继路径上最大的路径权值和中继节点的数量,计算对应的密钥中继路径的权重P = 中继节点数量λw,λ为控制权值比重的经验值,w为密钥中继路径上最大的路径权值,/>为相乘符号;A weight calculation unit, used to calculate the weight of the corresponding key relay path based on the maximum path weight and the number of relay nodes on each key relay path P = number of relay nodes λw, λ is the empirical value of the proportion of control weight, w is the largest path weight on the key relay path,/> is the multiplication sign;

路径确定单元,用于将权重P值最小的密钥中继路径确定为最优的密钥中继路径。The path determination unit is used to determine the key relay path with the smallest weight P value as the optimal key relay path.

需要说明的是,本发明所述量子密码网络密钥中继动态路由装置的其他实施例或具有实现方法可参照上述各方法实施例,此处不再赘余。It should be noted that for other embodiments of the quantum cryptography network key relay dynamic routing device of the present invention or implementation methods, please refer to the above method embodiments, and no redundancy is required here.

如图3所示,本发明第三实施例公开了一种量子密码网络密钥中继动态路由系统,所述系统包括量子密钥分发网络、密钥管理器、QKDN控制器、密钥管理系统和密码管理服务平台,量子密钥分发网络经密钥管理器与密钥管理系统连接,密钥管理器与QKDN控制器连接,密码管理服务平台与业务通信终端连接,所述业务通信终端用于执行如上第一实施例所述的量子密码网络密钥中继动态路由方法。As shown in Figure 3, the third embodiment of the present invention discloses a quantum cryptography network key relay dynamic routing system. The system includes a quantum key distribution network, a key manager, a QKDN controller, and a key management system. And the password management service platform, the quantum key distribution network is connected to the key management system through the key manager, the key manager is connected to the QKDN controller, the password management service platform is connected to the business communication terminal, and the business communication terminal is used for The quantum cryptography network key relay dynamic routing method as described in the first embodiment is executed.

具体地,量子密钥分发模块(QKD)用于实现与连接节点量子密钥分发模块的量子密钥分发,使双方获得密钥对。Specifically, the quantum key distribution module (QKD) is used to implement quantum key distribution with the quantum key distribution module of the connecting node, so that both parties can obtain a key pair.

密钥管理器(KM)用于负责接收和管理由QKD生成的密钥对密钥进行中继并将密钥提供给需要密码的应用。The Key Manager (KM) is responsible for receiving and managing keys generated by QKD, relaying keys and providing keys to applications that require passwords.

QKDN控制器用于QKDN控制器负责控制QKD网络的各种资源,以确保 QKD 网络安全、稳定、高效、鲁棒的运行。The QKDN controller is used to control various resources of the QKD network to ensure the safe, stable, efficient and robust operation of the QKD network.

密钥管理系统(KMS)用于负责创建和管理密钥,保护密钥的保密性、完整性和可用性,满足应用、业务的密钥管理需求。Key management system (KMS) is responsible for creating and managing keys, protecting the confidentiality, integrity and availability of keys, and meeting the key management needs of applications and businesses.

密码管理服务平台(CMSP)用于负责密钥管理系统(KMS)的路由控制、资源调度等。The Password Management Service Platform (CMSP) is responsible for the routing control, resource scheduling, etc. of the Key Management System (KMS).

在本说明书的描述中,参考术语“一个实施例”、“一些实施例”、“示例”、“具体示例”、或“一些示例”等的描述意指结合该实施例或示例描述的具体特征、结构、材料或者特点包含于本发明的至少一个实施例或示例中。在本说明书中,对上述术语的示意性表述不一定指的是相同的实施例或示例。而且,描述的具体特征、结构、材料或者特点可以在任何的一个或多个实施例或示例中以合适的方式结合。In the description of this specification, reference to the terms "one embodiment," "some embodiments," "an example," "specific examples," or "some examples" or the like means that specific features are described in connection with the embodiment or example. , structures, materials or features are included in at least one embodiment or example of the invention. In this specification, schematic representations of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.

此外,术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括至少一个该特征。在本发明的描述中,“多个”的含义是至少两个,例如两个,三个等,除非另有明确具体的限定。In addition, the terms “first” and “second” are used for descriptive purposes only and cannot be understood as indicating or implying relative importance or implicitly indicating the quantity of indicated technical features. Therefore, features defined as "first" and "second" may explicitly or implicitly include at least one of these features. In the description of the present invention, "plurality" means at least two, such as two, three, etc., unless otherwise expressly and specifically limited.

尽管上面已经示出和描述了本发明的实施例,可以理解的是,上述实施例是示例性的,不能理解为对本发明的限制,本领域的普通技术人员在本发明的范围内可以对上述实施例进行变化、修改、替换和变型。Although the embodiments of the present invention have been shown and described above, it can be understood that the above-mentioned embodiments are illustrative and should not be construed as limitations of the present invention. Those of ordinary skill in the art can make modifications to the above-mentioned embodiments within the scope of the present invention. The embodiments are subject to changes, modifications, substitutions and variations.

Claims (18)

1. A quantum cryptography network key relay dynamic routing method, the method comprising:
inquiring all reachable key relay paths in the quantum cryptography network;
each relay node on the key relay path is selected to generate a derived key pool for the service distributed to the key relay path;
calculating the path weight of each relay node of each key relay path according to the number of derivative key pools generated by each relay node on each key relay path and the key generation speed;
and determining an optimal key relay path according to the maximum path weight value and the number of relay nodes on each key relay path.
2. The quantum cryptography network key relay dynamic routing method of claim 1, wherein querying all reachable key relay paths in the quantum cryptography network comprises:
inquiring information of a QKD node to which a local service system belongs and a QKD node to which a peer service system belongs from a password management service platform;
and receiving the information of the QKD node to which the local end service system belongs and the information of the QKD node to which the opposite end service system belongs, which are returned by the password management service platform, and inquiring all reachable key relay paths in the quantum password network to a QKDN controller through a key manager corresponding to the QKD node to which the local end service system belongs.
3. The method of claim 1, wherein each relay node on the selected key relay path generates a derived key pool for traffic allocated on the key relay path, comprising:
the local terminal service system generates a globally unique service identifier businessId, and each relay node on the key relay path is selected to generate a derivative key pool related to the businessId in an initializing mode;
at least 1 derived key pool is allocated for traffic allocated to the current key relay path.
4. A quantum cryptography network key relay dynamic routing method of claim 3 wherein the pools of derivative keys between different services are isolated from each other.
5. The quantum cryptography network key relay dynamic routing method of claim 1, further comprising:
expanding the capacity of the derived key pool according to the capacity expansion triggering condition of the derived key pool;
the capacity expansion triggering condition is when the key consumption speed of the service reaches a% of the key generation speed, or when the stock key of the derived key pool is lower than a threshold value, or when the used derived key pool reaches b% of the total derived key pool.
6. The quantum cryptography network key relay dynamic routing method of claim 1, further comprising:
carrying out capacity reduction on the derivative key pool according to the capacity reduction triggering condition of the derivative key pool;
the capacity reduction triggering condition is when the consumed key speed of continuous m time window services is lower than c% of the key generation speed, or when the used derivative key pool is lower than d% of the total derivative key pool.
7. The method of claim 1, wherein the derived key pool is a FIFO structure having a maximum length.
8. The quantum cryptography network key relay dynamic routing method of claim 1, further comprising:
generating a derivative key by adopting a PBKDF2 algorithm;
and adding the set number n of the derivative keys into the derivative key pool by adopting a batch enqueuing mode, removing n original derivative keys in the derivative key pool as historical derivative keys, and updating keys in the derivative key pool.
9. The method for dynamically routing the quantum cryptography network key relay of claim 8, wherein the calculation formula for generating the derivative key by using the PBKDF2 algorithm is as follows:
key=PBKDF2(password,salt,iterations-count,hash-function,derived-key-len)
wherein, the password is a password or a password; salt is a cryptographically secure pseudorandom number group; the iteration-count is the iteration number; hash-function is a hash function for HMAC; the derived-key-len is the derived key length; PBKDF2 () is the operation of PBKDF 2; key is a derivative key.
10. The quantum cryptography network key relay dynamic routing method of claim 9, wherein a random key in a master key pool generated by QKD relay is employed as the password;
by usingAs said salt,/->Is an exclusive or operation, | is a byte string connector;
taking a service key pool number as the interfaces-count, and taking an SM3 algorithm as the hash-function;
the determined-key-len takes a value of 128.
11. The quantum cryptography network key relay dynamic routing method of claim 1, wherein upon a traffic concurrency invocation of a derivative key, the method further comprises:
carrying out Hash according to the service identification to distribute the derivative key to a derivative key pool corresponding to the service;
and (3) adopting a CAS (control and access system) unlocking mechanism to carry out concurrent call on the derivative key pool corresponding to the same service.
12. The method for dynamically routing the quantum cryptography network key relay of claim 11, wherein the employing the CAS airless mechanism to make a concurrent call to the derivative key pool corresponding to the same service comprises:
a unique sequence number is allocated to the same derived key pool, and the service number +1 corresponding to the service passing through the CAS (CAS) non-lock mechanism is allocated;
and transmitting the service number, the derived key pool number and the key number of the derived key pool as parameters to a QKD relay or a negotiated opposite-end service system to perform the derived key relay.
13. The quantum cryptography network key relay dynamic routing method of claim 8, wherein CAS number +n is updated for keys in the derivative key pool and n history derivative key set durations of shifts are reserved.
14. The method for dynamically routing the key relay of the quantum cryptography network according to claim 1, wherein the calculating the path weight of each relay node of each key relay path according to the number of the derived key pools generated by each relay node on each key relay path and the key generation speed comprises:
the path weight of each relay node is calculated based on the sliding window as follows: the number of derived key pools generated by the relay node +..
15. The method of claim 14, wherein when the relay node does not derive the key, the number of derived key pools corresponding to the relay node is set to 1.
16. The method for dynamic routing of key relay in a quantum cryptography network of claim 1, wherein determining an optimal key relay path based on a maximum path weight and a number of relay nodes on each key relay path comprises:
according to the maximum path weight and the number of relay nodes on each key relay path, calculating the weight P=the number of relay nodes of the corresponding key relay pathλw, λ is the empirical value of the control weight ratio, w is the maximum path weight on the key relay path, +.>Is a multiplied symbol;
and determining the key relay path with the minimum weight P value as the optimal key relay path.
17. A quantum cryptography network key relay dynamic routing apparatus, the apparatus comprising:
the relay path inquiry module is used for inquiring all reachable key relay paths in the quantum cryptography network;
the deriving module is used for selecting each relay node on the key relay path to generate a deriving key pool for the service distributed on the key relay path;
the path weight calculation module is used for calculating the path weight of each relay node of each key relay path according to the number of derivative key pools generated by each relay node on each key relay path and the key generation speed;
and the path determining module is used for determining the optimal key relay path according to the maximum path weight and the number of relay nodes on each key relay path.
18. The system is characterized by comprising a quantum key distribution network, a key manager, a QKDN controller, a key management system and a password management service platform, wherein the password management service platform is connected with a service communication terminal, and the service communication terminal is used for executing the quantum password network key relay dynamic routing method according to any one of claims 1-16.
CN202311426981.1A 2023-10-31 2023-10-31 Quantum cryptography network key relay dynamic routing method, device and system Active CN117176345B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202311426981.1A CN117176345B (en) 2023-10-31 2023-10-31 Quantum cryptography network key relay dynamic routing method, device and system
PCT/CN2024/107650 WO2025092052A1 (en) 2023-10-31 2024-07-25 Quantum cryptographic network key relay dynamic routing method, device, and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311426981.1A CN117176345B (en) 2023-10-31 2023-10-31 Quantum cryptography network key relay dynamic routing method, device and system

Publications (2)

Publication Number Publication Date
CN117176345A CN117176345A (en) 2023-12-05
CN117176345B true CN117176345B (en) 2024-01-09

Family

ID=88945254

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311426981.1A Active CN117176345B (en) 2023-10-31 2023-10-31 Quantum cryptography network key relay dynamic routing method, device and system

Country Status (2)

Country Link
CN (1) CN117176345B (en)
WO (1) WO2025092052A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118523913B (en) * 2024-07-23 2024-10-01 中电信量子科技有限公司 Quantum key relay route calculation method and system
CN118764199B (en) * 2024-09-09 2024-11-08 易迅通科技有限公司 A quantum key-based encryption method for IoT terminals

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105471576A (en) * 2015-12-28 2016-04-06 科大国盾量子技术股份有限公司 Quantum key relaying method, quantum terminal nodes and quantum key relaying system
CN106850204A (en) * 2017-02-27 2017-06-13 北京邮电大学 Quantum key distribution method and system
CN107147492A (en) * 2017-06-01 2017-09-08 浙江九州量子信息技术股份有限公司 A kind of cipher key service System and method for communicated based on multiple terminals
CN110086713A (en) * 2019-04-17 2019-08-02 北京邮电大学 It is a kind of to divide domain method for routing for wide area quantum key distribution network
CN112737776A (en) * 2020-12-29 2021-04-30 中天通信技术有限公司 Load balancing quantum key resource distribution method facing data center
CN112769550A (en) * 2020-12-29 2021-05-07 中天通信技术有限公司 Load balancing quantum key resource distribution system facing data center
KR20210081178A (en) * 2019-12-23 2021-07-01 주식회사 케이티 Method, apparatus and system for controlling quantum key relay in quantum key distribution network
CN114006694A (en) * 2021-09-26 2022-02-01 北京邮电大学 Quantum key processing method, device, electronic device and storage medium
CN114499842A (en) * 2021-12-31 2022-05-13 华南师范大学 A Reinforcement Learning-Based Key Resource Pre-allocation Method for QKD Networks
CN116418492A (en) * 2021-12-30 2023-07-11 科大国盾量子技术股份有限公司 Route establishment method, system and quantum cryptography network
CN116418490A (en) * 2021-12-30 2023-07-11 科大国盾量子技术股份有限公司 Multi-path key relay method, quantum key distribution equipment and system

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112217637B (en) * 2016-11-04 2024-03-15 华为技术有限公司 Quantum key relay method and device based on centralized management and control network
KR102592873B1 (en) * 2020-07-03 2023-10-25 한국전자통신연구원 Quantum Key Distribution Node Apparatus and Method for Quantum Key Distribution thereof

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105471576A (en) * 2015-12-28 2016-04-06 科大国盾量子技术股份有限公司 Quantum key relaying method, quantum terminal nodes and quantum key relaying system
CN106850204A (en) * 2017-02-27 2017-06-13 北京邮电大学 Quantum key distribution method and system
CN107147492A (en) * 2017-06-01 2017-09-08 浙江九州量子信息技术股份有限公司 A kind of cipher key service System and method for communicated based on multiple terminals
CN110086713A (en) * 2019-04-17 2019-08-02 北京邮电大学 It is a kind of to divide domain method for routing for wide area quantum key distribution network
KR20210081178A (en) * 2019-12-23 2021-07-01 주식회사 케이티 Method, apparatus and system for controlling quantum key relay in quantum key distribution network
CN112737776A (en) * 2020-12-29 2021-04-30 中天通信技术有限公司 Load balancing quantum key resource distribution method facing data center
CN112769550A (en) * 2020-12-29 2021-05-07 中天通信技术有限公司 Load balancing quantum key resource distribution system facing data center
CN114006694A (en) * 2021-09-26 2022-02-01 北京邮电大学 Quantum key processing method, device, electronic device and storage medium
CN116418492A (en) * 2021-12-30 2023-07-11 科大国盾量子技术股份有限公司 Route establishment method, system and quantum cryptography network
CN116418490A (en) * 2021-12-30 2023-07-11 科大国盾量子技术股份有限公司 Multi-path key relay method, quantum key distribution equipment and system
CN114499842A (en) * 2021-12-31 2022-05-13 华南师范大学 A Reinforcement Learning-Based Key Resource Pre-allocation Method for QKD Networks

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
《多变量公钥密码在区块链中的应用研究与实现》;申汝平;《中国优秀硕士论文期刊》;全文 *
基于密钥中继的广域量子密钥网络路由方案;杨超;张红旗;苏锦海;陈华城;;网络与信息安全学报(第11期);全文 *
软件定义的量子密钥分发网络技术研究;马彰超;曹原;董凯;赵永利;;邮电设计技术(第04期);全文 *

Also Published As

Publication number Publication date
WO2025092052A1 (en) 2025-05-08
CN117176345A (en) 2023-12-05

Similar Documents

Publication Publication Date Title
CN117176345B (en) Quantum cryptography network key relay dynamic routing method, device and system
CN107689947B (en) Data processing method and device
CN113765665B (en) Block chain network based on quantum key and data secure transmission method
KR20090067221A (en) Generate group secret key
EP4060931A1 (en) System and method for optimizing the routing of quantum key distribution (qkd) key material in a network
Zhang et al. Fragmentation-aware entanglement routing for quantum networks
Lo Re et al. Secure random number generation in wireless sensor networks
CN112737776B (en) Data center-oriented quantum key resource allocation method for load balancing
Srivastava et al. The rabin cryptosystem & analysis in measure of Chinese Reminder Theorem
JP2002505550A (en) Method and apparatus for cryptographically secure algebraic key setting protocol
CN114362939B (en) Dynamic route forwarding method, storage device and intelligent terminal based on trusted relay quantum secret communication network
Xing et al. An improved secure key management scheme for LoRa system
Wang et al. A segment-based multipath distribution method in partially-trusted relay quantum networks
Noguchi et al. A secure secret key-sharing system for resource-constrained IoT devices using MQTT
US20250080338A1 (en) Method for quantum-secured communication
Haripriya et al. ECC based self-certified key management scheme for mutual authentication in Internet of Things
Athulya et al. Security in mobile ad-hoc networks
CN115865334B (en) Quantum key distribution method and device and electronic equipment
Reddy et al. A Novel hybrid Quantum Protocol to enhance secured dual party Computation over Cloud Networks
CN115865332A (en) Request processing method and device and electronic equipment
CN109525326B (en) Quantum key distribution method based on single-photon ultra-dense coding
Jilna et al. A key management technique based on elliptic curves for static wireless sensor networks
Durgam et al. Energy Efficient Key for Heterogeneous WSN-IoT
Kang et al. Nonce-based key agreement protocol against bad randomness
Huang et al. A Note on One D2D Mutual Authentication and Key Agreement Protocol for IoT

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