A real-time quantum key simulation software system based on the BB84 protocol
Through the quantum key real-time simulation software system based on the BB84 protocol, the modular design and dynamic configuration of the QKD system are realized, which solves the problem of insufficient real-time performance of existing tools and improves the performance evaluation accuracy and pre-deployment capability of the QKD protocol in complex environments.
Patent Information
- Application Number
- CN202510953792.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-11
- Publication Date
- 2025-09-12
- Estimated Expiration
- 2045-07-11
AI Technical Summary
Existing QKD simulation tools lack real-time verification capabilities, resulting in significant deviations between the key timing relationship between the bit error rate calculation and base sequence comparison of quantum state transmission and the actual physical process. This makes it difficult to meet high real-time requirements, hindering the performance evaluation accuracy of the QKD protocol in complex environments and the application value of pre-deployment testing in existing networks.
A quantum key real-time simulation software system based on the BB84 protocol is used. Through the modular design of the management layer, transmission layer, quantum layer and post-processing layer, the simulated sender and receiver devices are dynamically configured, simulated quantum channels and classical channels are generated, base sequences and original key sequences are asynchronously transmitted, and error correction and security enhancement modules are combined to achieve efficient data processing and flexible expansion.
It significantly improves the real-time verification capability and dynamic scenario adaptability of the quantum key distribution simulation system, supports flexible replacement of error correction algorithms and security enhancement strategies, adapts to multi-noise environments, provides a high-fidelity and highly flexible simulation foundation, and provides seamless connection between QKD performance verification and pre-deployment in existing networks.
Smart Images

Figure CN120455007B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of quantum technology, and in particular to a quantum key real-time simulation software system based on the BB84 protocol. Background Art
[0002] Quantum Key Distribution (QKD) technology leverages the principles of quantum mechanics to provide information-theoretically secure key exchange between communicating parties. One of its core protocols, the BB84 protocol, relies on complex interactive processes, including quantum state transmission, base sequence comparison, and error detection. However, the actual deployment of QKD systems faces the dual challenges of protocol logic verification and adaptability to existing network environments.
[0003] The primary limitation of existing QKD simulation tools lies in their inadequate real-time verification capabilities. Traditional simulation tools are generally based on static event-sequence driven models, with their core systems relying on predefined event triggering mechanisms and fixed timing parameters. During simulation, these tools can significantly deviate from the actual physical processes involved in calculating the bit error rate of quantum state transmission and comparing key timing relationships with base sequence alignment. Furthermore, the offline processing mode of existing tools struggles to meet high real-time requirements. This issue directly limits the accuracy of QKD protocol performance evaluation in complex environments and hinders the usefulness of simulation tools in pre-deployment testing of live networks. Summary of the Invention
[0004] In view of the above problems, an embodiment of the present invention is proposed to provide a quantum key real-time simulation software system based on the BB84 protocol that overcomes the above problems or at least partially solves the above problems.
[0005] In order to solve the above problems, the embodiment of the present invention discloses a quantum key real-time simulation software system based on the BB84 protocol, the system comprising: a management layer, a transmission layer, a quantum layer and a post-processing layer;
[0006] The management layer is configured to determine a simulated sender device and a simulated receiver device according to the preset configuration file;
[0007] The transmission layer is used to generate a simulated quantum channel and a simulated classical channel according to a preset configuration file;
[0008] The quantum layer is configured to determine, based on the preset configuration file, the simulated quantum state information, the first simulated basis sequence, and the first simulated original key sequence corresponding to the simulated sending device; send the simulated quantum state information corresponding to the simulated sending device to the simulated receiving device through the simulated quantum channel, and asynchronously send the first simulated basis sequence to the simulated classical channel; send the first simulated original key sequence to the post-processing layer through a preset internal channel; determine, based on the preset configuration file, the simulated second simulated basis sequence corresponding to the simulated receiving device; measure the simulated quantum state information obtained by the simulated receiving device through the simulated quantum channel, and determine a second simulated original key sequence based on the measurement result; asynchronously send the second simulated basis sequence to the simulated classical channel; and send the second simulated original key sequence to the post-processing layer through the preset internal channel;
[0009] The post-processing layer is configured to obtain the first simulated base sequence and the second simulated base sequence through the simulated classical channel; obtain the first simulated original key sequence and the second simulated original key sequence through the preset internal channel; and determine a simulated quantum key based on the first simulated base sequence, the second simulated base sequence, the first simulated original key sequence, and the second simulated original key sequence.
[0010] Optionally, the post-processing layer includes a base module, a bit error rate determination module, an error correction module and a security enhancement module;
[0011] The base comparison module is configured to obtain the first simulated base sequence and the second simulated base sequence through the simulated classical channel, compare the first simulated base sequence and the second simulated base sequence, and determine a comparison result; obtain the first simulated original key sequence and the second simulated original key sequence through the preset internal channel, and generate a simulated original key based on the comparison result, the first simulated original key sequence, and the second simulated original key sequence;
[0012] The intermediate key determination module is configured to determine a simulated bit error rate based on the simulated original key, and determine a simulated first intermediate key based on the simulated bit error rate;
[0013] The error correction module is configured to correct the simulated first intermediate key according to a preset error correction algorithm to determine the simulated second intermediate key;
[0014] The security enhancement module is used to perform security enhancement on the simulated second intermediate key according to a preset security enhancement algorithm to determine the simulated quantum key.
[0015] Optionally, the system further comprises: an interface display layer; the interface display layer is configured to receive and display user-configured parameters; the user-configured parameters are used to determine the preset configuration file;
[0016] The management layer is further configured to obtain the user-configured parameters received by the interface presentation layer, and determine the preset configuration file according to the user-configured parameters.
[0017] Optionally, the management layer is further used to determine and execute a connection strategy based on a preset configuration file; the connection strategy includes: a simulation connection strategy; the simulation connection strategy is used to configure the connection addresses of the simulated sender device and the simulated receiver device.
[0018] Optionally, the connection strategy further includes an existing network connection strategy; the existing network connection strategy is used to configure a connection address with an existing network key management device;
[0019] The management layer is further configured to, when the connection strategy is the existing network connection strategy, determine a key distribution strategy based on the existing network key management device and send the key distribution strategy to the post-processing layer;
[0020] The post-processing layer is further configured to determine a simulated quantum key based on the key distribution policy received from the management layer, the first simulated base sequence, and the second simulated base sequence.
[0021] Optionally, the system further comprises:
[0022] A connection interface layer is configured to, when the connection strategy is the existing network connection strategy, determine a target existing network key management device; encapsulate a network access request for the target existing network key management device according to the preset configuration file; send the network access request to the target existing network key management device, and receive a response from the target existing network key management device to the network access request; complete an identity verification with the target existing network key management device based on the response of the target existing network key management device to the network access request; after completing the identity verification, obtain the simulated quantum key, and send the simulated quantum key to the target existing network key management device.
[0023] Optionally, the quantum layer is further configured to obtain a bit transmission rate of the simulated quantum state information and send the bit transmission rate to the management layer;
[0024] The management layer is further configured to receive and store the bit transmission rate sent by the quantum layer; respond to the bit transmission rate acquisition request sent by the interface presentation layer, and send the bit transmission rate to the interface presentation layer;
[0025] The interface display layer is further used to send a bit transmission rate acquisition request to the management layer in response to the user's operation of obtaining quantum layer state information; receive the first response information of the management layer to the bit transmission rate acquisition request, and display the first response information to the user; the first response information includes the bit transmission rate.
[0026] Optionally, the post-processing layer is further configured to obtain a quantum bit error rate and a key generation rate, and send the quantum bit error rate and the key generation rate as post-processing layer state information to the management layer;
[0027] The management layer is further configured to receive and store the post-processing layer status information sent by the post-processing layer; respond to a post-processing layer status information acquisition request sent by the interface presentation layer, and send the post-processing layer status information to the interface presentation layer;
[0028] The interface presentation layer is further configured to, in response to a user operation to obtain the post-processing layer status information, send a post-processing layer status information acquisition request to the management layer, receive a second response message from the management layer to the post-processing layer status information acquisition request, and present the second response message to the user. The second response message includes the post-processing layer status information.
[0029] Optionally, the transmission layer further includes a free space noise module;
[0030] The free space noise module is used to generate free space noise according to a preset configuration file, and perform simulated perturbations on the simulated quantum channel according to the free space noise.
[0031] Optionally, the transmission layer further includes a fiber channel noise module; the fiber channel noise module is configured to generate fiber channel noise according to a preset configuration file, and simulate disturbances on the simulated quantum channel according to the fiber channel noise.
[0032] The embodiments of the present invention have the following advantages: Through the modular collaborative design of the management layer, transmission layer, quantum layer, and post-processing layer, the real-time verification capability and dynamic scenario adaptability of the quantum key distribution simulation system are significantly improved. The management layer dynamically determines the simulated sender and receiver devices based on a preset configuration file and loads the channel parameters in real time, breaking through the limitations of traditional tools that rely on static event sequences. The transmission layer carries out the quantum state transmission and base sequence coordination tasks respectively through independently generated simulated quantum channels and classical channels. The quantum layer precisely controls the quantum state generation rules, base sequence randomness, and original key sequence generation logic of the sender and receiver through preset configuration files, and uses preset internal channels to achieve efficient data transmission with the post-processing layer, avoiding performance loss caused by data coupling between modules. The post-processing layer obtains the asynchronously transmitted base sequence through the classical channel, combines it with the original key data transmitted through the internal channel, and dynamically performs classical information processing. Its independent operation characteristics support the flexible replacement of different error correction algorithms or security enhancement strategies, significantly improving the adaptability of the system in multi-noise environments. Through modular decoupling and standardized interface design, the overall system supports independent optimization and upgrading of functions at each layer, and can seamlessly connect to existing network key management equipment, providing a high-fidelity and highly flexible simulation foundation for QKD performance verification and pre-deployment in existing networks. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 This is a block diagram of an embodiment of a quantum key real-time simulation software system based on the BB84 protocol of the present invention;
[0034] Figure 2 This is an architectural diagram of an embodiment of a quantum key real-time simulation software system based on the BB84 protocol of the present invention;
[0035] Figure 3 This is an implementation scenario diagram of an embodiment of a quantum key real-time simulation software system based on the BB84 protocol of the present invention. DETAILED DESCRIPTION
[0036] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0037] The BB84 protocol is the first key distribution protocol based on the principles of quantum mechanics. It leverages the unclonability of quantum states, such as the polarization state of photons, to ensure the security of key transmission. Practical QKD systems (quantum key distribution) require complex processes such as key negotiation, error correction, security enhancement, and interaction with key management (KM) devices. During R&D, simulation tools are often used to verify system performance.
[0038] One of the core concepts of the embodiments of the present invention is to divide the BB84 protocol into multiple decoupling layers by performing hierarchical decoupling, concurrent processing of coroutines and dynamic configuration mechanisms on the logical processes of the BB84 protocol, thereby achieving real-time simulation and flexible expansion of the entire process of quantum key distribution.
[0039] Reference Figure 1 , shows a block diagram of an embodiment of a quantum key real-time simulation software system based on the BB84 protocol of the present invention:
[0040] This system is an analog QKD system based on the BB84 protocol and is suitable for related business scenarios of the QKD system under the BB84 protocol.
[0041] A management layer 11 is used to determine a simulated sender device and a simulated receiver device according to a preset configuration file;
[0042] In a QKD system, quantum state transmission relies on a precise one-to-one binding between the sender (i.e., Alice) and the receiver (i.e., Bob). If the system cannot clearly identify the device, it could lead to quantum state eavesdropping by a middleman (e.g., Eve masquerading as Bob) or base sequence misalignment (i.e., Alice's sending basis and Bob's measurement basis not matching). The BB84 protocol requires Alice and Bob to interact strictly according to the following steps: Alice first generates quantum state information, which is then transmitted to Bob via a quantum channel so that Bob can measure it. Finally, the two parties coordinate over a classical channel to generate a key. If the system cannot distinguish between Alice and Bob, the protocol will completely fail. In analog systems, transmission parameters between layers and parameters within each layer are determined by pre-set configuration files.
[0043] In a practical QKD environment, a basis sequence refers to the measurement basis sequence randomly selected by Alice and Bob during quantum state transmission, which determines how to prepare or measure the quantum state. In the BB84 protocol, two bases are commonly used: a rectilinear basis (for measuring horizontal (0°) or vertical (90°) polarization states); and a diagonal basis (for measuring +45° or -45° polarization states). Alice and Bob typically independently generate their own basis sequences using a pseudorandom number generator. After generating the basis sequence, Alice selects a quantum state encoding method based on the basis sequence. Bob then selects a measurement basis based on the basis sequence.
[0044] The raw key sequence is the initial key bit stream that has not been processed after Alice and Bob transmit it through the quantum channel. It is generally divided into a bit sequence generated based on quantum state encoding and a bit sequence generated based on measurement results.
[0045] The management layer 11 determines, through a preset configuration file, that the simulated sender device corresponds to Alice in the actual process, and that the simulated receiver device corresponds to Bob in the actual process.
[0046] In one embodiment, the management layer 11 is further used to determine and execute a connection strategy according to a preset configuration file; the connection strategy includes: a simulation connection strategy; the simulation connection strategy is used to configure the connection addresses of the simulated sender device and the simulated receiver device.
[0047] The simulation connection strategy means that this simulation process is completely virtual and no live network devices exist. In this case, after the management layer 11 determines the simulated sender and receiver devices, it is necessary to determine their addresses to complete the connection between the two parties and proceed to the subsequent process.
[0048] The transport layer 12 is used to generate simulated quantum channels and simulated classical channels according to a preset configuration file;
[0049] In real QKD, a quantum channel is a physical medium for transmitting quantum states such as single-photon pulses. It can be in the form of optical fiber or free space such as satellite communication. It has the characteristics of quantum states being non-clonable, highly loss-sensitive, such as photon transmission being attenuated by the medium, and being affected by noise.
[0050] In real-world QKD, the classical channel is a traditional communication channel used to transmit coordination information such as basis comparison, error correction, and privacy amplification. Therefore, it must possess characteristics such as reliability and clear text transmission. In simulated QKD, choosing the right network for both quantum and classical channels is undoubtedly crucial.
[0051] The Transmission Control Protocol (TCP) is one of the core protocols in Internet communications. It ensures reliable data transmission through mechanisms such as packet confirmation and retransmission, sequence control, and flow control.
[0052] In one example, a quantum channel and a classical channel may be simulated using a TCP network. The simulation may be implemented as follows:
[0053] Independent TCP ports and classical channel ports are allocated to the quantum channel to achieve physical isolation of the two channels.
[0054] In a quantum channel, by setting noise parameters and randomly tampering with a small amount of data packet content, it is possible to simulate quantum state eavesdropping or environmental noise interference. It is also possible to disable TCP's retransmission mechanism if necessary to closely follow the lossy nature of quantum channel transmission. If the quantum channel packet loss rate is too high, the key verification process in the subsequent processing will terminate the protocol due to excessive bit error rate, which is consistent with the noise tolerance mechanism in real QKD. For example, if the channel type is set to free space in the configuration file, the transport layer can enable the free space noise model and calculate the packet loss rate and disturbance probability based on the simulated transmission distance and simulated turbulence intensity. If the configured channel type is a fiber channel, deterministic loss is injected based on the simulated fiber length and simulated loss coefficient.
[0055] For simulations of classical channels, packet confirmation, retransmission, and sequence control can be enabled to ensure error-free transmission of coordinated information. Existing superimposable encryption technologies, such as TLS, can then be used to simulate secure communications in real-world scenarios. For example, noise can be injected by simulating delay. The corresponding delay simulation formula can be: delay = data size / channel bandwidth + propagation distance / speed of light;
[0056] In one embodiment, the transmission layer 12 may include a free space noise module, configured to generate free space noise according to a preset configuration file, and perform simulated perturbations on the simulated quantum channel according to the free space noise.
[0057] When quantum transmission is performed in free space, the transmission process is subject to interference from various factors such as atmospheric absorption, scattering, and geometric loss. Free space interference can be simulated by using the corresponding noise parameters in the preset configuration file. For example, during the simulation, the atmospheric transmittance and detector efficiency can be set, and the product of the two can be used as the attenuation rate. Data packets are then randomly discarded according to the attenuation rate.
[0058] In one embodiment, the transport layer 12 may further include a fiber channel noise module, configured to generate fiber channel noise according to a preset configuration file, and perform simulated perturbations on the simulated quantum channel according to the fiber channel noise.
[0059] For example, during simulation, the attenuation rate may be determined by configuring the transmission distance and the attenuation coefficient; and data packets are randomly discarded according to the attenuation rate, thereby simulating fiber channel noise.
[0060] In addition, you can also define the polarization perturbation range in the preset configuration file and define the random offset for each generated quantum state information, thereby achieving interference with free-space channels or fiber channels.
[0061] The quantum layer 13 is configured to determine, based on a preset configuration file, the simulated quantum state information, the first simulated base sequence, and the first simulated original key sequence corresponding to the simulated sending device; transmit the simulated quantum state information corresponding to the simulated sending device to the simulated receiving device via a simulated quantum channel, and asynchronously transmit the first simulated base sequence to the simulated classical channel; transmit the first simulated original key sequence to the post-processing layer via a preset internal channel; determine, based on the preset configuration file, the simulated second simulated base sequence corresponding to the simulated receiving device; measure the simulated quantum state information obtained by the simulated receiving device via the simulated quantum channel, and determine the second simulated original key sequence based on the measurement results; asynchronously transmit the second simulated base sequence to the simulated classical channel; and transmit the second simulated original key sequence to the post-processing layer via a preset internal channel.
[0062] In the simulation process of the sender device (Alice), it is first necessary to generate a quantum state sequence based on the parameters defined in the configuration file (such as polarization state type and photon emission frequency). For example: if the configuration is polarization encoding, four polarization states are randomly generated: horizontal (0°), vertical (90°), +45°, and -45°. If the configuration is phase encoding, coherent states of 0 phase and π phase are generated through an interferometer. Then, according to the preset configuration file, a base sequence is randomly selected for subsequent screening of matching keys. For example:
[0063] Each quantum state corresponds to a basis, and the randomness of the basis sequence is controlled by the random seed parameter in the configuration file to ensure experimental reproducibility. The binary information corresponding to each quantum state is stored in sequence as the original key sequence for processing by the post-processing layer.
[0064] After the quantum state information is prepared, it is sent to the simulated receiver device (Bob) via a simulated quantum channel. The channel behavior is affected by the transport layer noise module. For example, based on the configured turbulence level, the polarization angle is randomly perturbed to determine noise, and packets are randomly dropped based on the noise.
[0065] During the preparation and transmission process, the first basis sequence is asynchronously transmitted to the classical channel receiver for subsequent basis comparison. Asynchronous transmission ensures that the timing of the basis sequence does not affect the real-time transmission of the quantum state. The first original key sequence is directly transmitted to the post-processing layer via a preset internal channel, bypassing channel noise. The preset internal channel is intended to simulate the private transmission of the original key sequence during the example QKD transmission process. Therefore, an additional communication channel is required for transmitting the original key sequence. This can be implemented through process communication pipelines, message middleware, and memory-based shared queues, etc., which are not limited by the present invention.
[0066] During the simulation of the receiving device (Bob), a random basis sequence is first generated according to a preset configuration file. The basis sequence generation logic is consistent with that of the sender to ensure protocol symmetry. The received quantum state is measured using the second basis sequence, with measurement error determined by the transmission layer noise parameter. The measurement results are converted into a binary key sequence, ignoring the measurement results of mismatched bases. The second basis sequence is sent to the classical channel, where both parties compare the positions of the matching bases. The second original key sequence is then passed to the post-processing layer for comparison and error correction with the sender's first original key sequence.
[0067] The post-processing layer 14 is used to obtain a first simulated base sequence and a second simulated base sequence through a simulated classical channel; obtain a first simulated original key sequence and a second simulated original key sequence through a preset internal channel; and determine a simulated quantum key based on the first simulated base sequence, the second simulated base sequence, the first simulated original key sequence, and the second simulated original key sequence.
[0068] The post-processing layer determines the simulated quantum key through the first simulated base sequence and the second simulated base sequence obtained in the classical channel and the first simulated original key sequence and the second simulated original key sequence obtained in the internal channel.
[0069] In one embodiment, the post-processing layer 14 may further include a base module, a bit error rate determination module, an error correction module, and a security enhancement module;
[0070] a base comparison module, configured to obtain a first simulated base sequence and a second simulated base sequence through a simulated classical channel, compare the first simulated base sequence and the second simulated base sequence, and determine a comparison result; obtain a first simulated original key sequence and a second simulated original key sequence through a preset internal channel, and generate a simulated original key based on the comparison result, the first simulated original key sequence, and the second simulated original key sequence;
[0071] The base matching module selects key bits with the same base sequence between Alice and the simulated Bob to generate the original key. After obtaining the first and second simulated base sequences through the classical channel, it compares the two base sequences bit by bit and records the matching positions. For example, if the first simulated base sequence is [Rect, Diag, Rect, Diag] and the second simulated base sequence is [Diag, Diag, Rect, Rect], the matching positions are bits 2 and 3.
[0072] Extract the matching bits from the first and second simulated original key sequences. For example, if the first simulated original key sequence is [0, 1, 0, 1] and the second simulated original key sequence is [1, 0, 0, 1], and the matching bits are bits 2 and 3, then the original key can be [1, 0].
[0073] The intermediate key determination module is used to simulate the original key and determine the simulated bit error rate. Based on the simulated bit error rate, it then determines the simulated first intermediate key. It randomly extracts bits from the original key, such as the first 100 bits, and publicly compares the bit error rates. For example, if 3 bits out of the 100 bits are incorrect, the bit error rate is determined to be 3%. If the bit error rate falls below a security threshold (typically 11% for the BB84 protocol; the simulated security threshold can be customized using a pre-set configuration file), the original key is retained as the intermediate key. If the bit error rate exceeds the threshold, the current key is discarded, triggering the quantum layer to resend the data.
[0074] an error correction module, configured to correct the simulated first intermediate key according to a preset error correction algorithm to determine the simulated second intermediate key;
[0075] Select an error correction algorithm based on the bit error rate: Hamming code or BCH code can be used in the case of low bit error rates. CASCADE protocol or LDPC code can be used for error correction in the case of high bit error rates. For example, the bit error rate can be set by the user in a preset configuration file. For example, the user can set an intermediate threshold. If the bit error rate is lower than the intermediate threshold, it is considered to be a low bit error rate. If the bit error rate is higher than the intermediate threshold, it is considered to be a high bit error rate. In addition, the use of error correction algorithms such as Hamming code, BCH code, CASCADE protocol and LDPC code to correct key sequences is an existing technology, so it will not be described in detail here.
[0076] The security enhancement module is used to perform security enhancement on the simulated second intermediate key according to a preset security enhancement algorithm to determine the simulated quantum key.
[0077] The key sequence can be enhanced in security using existing technologies such as hash functions. The security enhancement process is not described in detail here. After the security enhancement process is completed, the key can be compressed using a pan-binary hash algorithm to output the final secure key.
[0078] In one embodiment, the connection strategy further includes an existing network connection strategy; the existing network connection strategy is used to configure a connection address with the existing network key management device;
[0079] In actual QKD system deployments, the generated quantum keys must work in conjunction with existing network key management (KM) devices, for example, injecting quantum keys into existing IPsec VPNs or database encryption systems. The existing network connection policy simulates the configuration of such scenarios. For example, in addition to configuring the connection address to the existing network KM device, the existing network connection policy can also be used to configure authentication parameters for connecting devices to the existing network, including parameters such as digital certificates, digital tokens, or preset shared keys. It can also be used to inject quantum key rules, such as format and push frequency.
[0080] The management layer 11 is further configured to determine a key distribution strategy based on an existing network key management device when the connection strategy is an existing network connection strategy, and send the key distribution strategy to the post-processing layer.
[0081] The management layer 11, when connected to the existing network key management device, is responsible for pulling the key distribution policy from the KM device, which may include information such as key length, validity period and distribution protocol, and then passing the obtained policy parameters to the post-processing layer through the internal message queue.
[0082] The post-processing layer 14 is further configured to determine a simulated quantum key according to the key distribution policy received from the management layer, the first simulated base sequence, and the second simulated base sequence.
[0083] The post-processing layer 14 dynamically adjusts various steps, such as base sequence alignment and error correction enhancement, based on the specific requirements of the policy issued by the KM device. For example, if the KM device indicates that a 256-bit key needs to be generated, the post-processing layer 14 will select the first 256 matching bits from the original key. Furthermore, the post-processing layer 14 can encapsulate the final key in the format required by the KM device and optionally add metadata such as a timestamp and expiration date.
[0084] In one embodiment, the system may further include a connection interface layer;
[0085] The connection interface layer is used to determine the target existing network key management device when the connection strategy is the existing network connection strategy; encapsulate the network access request for the target existing network key management device according to the preset configuration file; send the network access request to the target existing network key management device and receive the target existing network key management device's response to the network access request; complete the identity verification with the target existing network key management device based on the target existing network key management device's response to the network access request; after completing the identity verification, obtain the simulated quantum key and send the simulated quantum key to the target existing network key management device;
[0086] When connecting to an existing network device, the connection interface layer first needs to extract various parameters of the target existing network key management device from the preset configuration file, which may include parameters such as the address and protocol type. Then, it needs to encapsulate the network access request. A possible process may be: the request content includes identity credential information, capability negotiation information, and metadata information. For example, the identity credential can be a digital certificate, API token, or preset shared key; the capability negotiation content can include supported key types and encryption algorithms; and the metadata information can include information such as the device model, software version, and compatibility conditions.
[0087] Subsequent authentication processes, such as two-way certificate verification, are required to ensure the KM device's identity is authentic. The KM device's response to the request may include both a success response and a failure response. A success response may include the session ID and key transfer policy assigned by the KM device. A failure response may include an error code. Because the authentication process involved is conventional, it will not be detailed here.
[0088] After the post-processing layer 14 generates the simulated quantum key, the connection interface layer requests it and securely converts the key to the format required by the KM device. The key is then sent based on configured push intervals or trigger conditions, such as event-triggered logic. The connection interface layer acts as a bridge to the existing network infrastructure, ensuring seamless integration of quantum keys into the existing encryption system through strict protocol adaptation, identity verification, and secure transmission.
[0089] In one embodiment, the system may further include an interface display layer, which is configured to receive and display user-configured parameters; the user-configured parameters are used to determine a preset configuration file.
[0090] Users can enter parameters through the interface display layer, which formats them into structured information. The interface display layer passes these structured user parameters to the management layer 11, which writes the new parameters into a preset configuration file and triggers dynamic loading. The interface display layer also displays a real-time summary of the current configuration, such as channel type, noise parameters, and key length, for user confirmation.
[0091] In one embodiment, the management layer 11 is further configured to receive and store the bit transmission rate sent by the quantum layer; respond to the bit transmission rate acquisition request sent by the interface presentation layer, and send the bit transmission rate to the interface presentation layer;
[0092] The quantum layer 13 is also used to obtain the bit transmission rate of the simulated quantum state information and send the bit transmission rate to the management layer;
[0093] The quantum layer 13 can push the rate data to the management layer 11 according to a preset time period, and the management layer stores the latest value in the memory database. The time period can be determined by a preset configuration file.
[0094] The interface display layer is also used to respond to the user's operation of obtaining quantum layer state information, send a bit transmission rate acquisition request to the management layer; receive the management layer's first response information for the bit transmission rate acquisition request, and display the first response information to the user; the first response information includes the bit transmission rate.
[0095] This can be achieved by a user clicking a corresponding function button on the display interface. After receiving the user's interaction information, the display layer sends a request to the management layer based on the content of the interaction. The management layer then receives the data sent and displays it to the user. This display can be in the form of a graph or digital panel, helping users evaluate the actual throughput of the quantum channel.
[0096] In one embodiment, the management layer 11 is further configured to receive and store the post-processing layer status information sent by the post-processing layer; respond to the post-processing layer status information acquisition request sent by the interface presentation layer, and send the post-processing layer status information to the interface presentation layer;
[0097] The post-processing layer 14 is further used to obtain the quantum bit error rate and the key generation rate, and send the quantum bit error rate and the key generation rate as post-processing layer status information to the management layer;
[0098] Similar to the quantum layer 13, the post-processing layer 14 can also push information such as quantum bit error rate and key rate to the management layer according to a preset time period;
[0099] The interface presentation layer is further configured to, in response to a user's operation to obtain the post-processing layer status information, send a request to the management layer to obtain the post-processing layer status information, receive a second response from the management layer to the request to obtain the post-processing layer status information, and present the second response to the user. The second response includes the post-processing layer status information.
[0100] Similarly, the user can click a corresponding function button on the display interface. After receiving the user's interactive information, the interface display layer sends a request to the management layer based on the interactive information content. The management layer then receives the data sent by the management layer and displays it to the user. The display can be a curve chart or a digital panel display, which can help users evaluate the actual throughput of the quantum channel.
[0101] Figure 2 The following is an architecture diagram of an embodiment of a quantum key real-time simulation software system based on the BB84 protocol of the present invention. Figure 3 The following diagram shows an implementation scenario of a quantum key real-time simulation software system based on the BB84 protocol of the present invention, combined with Figure 2 and Figure 3 A specific simulation process is shown:
[0102] First, if Figure 2 As shown:
[0103] The interface display layer may specifically include a status monitoring module, a key display module, a parameter configuration module and a connection management module, wherein the parameter configuration module is used to receive user-configured parameters, and the connection management module is used to receive user-specified connection modes.
[0104] The connection interface layer may specifically include a network authentication module, a heartbeat detection module, a QKD policy management module, a quantum key transmission module, and a status reporting module. The heartbeat detection module is used to send heartbeat information to the QKDNC device (Quantum Key Distribution Network Controller) to determine the online status.
[0105] The post-processing layer may include a base module, an intermediate key determination module, an error correction module, and a security enhancement module;
[0106] The transport layer may include a classical channel simulation module, a quantum channel simulation module, and an information transmission module;
[0107] The quantum layer may include a simulated sender device module and a simulated receiver module.
[0108] The management layer may include a key management module, a log management module, and a configuration management module.
[0109] The specific process may be: first, in the interface display layer, the user's parameter configuration is received through the parameter configuration module: among which, a specific content of the parameter configuration may include: single pulse light intensity, receiving telescope aperture, distance, diffraction half-angle, atmospheric transmittance estimation, photon detector detection efficiency, other coupling efficiencies, dark photon count estimation, photon polarization angle offset, other error factor estimation and other parameters.
[0110] The configuration of error correction algorithm and security enhancement algorithm parameters may include: setting the maximum number of iterations of the algorithm; and setting the compression ratio of the security enhancement algorithm parameters.
[0111] The parameter configuration of the connection mode can be to configure only the analog QKD connection address of the other end or only the link address of the existing network KM device;
[0112] After receiving the user's parameter configuration, the configuration management module in the management layer will receive the configuration parameter information sent by the interface display layer, process it, and write it into the corresponding configuration file according to the configuration parameter characteristics. It will also make corresponding processing according to the connection management situation.
[0113] When only the peer simulated QKD connection address is configured, only quantum layer-related operations and post-processing layer-related operations are performed;
[0114] When only the connection address of the existing KM device is configured, additional operations related to the connection interface layer will be performed (refer to Figure 3 The dotted part in the figure) completes the simulated QKD network access through the network access module, exchanges authentication information with the KM, and establishes a connection relationship between the simulated QKD and KM devices.
[0115] While waiting for the QKDNC device in the QKD network to issue the quantum key distribution strategy, the heartbeat detection module will periodically send heartbeat detection messages to ensure the normal connection between the simulated QKD and KM devices. At the same time, the status reporting module will also report the status information of the simulated QKD regularly or in abnormal situations, including operating status and abnormal status.
[0116] When the simulated QKD receives the quantum key distribution policy issued by the KM, it calls the QKD policy management module to ensure that the generation of quantum keys complies with the predetermined security policies and requirements.
[0117] The quantum key transmission module is responsible for uploading the key transmitted from the post-processing layer to the connected KM device.
[0118] For the operation of the quantum layer, first, it is necessary to read the corresponding configuration information from the configuration management module in the management layer to complete the initialization, and then:
[0119] Alice uses the quantum state preparation module to simulate the generation of quantum states using a random original key sequence, a random basis sequence, and a basis vector density matrix. It then uses the information transmission module of the transmission layer to generate a simulated quantum channel through the quantum channel simulation module, and sends the original key sequence through an internal channel and the basis sequence through a simulated classical channel to the post-processing layer.
[0120] After Bob receives the quantum state information sent by Alice from the simulated quantum channel through the information transmission module of the transmission layer, he uses the quantum state measurement module to measure the quantum state, and sends the measurement result through the information transmission module and the internal channel to the post-processing layer, and sends the basis sequence used for the measurement to the post-processing layer through the simulated classical channel.
[0121] When a KM device is connected, the operations of the quantum layer will be adjusted accordingly based on the quantum key distribution strategy issued by the KM device.
[0122] For the post-processing layer, the operation process is to first read the corresponding configuration information from the configuration management module in the management layer, complete the initialization, and then:
[0123] Get the generated base sequence and key sequence from the internal channel of the quantum layer and the simulated classical channel, put the base sequence and key sequence into the base module, and get the key consistent with the basis (replaced by sifitingKey below).
[0124] A portion of the sifitingKey is selected according to a certain ratio and put into the intermediate key determination module, the bit error rate of the sifitingKey on the Bob side is estimated, and the bit error rate is transmitted to the configuration management module in the management layer.
[0125] When the bit error rate is greater than 11%, the sifitingKey is discarded and a new key with the same base is determined;
[0126] If the bit error rate is not greater than 11%, the part of the key used for key verification is discarded, and the remaining key of the sifitingKey (replaced by checkingKey in the following text) is put into the error correction module.
[0127] The error correction module corrects the checkingKey according to the selected error correction algorithm until the error correction stop condition is met, and then puts the corrected key into the security enhancement module.
[0128] The security enhancement module performs security enhancement on the corrected key according to the selected security enhancement method and outputs the security-enhanced key (hereinafter referred to as privacyKey).
[0129] Based on the connection status, determine whether the privacyKey needs to be passed to the connection interface layer.
[0130] Pass the privacyKey to the configuration management module in the management layer.
[0131] Finally, the interface display layer will initiate a request to obtain the bit error rate, key information and other related requests to the main program. The main program obtains the relevant information from the configuration management module in the management layer and sends it to the interface display layer. The interface display layer will display the relevant information based on the information.
[0132] The above process can be implemented in Go, with the following core coroutines: The quantum state sending coroutine generates quantum states at a preset period and actively connects to Bob's quantum channel via TCP to send data. The classical data receiving coroutine monitors Bob's classical channel and receives negotiated data such as the basis sequence and bit error rate. The post-processing coroutine performs operations such as basis alignment, error correction, and security enhancement to generate the final key.
[0133] It should be noted that for the sake of simplicity, the system embodiments are described as a series of actions. However, those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in this specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.
[0134] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0135] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, apparatuses, or computer program products. Thus, embodiments of the present invention may take the form of entirely hardware embodiments, entirely software embodiments, or embodiments combining software and hardware aspects. Furthermore, embodiments of the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROMs, optical storage, etc.) containing computer-usable program code.
[0136] The embodiments of the present invention are described with reference to flowcharts and / or block diagrams of methods, terminal devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowcharts and / or block diagrams. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0137] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0138] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0139] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they become aware of the basic creative concepts. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.
[0140] Finally, it should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that includes a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or terminal device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or terminal device that includes the element.
[0141] The above is a detailed introduction to a quantum key real-time simulation software system based on the BB84 protocol provided by the present invention. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only intended to help understand the method and core ideas of the present invention. At the same time, for those skilled in the art, according to the ideas of the present invention, there may be changes in the specific implementation methods and application scopes. In summary, the contents of this specification should not be understood as limiting the present invention.
Claims
1. A quantum key real-time simulation software system based on the BB84 protocol, characterized in that: The system includes: a management layer, a transmission layer, a quantum layer and a post-processing layer; The management layer is used to determine a simulated sender device and a simulated receiver device according to a preset configuration file; The transmission layer is used to generate a simulated quantum channel and a simulated classical channel according to a preset configuration file; The quantum layer is configured to determine, based on the preset configuration file, the simulated quantum state information, the first simulated basis sequence, and the first simulated original key sequence corresponding to the simulated sending device; send the simulated quantum state information corresponding to the simulated sending device to the simulated receiving device through the simulated quantum channel, and asynchronously send the first simulated basis sequence to the simulated classical channel; send the first simulated original key sequence to the post-processing layer through a preset internal channel; determine, based on the preset configuration file, the simulated second simulated basis sequence corresponding to the simulated receiving device; measure the simulated quantum state information obtained by the simulated receiving device through the simulated quantum channel, and determine a second simulated original key sequence based on the measurement result; asynchronously send the second simulated basis sequence to the simulated classical channel; and send the second simulated original key sequence to the post-processing layer through the preset internal channel; The post-processing layer is configured to obtain the first simulated base sequence and the second simulated base sequence through the simulated classical channel; obtain the first simulated original key sequence and the second simulated original key sequence through the preset internal channel; and determine a simulated quantum key based on the first simulated base sequence, the second simulated base sequence, the first simulated original key sequence, and the second simulated original key sequence.
2. A quantum key real-time simulation software system based on the BB84 protocol according to claim 1, characterized in that: The post-processing layer includes a base module, an intermediate key determination module, an error correction module and a security enhancement module; The base comparison module is configured to obtain the first simulated base sequence and the second simulated base sequence through the simulated classical channel, compare the first simulated base sequence and the second simulated base sequence, and determine a comparison result; obtain the first simulated original key sequence and the second simulated original key sequence through the preset internal channel, and generate a simulated original key based on the comparison result, the first simulated original key sequence, and the second simulated original key sequence; The intermediate key determination module is configured to determine a simulated bit error rate based on the simulated original key, and determine a simulated first intermediate key based on the simulated bit error rate; The error correction module is configured to correct the simulated first intermediate key according to a preset error correction algorithm to determine the simulated second intermediate key; The security enhancement module is used to perform security enhancement on the simulated second intermediate key according to a preset security enhancement algorithm to determine the simulated quantum key.
3. A quantum key real-time simulation software system based on the BB84 protocol according to claim 1, characterized in that: The system further includes: an interface display layer; the interface display layer is configured to receive and display user-configured parameters; the user-configured parameters are used to determine the preset configuration file; The management layer is further configured to obtain the user-configured parameters received by the interface presentation layer, and determine the preset configuration file according to the user-configured parameters.
4. A quantum key real-time simulation software system based on the BB84 protocol according to claim 1, characterized in that: The management layer is further used to determine and execute the connection strategy of the system according to a preset configuration file; the connection strategy includes: a simulation connection strategy; the simulation connection strategy is used to configure the connection addresses of the simulated sender device and the simulated receiver device.
5. A quantum key real-time simulation software system based on the BB84 protocol according to claim 4, characterized in that: The connection strategy also includes an existing network connection strategy; the existing network connection strategy is used to configure the connection address with the existing network key management device; The management layer is further configured to, when the connection strategy is the existing network connection strategy, determine a key distribution strategy based on the existing network key management device and send the key distribution strategy to the post-processing layer; The post-processing layer is further configured to determine a simulated quantum key based on the key distribution policy, the first simulated base sequence, and the second simulated base sequence received from the management layer.
6. A quantum key real-time simulation software system based on the BB84 protocol according to claim 5, characterized in that: The system further comprises: A connection interface layer is configured to, when the connection strategy is the existing network connection strategy, determine a target existing network key management device; encapsulate a network access request for the target existing network key management device according to the preset configuration file; send the network access request to the target existing network key management device, and receive a response from the target existing network key management device to the network access request; complete an identity verification with the target existing network key management device based on the response of the target existing network key management device to the network access request; after completing the identity verification, obtain the simulated quantum key, and send the simulated quantum key to the target existing network key management device.
7. A quantum key real-time simulation software system based on the BB84 protocol according to claim 3, characterized in that: The quantum layer is further configured to obtain a bit transmission rate of the simulated quantum state information and send the bit transmission rate to the management layer; The management layer is further configured to receive and store the bit transmission rate sent by the quantum layer; respond to the bit transmission rate acquisition request sent by the interface presentation layer, and send the bit transmission rate to the interface presentation layer; The interface display layer is further used to send a bit transmission rate acquisition request to the management layer in response to the user's operation of obtaining quantum layer state information; receive the first response information of the management layer to the bit transmission rate acquisition request, and display the first response information to the user; the first response information includes the bit transmission rate.
8. A quantum key real-time simulation software system based on the BB84 protocol according to claim 3, characterized in that: The post-processing layer is further configured to obtain a quantum bit error rate and a key generation rate, and send the quantum bit error rate and the key generation rate as post-processing layer state information to the management layer; The management layer is further configured to receive and store the post-processing layer status information sent by the post-processing layer; respond to a post-processing layer status information acquisition request sent by the interface presentation layer, and send the post-processing layer status information to the interface presentation layer; The interface display layer is also used to respond to the user's operation of obtaining the post-processing layer status information, send a post-processing layer status information acquisition request to the management layer, receive the management layer's second response information for the post-processing layer status information acquisition request, and display the second response information to the user; the second response information includes the post-processing layer status information.
9. A quantum key real-time simulation software system based on the BB84 protocol according to claim 1, characterized in that: The transmission layer also includes a free space noise module; The free space noise module is used to generate free space noise according to a preset configuration file, and perform simulated perturbations on the simulated quantum channel according to the free space noise.
10. A quantum key real-time simulation software system based on the BB84 protocol according to claim 1, characterized in that: The transmission layer further includes a fiber channel noise module; the fiber channel noise module is configured to generate fiber channel noise according to a preset configuration file, and simulate disturbances on the simulated quantum channel according to the fiber channel noise.
Citation Information
Patent Citations
Quantum cryptography teaching system based on BB84 protocol and communication method thereof
CN102185693A
Quantum secret data chain communication system
CN110247765A