Method and system for detecting quantum attacks on continuous variable quantum key distribution
By combining the quantum K-nearest neighbor method and Gaussian kernel similarity calculation with the quantum Grover search iterative algorithm, the hardware vulnerabilities and real-time detection issues of continuous variable quantum key distribution systems are solved, enabling real-time monitoring and classification of quantum attacks and improving the system's security and stability.
Patent Information
- Application Number
- CN202511748234.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-26
- Publication Date
- 2026-02-24
- Estimated Expiration
- 2045-11-26
AI Technical Summary
Existing continuous variable quantum key distribution systems are insufficient in addressing hardware vulnerabilities, the contradiction between real-time detection and accuracy, and the dynamic adaptability to new types of attacks. They cannot effectively block hybrid attacks in real time, and deep learning models are difficult to deploy on resource-constrained QKD terminals.
By employing the quantum K-nearest neighbor method, quantum superposition states are constructed by quantizing feature parameters and introducing index and tag registers. Combined with Gaussian kernel similarity calculation and quantum Grover search iterative algorithm, real-time monitoring and classification of quantum attacks are achieved.
It improves the security and stability of continuous variable quantum key distribution systems, enables effective detection and real-time monitoring of quantum attacks, reduces computational complexity, and adapts to various attack environments.
Smart Images

Figure CN121261890B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of quantum communication technology, and in particular to a quantum attack method and system for detecting continuous variable quantum key distribution. Background Technology
[0002] The statements in this section are merely background information related to the present invention and do not necessarily constitute prior art.
[0003] Quantum key distribution (QKD) is a secure communication protocol based on the principles of quantum mechanics, allowing senders and receivers to generate and share unconditionally secure random keys through insecure channels (such as optical fibers or free space). Continuous-variable quantum key distribution, in particular, plays an increasingly important role in future quantum communication. QKD utilizes the Heisenberg uncertainty principle and the quantum no-cloning theorem to achieve secure key distribution. Its core feature is encoding and transmitting key information using continuous variables of the light field, such as orthogonal components like amplitude and phase. However, due to limitations in physical devices or insufficient assumptions, security vulnerabilities may exist in practical QKD processes, providing opportunities for quantum hackers. Eavesdroppers can exploit the physical characteristics or signal processing vulnerabilities of the local oscillator at the system's receiver to launch local oscillator attacks. Eavesdroppers can also tamper with key parameters during system calibration (such as detector efficiency, local oscillator intensity, or time synchronization) to induce incorrect calibration of the security threshold, launching calibration attacks. Furthermore, eavesdroppers can exploit the physical defects of zero-difference detectors—specifically, the detector entering a nonlinear saturation operating region under strong light input, leading to distorted measurement results—to launch saturation attacks. Eavesdroppers exploit the wavelength-dependent vulnerability of beam splitters to manipulate the wavelength of optical signals, thereby controlling the selection of measurement basis vectors or noise parameters at the receiver and launching a wavelength attack. Eavesdroppers also exploit the nonlinear response characteristics of detectors under strong light illumination, injecting high-intensity light pulses to induce abnormal operation in the detector and launch a blinding attack. Summary of the Invention
[0004] To address the technical problems mentioned above, this invention provides a method and system for detecting quantum attacks in continuous-variable quantum key distribution (CVQKD). First, the feature parameters are quantized. Utilizing the superposition and entanglement of qubits, the feature information is mapped to the amplitude, angle, or ground state of the quantum state, effectively reducing computational complexity. A model is used to train the quantum parameters, and a controlled-swap quantum circuit is employed to measure the similarity between the test sample and the training state. Through repeated training iterations, the optimal K value is found. The trained model can be deployed on an integrated lightweight quantum module at the edge terminal. Ultimately, real-time monitoring of quantum attacks is achieved, thereby improving the security and stability of the CVQKD system.
[0005] To achieve the above objectives, the present invention adopts the following technical solution:
[0006] The first aspect of the present invention provides a method for detecting quantum attacks in continuous variable quantum key distribution.
[0007] A quantum attack method for detecting continuous-variable quantum key distribution includes:
[0008] The receiver processes the normal signals and various typical attack signals sent by the transmitter to obtain feature vectors.
[0009] During the training phase, the feature vectors are mapped to quantum states through amplitude encoding, and index registers and tag registers are introduced to construct the quantum superposition state of the training samples;
[0010] In the prediction phase, the quantum superposition state of the predicted sample is constructed. Based on the inner product between the quantum superposition state of the training sample and the quantum superposition state of the predicted sample, the Gaussian kernel similarity is calculated. The top K training samples with the highest similarity are selected. The tag registers corresponding to the top K training samples with the highest similarity are read, and the final attack detection result is output.
[0011] Furthermore, the typical attack signals include: LO local oscillator intensity attack signal, calibration attack signal, saturation attack signal, wavelength attack signal, and blinding attack signal.
[0012] Furthermore, the feature vector includes: shot noise, mean value of local oscillator optical power measurement, and measurement variance.
[0013] Furthermore, during the training phase, the feature vector is mapped to a quantum state through amplitude encoding, and an index register and a label register are introduced to construct a quantum superposition state of the training samples; the method includes:
[0014] The feature vector is normalized, and the normalized feature vector is mapped to the sample feature state through amplitude encoding.
[0015] The quantum superposition state of the training samples is constructed based on the index register, sample feature state, and label register.
[0016] Furthermore, the Gaussian kernel similarity is calculated based on the inner product between the quantum superposition states of the training samples and the quantum superposition states of the predicted samples; expressed by the following formula:
[0017]
[0018] in, The Gaussian kernel similarity between the test state and the j-th training state; Represents the quantum superposition state of the predicted sample; Represents the quantum superposition state of the training samples; express and The inner product, Indicates variance.
[0019] Furthermore, the top K most similar training samples are selected; the method includes:
[0020] Randomly initialize the index set K, and denote the remaining indices as follows: ;
[0021] For sample indexes outside the candidate set Construct a Grover oracl to determine if its similarity is greater than the minimum similarity in the candidate set:
[0022]
[0023] in, Indicates a value register; if If the minimum value in the current candidate set is replaced by the corresponding sample, then the minimum value in the current candidate set will be replaced by the corresponding sample.
[0024] Repeat the Grover search and replace operation until the K elements in the candidate set are stable as the top k most similar indices;
[0025] The final quantum state is measured to obtain the classical index set. That is, the index of the corresponding nearest neighbor sample.
[0026] Furthermore, the label registers corresponding to the top K most similar training samples are read, and the final attack detection result is output. The method includes: reading the label registers corresponding to the top K most similar training samples, and combining weighted voting or majority voting mechanism to output the final attack detection result.
[0027] A second aspect of the present invention provides a quantum attack system for detecting continuous variable quantum key distribution.
[0028] A quantum attack system for detecting continuous-variable quantum key distribution, comprising:
[0029] The data processing module is configured to process normal signals and various typical attack signals sent by the sending end at the receiving end to obtain feature vectors.
[0030] The training module is configured to: map the feature vectors to quantum states through amplitude encoding, and introduce index registers and label registers to construct the quantum superposition state of the training samples;
[0031] The prediction module is configured to: construct the quantum superposition state of the predicted sample; calculate the Gaussian kernel similarity based on the inner product between the quantum superposition state of the training sample and the quantum superposition state of the predicted sample; select the top K training samples with the highest similarity; read the tag registers corresponding to the top K training samples with the highest similarity; and output the final attack detection result.
[0032] A third aspect of the present invention provides a computer device comprising:
[0033] A processor, adapted to execute computer programs;
[0034] A computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps in the quantum attack method for detecting continuous-variable quantum key distribution as described in the first aspect above.
[0035] A fourth aspect of the present invention provides a computer-readable storage medium storing a computer program adapted to be loaded by a processor and executed the steps of the quantum attack method for detecting continuous-variable quantum key distribution as described in the first aspect above.
[0036] The fifth aspect of the present invention provides a computer program product or computer program.
[0037] This invention provides a computer program product or computer program comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the steps in the quantum attack method for detecting continuous-variable quantum key distribution as described in the first aspect above.
[0038] Compared with the prior art, the beneficial effects of the present invention are:
[0039] This invention targets normal signals and various typical attack signals emitted by the transmitting end. At the receiving end, it processes these signals to obtain feature vectors. During the training phase, the feature vectors are mapped to quantum states through amplitude encoding, and index and tag registers are introduced to construct the quantum superposition state of the training samples. In the prediction phase, the quantum superposition state of the predicted samples is constructed. Based on the inner product between the quantum superposition states of the training and predicted samples, Gaussian kernel similarity is calculated. The top K training samples with the highest similarity are selected. The tag registers corresponding to the top K training samples with the highest similarity are read, and the final attack detection result is output. This method not only effectively detects quantum hackers but also provides more practical security constraints for continuous variable quantum key distribution systems.
[0040] This invention first quantizes the feature parameters, utilizing the superposition and entanglement of qubits to map the feature information onto the amplitude, angle, or ground state of the quantum state, effectively reducing computational complexity. A model is then used to train the quantum parameters, employing a controlled-swap quantum circuit to measure the similarity between the test sample and the training state. Through repeated training iterations, the optimal K value is found. The trained model can be deployed on edge terminals integrating lightweight quantum modules. Ultimately, this enables real-time monitoring of quantum attacks, thereby improving the security and stability of the CVQKD system. Attached Figure Description
[0041] The accompanying drawings, which form part of this invention, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an improper limitation of the invention.
[0042] Figure 1 This is a flowchart illustrating a quantum attack method for detecting continuous variable quantum key distribution, as shown in an embodiment of the present invention.
[0043] Figure 2 This is a flowchart illustrating another embodiment of the quantum attack method for detecting continuous variable quantum key distribution, as shown in this invention.
[0044] Figure 3 This is a detailed quantum circuit flowchart illustrating the training of eigenvalues into quantum states, as shown in an embodiment of the present invention.
[0045] Figure 4 This is a graph showing the F1 value variation of the QKNN attack detection framework under different K values as illustrated in the embodiments of the present invention.
[0046] Figure 5 This is a schematic diagram illustrating the optimal attack detection and identification matrix with K=4 as shown in an embodiment of the present invention; when K=4,
[0047] Figure 6 This is a graph showing the performance comparison curves of the original quantum K-nearest neighbor and the quantum K-nearest neighbor based on Gaussian kernel fidelity under actual noise conditions, as illustrated in an embodiment of the present invention.
[0048] Figure 7 This is a structural diagram of a quantum attack system for detecting continuous variable quantum key distribution, as shown in an embodiment of the present invention.
[0049] Figure 8 This is a structural diagram of a computer device shown in an embodiment of the present invention. Detailed Implementation
[0050] The present invention will be further described below with reference to the accompanying drawings and embodiments.
[0051] It should be noted that the following detailed description is illustrative and intended to provide further explanation of the invention. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.
[0052] It should be noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the scope of exemplary embodiments according to the invention. As used herein, the singular form is intended to include the plural form as well, unless the context clearly indicates otherwise. Furthermore, it should be understood that when the terms "comprising" and / or "including" are used in this specification, they indicate the presence of features, steps, operations, devices, components, and / or combinations thereof.
[0053] As introduced in the background section, the core problems currently faced by quantum key distribution attack detection technology in practical applications lie in the uncontrollability of hardware vulnerabilities, the contradiction between real-time detection and accuracy, and the insufficient dynamic adaptability to new types of attacks. For example, by tampering with shot noise calibration parameters ( Or inject strong light to manipulate the local oscillator power ( Excessive noise can be hidden, and while traditional hardware hardening solutions (such as variable attenuators) can provide partial defense, they may introduce new vulnerabilities and increase system complexity. On the other hand, existing detection methods rely on post-hoc parameter analysis (such as quantum bit error rate (QBER) calculation), which cannot block hybrid attacks (such as calibration attacks superimposed with saturation attacks) in real time, resulting in a false negative rate exceeding 10%. Meanwhile, while deep learning models (such as CNNs and GANs) can improve multi-attack identification capabilities, their high computational overhead makes them difficult to deploy on resource-constrained QKD terminals. To address at least one of the above technical problems, this invention provides a method and system for detecting quantum attacks in continuous variable quantum key distribution. The following describes the solution in detail through several embodiments.
[0054] Figure 1 This is a flowchart illustrating a quantum attack method for detecting continuous-variable quantum key distribution, as shown in an embodiment of the present invention; see reference. Figure 1 The method includes:
[0055] The receiver processes the normal signals and various typical attack signals sent by the transmitter to obtain feature vectors.
[0056] During the training phase, the feature vectors are mapped to quantum states through amplitude encoding, and index registers and tag registers are introduced to construct the quantum superposition state of the training samples;
[0057] In the prediction phase, the quantum superposition state of the predicted sample is constructed. Based on the inner product between the quantum superposition state of the training sample and the quantum superposition state of the predicted sample, the Gaussian kernel similarity is calculated. The top K training samples with the highest similarity are selected. The tag registers corresponding to the top K training samples with the highest similarity are read, and the final attack detection result is output.
[0058] This invention addresses the characteristics of quantum attacks by introducing a quantum machine learning technique to monitor attack signals in real time using the quantum K-nearest neighbor method. Specifically, attack signals affect characteristic parameters of the receiver, such as the measurement mean, measurement variance, shot noise, and local oscillator power. The model is trained by analyzing the differences in these characteristic parameters caused by different attacks, and the trained model is then used for prediction. Furthermore, the quantum K-nearest neighbor method uses a quantum Grover search iterative algorithm for ranking instead of a classical ranking algorithm, resulting in lower complexity and greater advantages in handling high-dimensional problems. This method not only effectively detects quantum hackers but also provides more practical security constraints for continuous-variable quantum key distribution systems.
[0059] Figure 2 This is a flowchart illustrating another embodiment of the quantum attack method for detecting continuous-variable quantum key distribution, as shown in this invention; see also... Figure 2 The method for detecting quantum attacks in continuous-variable quantum key distribution integrates the efficiency of quantum computing with the pattern recognition capabilities of classical machine learning. It achieves real-time identification and classification of attacks by analyzing anomalous signals in the quantum channel. This method can detect the impact of quantum attacks on feature parameters in real time, automatically classify and identify the types of quantum attacks, and provide more reasonable security constraints for CVQKD systems. The method includes the following steps:
[0060] Step 1: First, for normal signals and various typical attacks (such as local oscillator attacks, calibration attacks, saturation attacks, wavelength attacks, blinding attacks, etc.), statistical processing is performed on the packet pulse signals at the receiving end to extract physical parameters including mean, variance, local oscillation light intensity, and shot noise level, forming a low-dimensional feature vector u={ , , , }
[0061] Specifically, numerical simulations were performed on the Matlab platform based on the realistic assumptions of the CVQKD standard, covering the "normal state" and various attacks (such as LO local oscillator strength attacks, calibration attacks, saturation attacks, wavelength attacks, and blinding attacks). The receiver was divided into blocks, and the same set of measurable features (including shot noise) were extracted from each block. Local oscillator power Measure the mean Measurement of variance Forming sample-label pairs , where y j ∈{normal, local oscillation attack, ...}, thereby generating a dataset. The dataset is read to construct a CVQKD attack detection model; wherein, the CVQKD attack detection model includes:
[0062] (1) Data preprocessing module: First, in the data encoding stage, amplitude encoding is used to map the feature vectors of classical training samples to quantum states, thereby realizing efficient quantum representation of multidimensional features; at the same time, by introducing index registers and tag registers to construct the global superposition of training states, parallel storage and retrieval of all training samples are realized.
[0063] (2) Similarity Calculation Module: During the prediction phase, the test samples are also loaded in amplitude-encoded form and their similarity is calculated with the training state. The results are then stored in the similarity register. This process is based on the inner product of quantum states to measure the similarity between samples. Compared with classical methods, it can calculate all similarities simultaneously in an exponentially parallel space, which significantly improves the efficiency of nearest neighbor search.
[0064] (3) Sorting Algorithm Module: The results in the similarity register are sorted by similarity using quantum comparison and quantum minimum search algorithms, thereby achieving the sorting of similarity. The nearest neighbor sample is found with minimal complexity. If extended to the K-nearest neighbor case, the minimum search is repeated until the top K neighbors are obtained. Finally, the classification decision for the test sample is made by reading the label registers of the neighbors and using a majority vote or weighted voting mechanism.
[0065] (4) Decision output module: If the classification result is an attack, the corresponding pulse block is discarded or isolated; if it is normal, the key extraction is initiated.
[0066] Step 2: Map the feature vector to a quantum state through amplitude encoding, and introduce an index register and a tag register to construct the quantum superposition state of the training samples.
[0067] Specifically, for the feature parameters of the original CVQKD ( Feature normalization is performed, and Z-score normalization is used for preprocessing, i.e.:
[0068] (1)
[0069] Where mean(u) represents the mean of feature u, σ represents the standard deviation of feature u, and the data has been standardized. It conforms to the standard normal distribution, effectively eliminating the interference caused by differences in dimensions, making different dimensions comparable and satisfying the norm constraint of quantum amplitude encoding; then the training samples are encoded as quantum states and can be accessed in parallel.
[0070] Figure 3 This is a detailed quantum circuit flowchart illustrating the training of eigenvalues into quantum states, as shown in an embodiment of the present invention; Figure 3 As shown, two "characteristic bits" of qubits are used. , representing four-dimensional base Assume that the data has been preprocessed using the Z-score normalization method. ,in This represents the preprocessed value of the attack's characteristic data. The absolute value and sign of the amplitude are denoted as:
[0071] (2)
[0072] in, This represents the absolute value of the probability magnitude of the quantum state on the i-th basis vector (e.g., |00>, |01>, etc.). This indicates the possible phase information of the amplitude (a positive sign usually corresponds to phase 0, and a negative sign corresponds to phase π). Define the two-sided norm:
[0073] (3)
[0074] Divide the four amplitudes into two groups: the left group (corresponding to the basis vectors) and ) and the right group (corresponding to the basis vectors) and ),in This indicates that the quantum state has collapsed to the left group (i.e., the first qubit). for The square root of the total probability. This indicates that the quantum state has collapsed to the right group (i.e., the first qubit). for The square root of the total probability. From this, we obtain the rotation angle of the triangle decomposition:
[0075] (4)
[0076] in, The first qubit was determined to collapse to or The "tendency" Indicates according to and The proportion will The two basis vectors under the left branch are assigned: and , Indicates according to and The proportion will The two basis vectors under the right branch are assigned: and Circuit fabrication (from) (Departure): First, regarding Apply Pauli-Y revolving door To press ( , Cut into two pieces, left and right; then, controlled by =0 pairs Apply Pauli-Y revolving door (break down and controlled by =1 pair Apply Pauli-Y revolving door (break down Finally, check The symbol, if If it is negative, then in the corresponding ground state Apply conditional phase (coding Finally, the sample characteristic state is obtained. :
[0077] (5)
[0078] in, Let represent the amplitude of the i-th basis vector. A set of computational basis vectors representing a quantum system, such as , wait.
[0079] In addition, during the training state construction process, a label register is introduced for each sample. This is used to store information about the attack category to which it belongs. (Required) The qubits encode the category number in binary, where C represents the type of attack. Therefore, the training state, composed of an index register, a feature register, and a tag register... , written as:
[0080] (6)
[0081] Ultimately, the set of all training samples can be obtained through superposition states. :
[0082] (7)
[0083] Stored in a quantum register, where It is an index register. Let represent the feature state of the j-th sample, and M represent the number of samples in the training set.
[0084] Step 3: A controlled-SWAP quantum circuit is used to measure the similarity between the test sample and the training state. Quantum amplitude estimation is used to improve the measurement accuracy and efficiency. This invention proposes a Gaussian kernel similarity calculation method, thereby improving the robustness and robustness of the model.
[0085] Specifically, in the prediction phase, the characteristic information of the unknown attack label is quantized as described above to obtain the characteristic state. With each sample state in the training set The "similarity" is computed and stored in parallel. Normalized classical feature vectors are mapped to quantum states using amplitude encoding; the inner product of two vectors corresponds to the inner product of their quantum states. Calculate fidelity :
[0086] (8)
[0087] Since the impact of noise in actual quantum channels is not taken into account, using only the inner product of quantum states as the fidelity calculation may lead to excessively low robustness of the system. Therefore, this invention proposes a similarity calculation method based on Gaussian kernels as a similarity metric; the formula is as follows:
[0088] (9)
[0089] in, The Gaussian kernel width parameter, Let be the Gaussian kernel similarity between the test state and the j-th training state.
[0090] For each training sample index j, a controlled-SWAP (c-SWAP) test can couple the fidelity information of the two states to an auxiliary bit measurement probability based on Gaussian kernel fidelity. superior:
[0091] (10)
[0092] Thus, the Gaussian kernel fidelity is obtained:
[0093] (11)
[0094] As a measure of sample similarity. If the measurement is repeated S times for each j to estimate... The measurement variance is scaled according to a binomial distribution; if the accuracy is considered... and confidence level estimate Then the lower bound of the number of rounds satisfies:
[0095] (12)
[0096] Here, S indicates that at least S measurements are required to guarantee the Gaussian kernel fidelity is reliable. A c-swap is performed in parallel on each j using the index register (controlled by the index bits), thus generating the kernel in a superposition state all at once:
[0097] (13)
[0098] in, It is the result of the preparation stage and is an essential intermediate process required for the derivation of formula (14).
[0099] To represent similarity as comparable bit strings in a quantum register, amplitude estimation is further employed to... Mapped to a numeric register and all Preserved in superposition state :
[0100] (14)
[0101] This allows for the subsequent use of a sorting algorithm to find the top K nearest neighbors. A Gaussian kernel is used to smooth noise perturbations, reducing the reliance on single high-similarity samples in the neighbor selection process and thus mitigating the impact of noise outliers.
[0102] Step 4: After obtaining all similarity information, it is necessary to find the K closest neighbors from the training set; the similarity is searched based on the quantum Grover search iterative algorithm to obtain the top K training samples with the highest similarity.
[0103] Specifically, after calculating the Gaussian kernel similarity between the test samples and all training samples, the quantum Grover search iterative algorithm is used in the attack prediction phase. Find it on The K largest indices.
[0104] (1) Randomly initialize the index set K (size K), and denote the remaining indices as... .
[0105] (2) For sample indexes outside the candidate set Construct a Grover oracl to determine if its similarity is greater than the minimum similarity in the candidate set:
[0106] (14)
[0107] If such a sample exists, then replace the minimum value in the current candidate set with it.
[0108] (3) Repeat the Grover search and replace operation until the K elements in the candidate set are stable as the top k most similar indices.
[0109] (4) Measure the final quantum state to obtain the classical index set. That is, the index of the corresponding nearest neighbor sample.
[0110] Step 5: Read the label register corresponding to the training sample, and output the final attack detection result by combining weighted voting or majority voting mechanism.
[0111] Specifically, in the quantum KNN classification process, the choice of the nearest neighbor number K has a significant impact on the model's detection performance. Too small a K value may cause the prediction to be overly sensitive to noise, while too large a K value may introduce too many irrelevant neighbors, thus weakening the model's ability to distinguish attack samples. Therefore, a validation mechanism is introduced during the model training phase to determine the optimal K value. Specifically, for each validation sample, its similarity to the training samples is first calculated using quantum state amplitude encoding, and then the complete ordered neighbor sequence and its corresponding similarity are obtained using the quantum Grover search iterative algorithm. Subsequently, in different... Prefix cumulative voting is performed on each class, and the classification performance index on the validation set is calculated. The macro-average F1 score is used as the performance index. For example, for each class... Calculate Precision, Recall, and F1 scores separately using the following formulas:
[0112] (14)
[0113] in, This represents the number of samples that correctly predict class c as c; This represents the number of samples that were mispredicted as c for other categories; This represents the number of samples that were incorrectly predicted as other classes for class c. Finally, by comparing the validation set performance curves under different K values, the optimal value at which classification performance reaches its peak can be effectively identified. In actual implementation, a candidate limit is set. The search employs a sequential search and early stopping strategy to avoid excessive computational resource consumption. When the validation set performance significantly degrades across multiple consecutive K values, the search is stopped and the previously optimal value is selected. Experimental results show that this method can balance computational complexity with model accuracy, resulting in a robust and interpretable final K value.
[0114] Significant differences in the physical implementation and operational principles of various detection schemes lead to increased system complexity and detection anomalies. To address these issues and verify the versatility and adaptability of the proposed method, applicable to multiple mainstream quantum key distribution protocols, this invention introduces quantized parameter features into the model input and employs a Gaussian kernel similarity calculation method in the similarity calculation of quantized parameters. This method is compared with traditional similarity calculation methods and utilizes a quantum Grover search iterative algorithm. Specifically, feature vectors are mapped to quantum states through amplitude encoding, which is beneficial for solving high-dimensional problems. Furthermore, the Gaussian kernel similarity calculation method reduces the impact of noise on outliers in the actual system, significantly improving the system's robustness. The ranking algorithm, employing a quantum algorithm, further accelerates the running time, achieving real-time detection. This design enables the model to automatically and quickly learn the feature distribution differences under different attacks during the training phase, thereby achieving adaptive adjustment and discrimination during the detection phase, enhancing the system's adaptability to multi-attack environments.
[0115] On the same training dataset, the method of this invention achieves higher accuracy, recall, and F1 score against various quantum attacks, reaching 100% attack identification. Specific simulation results are shown in Tables 1, 2, and 3.
[0116] Table 1 Accuracy
[0117]
[0118] Table 2 Recall Rate
[0119]
[0120] Table 3 F1
[0121]
[0122] Furthermore, using the Gaussian kernel inner product method significantly improves the robustness and robustness of the model. At a simulation noise level of 2%, the macro-average accuracy without the Gaussian kernel is only 0.8839, and the macro-average F1 score is 0.8772, while the macro-average accuracy with the Gaussian kernel is 0.9767, and the macro-average F1 score is 0.9771. At a noise level of 5%, the macro-average accuracy without the Gaussian kernel is 0.8206, and the macro-average F1 score is 0.8076, while the macro-average accuracy with the Gaussian kernel is 0.9556, and the macro-average F1 score is 0.9563. Therefore, using the Gaussian kernel inner product method for similarity calculation in practical quantum channels is more suitable for real-world applications. Figure 4 This is a graph showing the F1 value variation of the QKNN attack detection framework under different K values as illustrated in the embodiments of the present invention; after the K value is greater than 4, the performance of QKNN shows a fluctuating decrease. Figure 5This is a schematic diagram of the attack detection and identification matrix with optimal K=4 shown in the embodiment of the present invention; when K=4, 100% identification of all the above-mentioned known attacks is achieved.
[0123] However, due to interference from quantum hackers, the actual security key rate of the CVQKD system will have a more reasonable security constraint limit than the theory.
[0124] Figure 6 This is a graph showing the performance comparison curves of the original quantum K-nearest neighbors and the quantum K-nearest neighbors based on Gaussian kernel fidelity under actual noise conditions, as illustrated in the embodiments of the present invention. The graph includes the macro-average accuracy and the macro-average F1 value. The quantum K-nearest neighbors based on Gaussian kernel fidelity have stronger robustness.
[0125] The above combination Figure 1 The quantum attack method for detecting continuous variable quantum key distribution provided by the embodiments of the present invention has been described in detail. Next, the quantum attack system for detecting continuous variable quantum key distribution provided by the embodiments of the present invention will be described in conjunction with the accompanying drawings.
[0126] Figure 7 This is a schematic diagram of the structure of a quantum attack system for detecting continuous-variable quantum key distribution, as shown in an embodiment of the present invention. Figure 7 The system described in this invention includes:
[0127] The data processing module is configured to process normal signals and various typical attack signals sent by the sending end at the receiving end to obtain feature vectors.
[0128] The training module is configured to: map the feature vectors to quantum states through amplitude encoding, and introduce index registers and label registers to construct the quantum superposition state of the training samples;
[0129] The prediction module is configured to: construct the quantum superposition state of the predicted sample; calculate the Gaussian kernel similarity based on the inner product between the quantum superposition state of the training sample and the quantum superposition state of the predicted sample; select the top K training samples with the highest similarity; read the tag registers corresponding to the top K training samples with the highest similarity; and output the final attack detection result.
[0130] In some embodiments, the typical attack signals include: LO local oscillator intensity attack signal, calibration attack signal, saturation attack signal, wavelength attack signal, and blinding attack signal.
[0131] In some embodiments, the feature vector includes: shot noise, mean local oscillator power measurement, and measurement variance.
[0132] In some embodiments, the step of mapping the feature vector to a quantum state through amplitude encoding during the training phase, and introducing an index register and a tag register to construct a quantum superposition state of the training sample, includes: normalizing the feature vector, mapping the normalized feature vector to a sample feature state through amplitude encoding, and constructing a quantum superposition state of the training sample based on the index register, the sample feature state, and the tag register.
[0133] In some embodiments, the Gaussian kernel similarity is calculated based on the inner product between the quantum superposition states of the training samples and the quantum superposition states of the predicted samples; expressed by the following formula:
[0134]
[0135] in, The Gaussian kernel similarity between the test state and the j-th training state; Represents the quantum superposition state of the predicted sample; Represents the quantum superposition state of the training samples; express and The inner product, Indicates variance.
[0136] In some embodiments, the top K most similar training samples are selected; including:
[0137] Randomly initialize the index set K (size K), and denote the remaining indices as... ;
[0138] For sample indexes outside the candidate set Construct a Grover oracl to determine if its similarity is greater than the minimum similarity in the candidate set:
[0139]
[0140] in, Indicates a value register; if If the minimum value in the current candidate set is replaced by the corresponding sample, then the minimum value in the current candidate set will be replaced by the corresponding sample.
[0141] Repeat the Grover search and replace operation until the K elements in the candidate set are stable as the top k most similar indices;
[0142] The final quantum state is measured to obtain the classical index set. That is, the index of the corresponding nearest neighbor sample.
[0143] In some embodiments, the label registers corresponding to the top K most similar training samples are read, and the final attack detection result is output; this includes: reading the label registers corresponding to the top K most similar training samples, and combining weighted voting or majority voting mechanisms to output the final attack detection result.
[0144] The quantum attack system for detecting continuous-variable quantum key distribution according to embodiments of the present invention can correspond to performing the methods described in the embodiments of the present invention, and the above and other operations and / or functions of the various modules of the quantum attack system for detecting continuous-variable quantum key distribution are respectively implemented to achieve Figure 1 For the sake of brevity, the corresponding processes of each method in the code will not be elaborated here.
[0145] See Figure 8 The diagram shows the structure of a computer device, which includes a processor, a communication interface, and a computer-readable storage medium. The processor, communication interface, and computer-readable storage medium are connected via a bus or other means. The communication interface is used to receive and transmit data. The computer-readable storage medium can be stored in the computer device's memory. The computer-readable storage medium stores computer programs, including program instructions, and the processor executes the program instructions stored in the computer-readable storage medium. The processor (or CPU, Central Processing Unit) is the computing and control core of the computer device, adapted to implement one or more instructions, specifically adapted to load and execute one or more instructions to implement the corresponding steps in the embodiments of the quantum attack method for detecting continuous variable quantum key distribution.
[0146] This embodiment provides a computer-readable storage medium (Memory), which is a memory device in a computer device used to store programs and data. It is understood that the computer-readable storage medium here can include both the built-in storage medium in the computer device and extended storage media supported by the computer device. The computer-readable storage medium provides storage space that stores the processing system of the computer device.
[0147] Furthermore, this storage space also contains one or more instructions suitable for loading and execution by the processor. These instructions can be one or more computer programs (including program code). It should be noted that the computer-readable storage medium here can be high-speed RAM memory or non-volatile memory, such as at least one disk storage device; optionally, it can also be at least one computer-readable storage medium located remotely from the aforementioned processor.
[0148] In one embodiment, the computer-readable storage medium stores one or more instructions; the processor loads and executes one or more instructions stored in the computer-readable storage medium to implement the corresponding steps in the above embodiment of the quantum attack method for detecting continuous variable quantum key distribution.
[0149] This embodiment provides a computer program product or computer program that includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the corresponding steps in the above-described embodiment of the method for detecting quantum attacks in continuous-variable quantum key distribution.
[0150] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of hardware embodiments, software embodiments, or embodiments combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage and optical storage) containing computer-usable program code.
[0151] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations 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, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0152] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0153] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0154] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc.
[0155] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A quantum attack method for detecting continuous-variable quantum key distribution, characterized in that, include: The receiver processes the normal signals and various typical attack signals sent by the transmitter to obtain feature vectors. During the training phase, the feature vectors are mapped to quantum states through amplitude encoding, and index registers and tag registers are introduced to construct the quantum superposition state of the training samples. During the construction of the training state, a tag register is introduced for each sample to store its attack category information. The typical attack signals include: LO local oscillator intensity attack signal, calibration attack signal, saturation attack signal, wavelength attack signal, and blinding attack signal. The feature vectors include: shot noise, mean value of local oscillator power measurement, and measurement variance. In the prediction phase, the quantum superposition states of the prediction samples are constructed. Based on the inner product between the quantum superposition states of the training samples and the quantum superposition states of the prediction samples, the Gaussian kernel similarity is calculated, expressed by the following formula: ; in, To predict the Gaussian kernel similarity between the quantum superposition state of the sample and the quantum superposition state of the j-th training sample; Represents the quantum superposition state of the predicted sample; Represents the quantum superposition state of the training samples; express and The inner product, Indicates variance; Select the top K training samples with the highest similarity; read the label registers corresponding to the top K training samples with the highest similarity, and output the final attack detection results.
2. The quantum attack method for detecting continuous-variable quantum key distribution according to claim 1, characterized in that, During the training phase, the feature vectors are mapped to quantum states through amplitude encoding, and index registers and label registers are introduced to construct the quantum superposition state of the training samples; the method includes: The feature vector is normalized, and the normalized feature vector is mapped to the sample feature state through amplitude encoding. The quantum superposition state of the training samples is constructed based on the index register, sample feature state, and label register.
3. The quantum attack method for detecting continuous-variable quantum key distribution according to claim 1, characterized in that, For each training sample index j, a controlled-SWAP test is used to couple the fidelity information of the two states to an auxiliary bit measurement probability based on Gaussian kernel fidelity. superior: ; Therefore, we get: As a measure of sample similarity; Select the top K most similar training samples; methods include: Randomly initialize the index set K, and denote the remaining indices as follows: ; For sample indexes outside the index set To determine if a Grover Oracle index has a similarity score greater than the minimum similarity score in the index set, the Grover Oracle algorithm is used. In this process, to represent similarity as comparable bit strings in the quantum register, amplitude estimation is further employed to... Mapped to a numeric register ;like If the minimum value in the current index set is replaced with the corresponding sample, then the minimum value in the current index set will be replaced. Repeat the Grover search and replace operation until the K elements in the index set are stable as the top k most similar indices; The final quantum state is measured to obtain the classical index set. That is, the index of the corresponding nearest neighbor sample.
4. The quantum attack method for detecting continuous-variable quantum key distribution according to claim 1, characterized in that, The method involves reading the label registers corresponding to the top K most similar training samples and outputting the final attack detection result.
5. A quantum attack system for detecting continuous-variable quantum key distribution, characterized in that, include: The data processing module is configured to process normal signals and various typical attack signals sent by the sending end at the receiving end to obtain feature vectors. The training module is configured to: map the feature vectors to quantum states through amplitude encoding, and introduce index registers and tag registers to construct the quantum superposition state of the training samples; wherein, during the construction of the training state, a tag register is introduced for each sample to store its attack category information, and the typical attack signals include: LO local oscillator intensity attack signal, calibration attack signal, saturation attack signal, wavelength attack signal, and blinding attack signal; the feature vectors include: shot noise, mean value of local oscillator power measurement, and measurement variance. The prediction module is configured to: construct the quantum superposition state of the prediction sample, and calculate the Gaussian kernel similarity based on the inner product between the quantum superposition states of the training samples and the quantum superposition states of the prediction sample, expressed by the following formula: ; in, To predict the Gaussian kernel similarity between the quantum superposition state of the sample and the quantum superposition state of the j-th training sample; Represents the quantum superposition state of the predicted sample; Represents the quantum superposition state of the training samples; express and The inner product, Indicates variance; Select the top K training samples with the highest similarity; read the label registers corresponding to the top K training samples with the highest similarity, and output the final attack detection results.
6. A computer device, characterized in that, A processor, adapted to execute computer programs; A computer-readable storage medium storing a computer program, which, when executed by the processor, implements the steps of the quantum attack method for detecting continuous variable quantum key distribution as described in any one of claims 1-4.
7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program adapted to be loaded by a processor and to execute the steps of the quantum attack method for detecting continuous variable quantum key distribution as described in any one of claims 1-4.
8. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, implements the steps in the quantum attack method for detecting continuous variable quantum key distribution as described in any one of claims 1-4.
Citation Information
Patent Citations
Continuous variable quantum key distribution method based on quantum k-nearest neighbor algorithm
CN116318655A
Quantum kernel method, classification method, data coding method and related systems and devices
CN117273157A