Integrated anomaly detection method for quantum cryptography system based on machine learning

By applying anomaly detection method based on machine learning in the quantum key distribution QKD system, using Gaussian hybrid model GMM to identify device errors and eavesdropper attacks, the problems of security vulnerabilities and low key transmission efficiency in the prior art are solved, and a more efficient and secure quantum cryptographic system is realized.

CN119921948AActive Publication Date: 2025-05-02NANJING UNIV OF POSTS & TELECOMM
View PDF 9 Cites 0 Cited by

Patent Information

Application Number
CN202510082037.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-20
Publication Date
2025-05-02
Estimated Expiration
2045-01-20

AI Technical Summary

Technical Problem

In actual applications, existing quantum key distribution QKD systems face security vulnerabilities due to device imperfection and eavesdropper attacks, resulting in reduced key transmission efficiency and practicality.

Method used

Using an integrated anomaly detection method of quantum cryptography system based on machine learning, the sliding window and Gaussian hybrid model GMM are used to identify modulation errors and eavesdropper attacks in the quantum cryptography system through simulation data training and experimental data testing.

Benefits of technology

Without the need for additional equipment and interruption of key transmission, the cost is significantly reduced, efficiency is improved, and the ability to identify unknown exception types is enhanced, enhancing the security of the quantum cryptographic system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119921948A_ABST
    Figure CN119921948A_ABST
Patent Text Reader

Abstract

The invention discloses a quantum cryptography system integrated anomaly detection method based on machine learning, which not only can identify modulation errors of various devices in a quantum cryptography system, but also can detect common eavesdropper attacks. According to the integrated detection method based on the time sequence Gaussian mixture model, provided by the invention and proved by experiments, simulation data is used for training, experimental data is used for testing, and a more convenient solution is provided for a user while relatively high accuracy is kept. In addition, the method does not need additional equipment or interrupt key transmission, so that the cost is reduced and the efficiency is improved. Meanwhile, the method can identify unknown anomalies, and provides additional guarantee for system safety. Therefore, the work not only can provide a new solution for the security evaluation of the quantum cryptography system, but also can provide a new perspective for the development of a large-scale quantum security network.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of quantum cryptography technology, and in particular to an integrated anomaly detection method for a quantum cryptography system based on machine learning. Background Art

[0002] Quantum key distribution (QKD) uses the basic principles of quantum mechanics to enable two communicating parties, Alice and Bob, to generate keys for encryption or authentication even in the presence of an eavesdropper. When combined with the "one-time pad" encryption method, quantum key distribution (QKD) theoretically ensures unconditional security. However, achieving unconditional security requires idealized conditions, such as ideal quantum state preparation and perfect single-photon detection. In practical applications, factors including the limited extinction ratio in quantum state preparation, the fluctuations and correlations of the light intensity of the actual light source, and the imperfections of the detector may introduce potential security vulnerabilities.

[0003] At the transmitting end, quantum fluctuations and imperfections of modulation devices introduce random fluctuations in the intensity of the light source, causing the intensity values ​​of the signal state and the decoy state to deviate from the expected values. In addition, phase modulators are mainly used for phase randomization of weak coherent states in decoy state schemes, as well as phase modulation and demodulation in phase encoding schemes. At present, the "scan-transmit" procedure is usually used for phase calibration, and additional monitoring and measurement are required to evaluate the intensity and phase deviation of the modulation. At the receiving end, quantum key distribution QKD systems usually rely on multiple detectors. In security analysis and theoretical models, it is usually assumed that the performance parameters of these detectors are the same. However, in practical applications, the detection efficiency of each detector varies over time. Due to the imperfections or errors in actual quantum key distribution QKD devices, eavesdroppers may exploit these vulnerabilities to launch hacker attacks, which threatens the practical security of quantum cryptographic systems. In addition, some modulation errors may be actively introduced by the eavesdropper Eve, such as induced light refraction attacks, laser damage attacks, and laser injection attacks. These attacks may cause damage to various devices, resulting in changes in the light intensity of the prepared quantum state. One possible solution is to use an additional incident light monitor to detect the injected light, however, the classical monitor itself may be damaged by the high-intensity light introduced by the eavesdropper. Currently, most existing quantum key distribution (QKD) system evaluation schemes require calibration and detection of all components before and after key transmission. These processes not only require a lot of human and material resources, but also reduce the transmission efficiency and practicality of quantum key distribution (QKD). Summary of the invention

[0004] The purpose of the present invention is to address the deficiencies of the above-mentioned prior art and propose a quantum cryptography system integrated anomaly detection method based on machine learning. The method can be applied to the quantum cryptography system and can identify the modulation errors of various devices in the quantum cryptography system and common eavesdropper attacks. The method uses simulation data for training and experimental data for testing, while maintaining high accuracy, it provides users with a more convenient solution. The solution of the present invention greatly reduces costs and improves efficiency without the need for additional equipment and interruption of key transmission.

[0005] The present invention discloses a method for detecting anomalies in a quantum cryptography system based on machine learning. The method uses a sliding window to input mismatched base data x into a Gaussian mixture model GMM in a continuous time series. The anomaly type Y label As the output label of Gaussian mixture model GMM, the Gaussian mixture model GMM is trained;

[0006] Get the trained Gaussian mixture model GMM, the number of trained Gaussian mixture models GMM and the anomaly type Y label The same number, that is, a separate Gaussian mixture model GMM is trained for each anomaly type, and each anomaly type Y label Corresponding to a trained Gaussian mixture model GMM;

[0007] The abnormal mismatch base data x is input into all trained Gaussian mixture models GMM in a sliding window manner, and the posterior probability of each set of sliding window sequence data for each abnormal type is calculated, and the abnormal type Y corresponding to the maximum posterior probability is selected. label As the exception type that does not match the base data x, it is also the exception type of the quantum cryptography system.

[0008] Furthermore, the size of the sliding window is greater than or equal to 3, and the step size is 1;

[0009] So the mismatched base data x is written as a continuous time series: t ,X t+1 ,X t+2 ,X t+3 …X t+N-1 ;X t Represents the unmatched base data at time t.

[0010] Further, the mismatched base data includes counts of eight mismatched bases, represented as: MZ0X0, MZ0X1, MZ1X0, MZ1X1, MX0Z0, MX0Z1, MX1Z0, MX1Z1;

[0011] Among them, MZ0X0 represents the count of Alice selecting Z-based coding bit 0 and Bob selecting X-based coding bit 0; MZ0X1 represents the count of Alice selecting Z-based coding bit 0 and Bob selecting X-based coding bit 1; MZ1X0 represents the count of Alice selecting Z-based coding bit 1 and Bob selecting X-based coding bit 0; MZ1X1 represents the count of Alice selecting Z-based coding bit 1 and Bob selecting X-based coding bit 1; MX0Z0 represents the count of Alice selecting X-based coding bit 0 and Bob selecting Z-based coding bit 0; MX0Z1 represents the count of Alice selecting X-based coding bit 0 and Bob selecting Z-based coding bit 1; MX1Z0 represents the count of Alice selecting X-based coding bit 1 and Bob selecting Z-based coding bit 0; MX1Z1 represents the count of Alice selecting X-based coding bit 1 and Bob selecting Z-based coding bit 1.

[0012] Furthermore, the exception type Y label Including phase error, efficiency mismatch, intensity fluctuation, phase error + efficiency mismatch, efficiency mismatch + intensity fluctuation, phase error + intensity fluctuation, phase error + efficiency mismatch + intensity fluctuation and attack.

[0013] Furthermore, the abnormal mismatching base data refers to the abnormal score S(x) of the mismatching base data x being outside the normal fluctuation range; the calculation process of the abnormal score S(x) is as follows:

[0014] In the actual quantum cryptography system, mismatched base data is obtained, and the probability density function p(x) obtained by multiple Gaussian distributions in the quantum key distribution system is used. The probability density function p(x) is first logarithmized and then inverted to obtain the abnormal score S(x) of the mismatched base data.

[0015] Furthermore, the method for obtaining the normal fluctuation range is as follows:

[0016] In a normally operating quantum cryptography system, mismatched base data are obtained, and the probability density function p(x) required by multiple Gaussian distributions is fitted. The probability density function p(x) is first logarithmic and then inverted to obtain the abnormal score S(x) of the normal mismatched base data. 正常 ), the abnormal score S(x) of the normal mismatch base data 正常 ) is the normal fluctuation range:

[0017] Furthermore, it does not match the single Gaussian distribution of the base data x as follows:

[0018]

[0019] d represents the vector dimension of the mismatched base data points, μ is the mean vector of the Gaussian component, Σ is the covariance matrix of the Gaussian component, |Σ| is the determinant of the covariance matrix, Σ -1 is the inverse of the covariance matrix.

[0020] The Gaussian mixture model GMM is a weighted sum of multiple Gaussian distributions, and its probability density function p(x) is:

[0021]

[0022] K is the number of Gaussian components, ω k is the weight of the kth Gaussian component, satisfying μ k and Σ k are the mean vector and covariance matrix of the kth Gaussian component respectively;

[0023] The anomaly score S(x) is expressed as:

[0024] S(x)=-log(p(x)).

[0025] Furthermore, the expectation-maximization EM algorithm is used to estimate the parameters of the Gaussian mixture model GMM;

[0026] The expectation-maximization EM algorithm includes two steps: an expectation step E-step and a maximization step M-step;

[0027] E-step: Calculate the unmatched basis data x for the i-th input to the Gaussian mixture model GMM i The posterior probability γ belonging to the kth Gaussian component ik .

[0028]

[0029] x is an N×8 dataset, where i∈[1,N], μ j and Σ j are the mean vector and covariance matrix of the jth Gaussian component, μ k and Σ k are the mean vector and covariance matrix of the kth Gaussian component respectively;

[0030] M-step: Update the Gaussian mixture model GMM parameters according to the posterior probability calculated in the E-step.

[0031]

[0032] Repeat the E-step and M-step until the Gaussian mixture model GMM parameter ω k , μ k and Σ kThe change value is less than the set threshold or the maximum number of iterations is reached.

[0033] Furthermore, the posterior probability of each set of sliding window sequence data for each anomaly type is less than 10 -500 When the quantum cryptography system is considered to have unknown anomalies, it can identify unknown anomaly types during the testing phase, providing additional protection for system security. These unknown anomaly types do not require prior training to handle anomalies in the system.

[0034] Furthermore, during the training of the Gaussian mixture model GMM, the unmatched base data is simulated data, and the experimental data is used for testing.

[0035] Furthermore, the method is not only applicable to the phase-coded BB84 protocol quantum key distribution QKD system, but can also be applied to a variety of other quantum cryptographic protocols, including the measurement device-independent quantum key distribution MDI-QKD protocol, the quantum secret sharing QSS protocol, the dual-field quantum key distribution TF-QKD protocol, the quantum identity authentication QIA protocol and the quantum privacy amplification QPQ protocol; the method supports multiple encoding methods, including polarization coding, timestamp-phase, etc., and can adapt to different quantum communication channels and light source characteristics.

[0036] The beneficial effects of this method are as follows: Compared with the traditional method, the anomaly detection method based on the time series Gaussian mixture model (GMM) of the present invention greatly reduces the time required for the security assessment of the quantum cryptography system. The time requirement for the security assessment of the quantum cryptography system is significantly reduced. At the same time, this method uses simulation data for model training and uses experimental data for testing, providing users with a solution that is both convenient and highly accurate; no additional equipment is required, and no interruption of the key transmission process is required, thereby reducing costs and improving efficiency. In addition, this method can identify unknown anomaly types, providing additional protection for the security of the quantum cryptography system, enabling the system to cope with unknown security threats. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Figure 1 It is a diagram of an experimental device for verifying the method of the present invention.

[0038] Figure 2 It is an anomaly score map of four different types of anomalies at 100 km according to the present invention.

[0039] Figure 3 It is the confusion matrix result diagram of the present invention at 100km and 150km.

[0040] Figure 4 It is a comparison diagram of ROC curves of the present invention and other solutions.

[0041] Figure 5 It is a process schematic diagram of the method of the present invention. DETAILED DESCRIPTION

[0042] The technical scheme in the embodiment of the present invention will be further described in detail below in conjunction with the drawings in the embodiment of the present invention. Obviously, the described embodiment is only a part of the embodiment of the present invention, not all examples. Based on the embodiment of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0043] The present invention proposes an integrated anomaly detection method for a quantum cryptographic system based on machine learning, which can be applied to a quantum cryptographic system and can identify modulation errors of various devices in the quantum cryptographic system and common eavesdropper attacks. In this embodiment, a BB84 quantum key distribution QKD system using phase coding is used as an example for introduction. The quantum key distribution QKD system includes a transmitter Alice, a receiver Bob, and an eavesdropper Eve. Figure 5 The figure is a process diagram of the integrated anomaly detection method for quantum cryptography system based on machine learning. The whole process is divided into two parts: training phase and testing phase, in which simulation data is used in the training phase and actual experimental data is used in the testing phase:

[0044] Training phase:

[0045] Considering that it is impractical to collect experimental data of different environments and parameters in advance, the solution of the present invention uses simulation data for model training and uses experimental data for testing.

[0046] In the training part, the method of the present invention uses a sliding window to input the simulation data into the Gaussian mixture model GMM, such as Figure 5 As shown, the size of the sliding window is four consecutive time series [X t ,X t+1 ,X t+2 ,X t+3 ] is used as the input feature of the Gaussian mixture model GMM. The simulation data X at each moment t They all contain the counts of eight unmatched bases, namely MZ0X0,MZ0X1,MZ1X0,MZ1X1,MX0Z0,MX0Z1,MX1Z0,MX1Z1;

[0047] Among them, MZ0X0 represents the count of Alice selecting Z-based coding bit 0 and Bob selecting X-based coding bit 0; MZ0X1 represents the count of Alice selecting Z-based coding bit 0 and Bob selecting X-based coding bit 1; MZ1X0 represents the count of Alice selecting Z-based coding bit 1 and Bob selecting X-based coding bit 0; MZ1X1 represents the count of Alice selecting Z-based coding bit 1 and Bob selecting X-based coding bit 1; MX0Z0 represents the count of Alice selecting X-based coding bit 0 and Bob selecting Z-based coding bit 0; MX0Z1 represents the count of Alice selecting X-based coding bit 0 and Bob selecting Z-based coding bit 1; MX1Z0 represents the count of Alice selecting X-based coding bit 1 and Bob selecting Z-based coding bit 0; MX1Z1 represents the count of Alice selecting X-based coding bit 1 and Bob selecting Z-based coding bit 1.

[0048] Exception type Y label As output labels of the Gaussian mixture model GMM, the anomaly types include phase error, efficiency mismatch, intensity fluctuation, phase error + efficiency mismatch, efficiency mismatch + intensity fluctuation, phase error + intensity fluctuation, phase error + efficiency mismatch + intensity fluctuation and attack, a total of 8 anomaly types. The scheme of the present invention only uses 50 groups of simulation data at four consecutive moments to train the Gaussian mixture model GMM of each anomaly type, and a total of 8 trained Gaussian mixture models GMM are obtained, which enables the Gaussian mixture model GMM to learn the unique features of each anomaly type;

[0049] The 8 trained Gaussian mixture models GMM are used in the subsequent testing phase.

[0050] Testing phase:

[0051] Use actual quantum cryptography system experimental data for anomaly detection; during the operation of the quantum key distribution QKD system, collect the data of the mismatched bases of Alice (transmitter) and Bob (receiver) in real time. Alice and Bob announce their base selection information through the classical public channel. When they choose different bases, the measurement data of the mismatched bases is used for the integrated anomaly detection of the QKD system, which allows anomaly detection without interrupting key transmission. By calculating the anomaly score S(x) of each set of mismatched base data, it is determined whether the mismatched base data is normal;

[0052] The anomaly score S(x) of the unmatched base data point is calculated as follows:

[0053] First, this scheme needs to evaluate whether there are anomalies in the quantum key distribution QKD system. Due to the inevitable statistical fluctuations in the quantum key distribution QKD system, small errors within these fluctuations may be difficult to distinguish from normal fluctuations. Therefore, these small errors are classified as normal fluctuations, and the quantum key distribution QKD system is considered to be operating normally; the probability density function p(x) obtained by fitting multiple Gaussian distributions of the mismatched base data obtained under the normal operation of the quantum key distribution QKD system is first logarithmic and then inverted to obtain the abnormal score S(x) of the normal mismatched base data. 正常 ), according to the abnormal score S(x 正常 ) distribution range, and obtain the normal fluctuation range of S(x);

[0054] A single Gaussian distribution in d-dimensional space is as follows:

[0055]

[0056] x is the vector of d-dimensional mismatched basis data points, μ is the mean vector of Gaussian components, Σ is the covariance matrix of Gaussian components, |Σ| is the determinant of the covariance matrix, Σ -1 is the inverse of the covariance matrix. Where d = 8, x is an N×8 data set, corresponding to the measurement counts of 8 sets of mismatched bases detected in the quantum key distribution QKD system, and x can be written in the form of a continuous time series: t ,X t+1 ,X t+2 ,X t+3 , X t+4 …X t+N-1 ;

[0057] The Gaussian mixture model GMM is a weighted sum of multiple Gaussian distributions and is used to represent more complex data distributions. Its probability density function (PDF) is:

[0058]

[0059] K is the number of Gaussian components, ω k is the weight of the kth Gaussian component, satisfying μ k and Σ k are the mean vector and covariance matrix of the kth Gaussian component, respectively. In addition, in order to estimate the parameters of the Gaussian mixture model GMM, this scheme uses the expectation maximization EM algorithm. The expectation maximization EM algorithm consists of two steps: the expectation step (E-step) and the maximization step (M-step).

[0060] E-step: Calculate the unmatched basis data x for the i-th input into the Gaussian mixture model GMM i The posterior probability γ belonging to the kth Gaussian componentik .

[0061]

[0062] x is an N×8 dataset, where i∈[1,N], μ j and Σ j are the mean vector and covariance matrix of the jth Gaussian component, μ k and Σ k are the mean vector and covariance matrix of the kth Gaussian component respectively;

[0063] M-step: Update the model parameters according to the posterior probability calculated by E-step.

[0064]

[0065] Repeat the E-step and M-step until the above model parameter ω k , μ k and Σ k The change value of is less than the set threshold or reaches the maximum number of iterations. In this scheme, the maximum number of iterations is 100. In addition, if all model parameters ω in each iteration k , μ k and Σ k The change values ​​are all less than the set tolerance possibility threshold (10 -8 ), that is, the change is very small, indicating that the model parameters have converged and the algorithm terminates.

[0066] The anomaly score S(x) is expressed as:

[0067] S(x)=-log(p(x)).

[0068] This method defines an anomaly score S(x). When the anomaly score S(x) is within the normal fluctuation range, the corresponding experimentally measured mismatched base data is normal, indicating that the quantum key distribution QKD system is normal; when the anomaly score S(x) is outside the normal fluctuation range, the corresponding experimentally measured mismatched base data is abnormal, indicating that the QKD system is abnormal.

[0069] For the mismatched base data points identified as anomalies, the mismatched base data [X t ,X t+1 ,X t+2 ,X t+3 ],[X t+1 ,X t+2 ,X t+3 ,X t+4] and other sliding window sequences as features, and are input into 8 trained Gaussian mixture models GMM respectively. The data contained in a sliding window input into the trained Gaussian mixture model GMM is a set of sequence data. The posterior probability γ of each set of sliding window sequence data for each abnormal type is calculated. ik , and select the category with the highest posterior probability as the final type of system anomaly.

[0070] Figure 1 This is a diagram of the experimental device for verifying the integrated anomaly detection method of the quantum cryptography system based on machine learning of the present invention. At Alice's end, a 20MHz frequency laser Laser emits a light pulse with a central wavelength of 1550.6nm. The coded information is encoded in the optical phase through a self-made asymmetric Mach-Zehnder interferometer AMZI. The asymmetric Mach-Zehnder interferometer AMZI structure has an arm length difference of 6.3ns. A phase modulator PM is placed on the long arm of the asymmetric Mach-Zehnder interferometer AMZI, where the phase modulator PM at Alice's end realizes phase modulation; after interference is generated at the polarization beam splitter PBS, it reaches the intensity modulator IM. An intensity modulator IM is used to realize modulation of different intensities. The intensity of the laser pulse is attenuated to the single photon level through an attenuator ATT, and then transmitted to the quantum channel;

[0071] After the pulse reaches Bob's end, the phase modulator PM at Bob's end realizes phase demodulation. The modulated pulse interferes at the beam splitter BS, and the interference result is detected by superconducting nanowire single photon detectors SNSPD in two different channels. SNSPD operates at a temperature of 2.2K, providing a detection efficiency of 67% and an average dark count of 10Hz. At the same time, an ultraviolet laser diode is injected into the output of Alice's intensity modulator IM through a 1:99 beam splitter, and Eve's pulse is reversely injected into Alice's intensity modulator IM to achieve the attack.

[0072] In order to verify the effectiveness of the integrated real-time detection method of the present invention, the present invention is mainly verified from two perspectives: passive modulation error and active modulation error. Passive modulation error may come from actual equipment with inherent defects, environmental changes, and imperfect regulators. For passive modulation error, this scheme takes the intensity fluctuation caused by the intensity modulator IM, the phase error caused by the phase modulator PM, and the detector efficiency mismatch as examples for explanation, but it is not limited to these defects and can be adjusted according to the actual situation of the actual quantum cryptography system. The present invention designs a method for simulating modulation error, which changes the modulation point of all phases by artificially offsetting the original working voltage of the phase modulator PM to a certain extent to achieve the effect of phase modulation error. Similarly, the detector efficiency mismatch is simulated by adjusting the bias current of the detectors of different channels, because the bias current directly affects the efficiency of the superconducting nanowire single photon detector SNSPD. In order to simulate the intensity fluctuation, this scheme first measures the statistical fluctuation of the quantum key distribution QKD system under normal working conditions, which is 0.57% at a distance of 100km. In order to make the intensity fluctuation more obvious in the experiment, the attenuation value is adjusted by using a sequence designed based on Gaussian distribution, and the intensity fluctuation finally simulated is 3.52%.

[0073] In addition, the active modulation error actively introduced by Eve is also considered in this scheme. This embodiment demonstrates an induced photorefractive attack using LiNbO 3 The DC bias of the modulator drifts over time. The integrated anomaly detection method for quantum cryptographic systems based on machine learning is also applicable to other attacks, such as laser damage attacks, laser seeding attacks, etc. These attacks will cause certain damage to various devices, thereby causing changes in the light intensity of the prepared quantum state. Figure 1 As shown in the figure, the scheme uses a 445nm ultraviolet laser diode UVLD to generate pulses. The ultraviolet pulses pass through the 1:99 beam splitter BS in reverse and enter the intensity modulator IM at Alice's end to induce the photorefractive effect. Before implementing the attack, the DC bias of the intensity modulator IM is first calibrated to the correct voltage, and then the ultraviolet laser is turned on. In the experiment, Eve modulated the pulse with a power of 0.7mW, and the power reaching the intensity modulator IM was 0.2μW, which eventually caused the DC bias of the intensity modulator IM to shift and successfully implemented the attack.

[0074] Figure 2 Here are the anomaly scores for four different types of anomalies at a transmission distance of 100 km: Figure 2 (a) is the phase error, Figure 2 (b) in the equation is efficiency mismatch. Figure 2 (c) in the figure is the intensity fluctuation. Figure 2(d) in the figure is an attack. Each point in the figure represents the anomaly score calculated based on a set of measurement data with mismatched basis, and the data is collected at intervals of 0.5 seconds. The shaded area represents the anomaly score calculated from the simulation data, where the signal state strength is 0.5, the phase error is 0, and the detection efficiency is 67%. Considering the statistical fluctuation of 0.57%, the maximum and minimum anomaly scores of the simulation data are 71.8928 and 71.8446 respectively. Figure 2 (a) shows the situation when the voltage deviation is 0.1V and 0.2V. In the embodiment of the present invention, the half-wave voltage of the Bob-end phase modulator PM is 7.3V. The voltage deviations of 0.1V and 0.2V correspond to phase deviations of 0.043° and 0.086°, respectively. All data points fall outside the shaded area, indicating that the data points are considered abnormal. Figure 2 (b) shows the situation when the detection efficiency changes from 67% to 65% and 63%. When the detection efficiency is 65%, most of the data are outside the shaded area, and only a few data are considered normal. At 65% efficiency, all data fall outside this range and are considered abnormal. Both intensity fluctuations and attacks will cause changes in intensity. However, intensity fluctuations alternate between increases and decreases, while attacks will cause sudden and unidirectional changes in intensity. Figure 2 (c) shows the abnormal score of intensity fluctuation. Since the intensity fluctuation follows a Gaussian distribution, most intensity values ​​are concentrated around 0.5. The shaded area in the figure represents the abnormal score corresponding to the normal simulated data, and the dots represent the measured data that fall within the expected range of the normal simulated data, which can be considered normal. In contrast, the triangle points represent the measured data outside this range, indicating that they are abnormal; Figure 2 (d) in Figure 2 shows the anomaly scores of 8 different induced photorefractive attacks performed by Eve, each of which is represented by a different style of dots. It can be clearly seen that at the moment of each attack, the anomaly score suddenly increases, indicating that the intensity deviates sharply from the normal range.

[0075] After identifying abnormal data, the sliding window sequences corresponding to the mismatched bases are extracted as features, and these sequences are input into 8 pre-trained Gaussian mixture models (GMMs). Then the posterior probability of these data in each category is calculated, and the category with the highest posterior probability is selected as the final type of system abnormality. -500 , the QKD system is considered to be an unknown anomaly. Figure 3 This is the confusion matrix result diagram of the present invention based on the time series Gaussian mixture model GMM algorithm at 100km and 150km, where: Figure 3 The confusion matrix result diagram of the method of the present invention at 100 km in (a) is shown in FIG. Figure 3(b) shows the confusion matrix result of the method of the present invention at 150 km. The ordinate is the number corresponding to the actual system anomaly type, and the abscissa is the number corresponding to the anomaly type predicted by the Gaussian mixture model GMM algorithm. A total of 1084 groups of abnormal data appeared at 100 km, and a total of 933 groups of abnormal data appeared at 150 km. Labels 1-9 respectively represent: 1) unknown anomaly, 2) phase error, 3) efficiency mismatch, 4) intensity fluctuation, 5) phase error + efficiency mismatch, 6) efficiency mismatch + intensity fluctuation, 7) phase error + intensity fluctuation, 8) phase error + efficiency mismatch + intensity fluctuation, 9) attack. The scheme of the present invention stands out in detecting unknown anomalies due to its soft classification method, and also shows higher accuracy in identifying known types. The accuracy rate at a distance of 100 km is 98.7%, which is significantly higher than 84.1% of the RF algorithm and 57.7% of the SVM algorithm. At the same time, the method of the present invention is further verified at a distance of 150 km. Similar to the result at 100 km, the accuracy of the scheme of the present invention is the highest, reaching 98.8%, while the accuracy rates of the RF and SVM algorithms are 62.1% and 80.2% respectively.

[0076] Figure 4 It is a comparison chart of ROC curves of the present invention and other solutions. Figure 4 (a) is a comparison of the ROC curves of the solution of the present invention and other solutions at 100 km. Figure 4 (b) is a comparison of the ROC curves of the scheme of the present invention and other schemes at 150km. The ROC curve illustrates the trade-off between the true positive rate (TPR) and the false positive rate (FPR) at different decision thresholds. A key indicator derived from the ROC curve is the area under the curve (AUC), which quantifies the overall ability of the classifier to distinguish between categories. An AUC of 1 indicates complete classification, and 0.5 indicates random guessing. From the results, it can be seen that the performance of the scheme of the present invention is the best, with an AUC of 0.999 at distances of 100km and 150km, which is significantly better than RF and SVM.

[0077] This method can be applied to a variety of quantum cryptographic protocols, including measurement device independent (MDI) QKD protocol, quantum secret sharing (QSS) protocol, dual field (TF) QKD protocol, quantum identity authentication (QIA) protocol and quantum privacy amplification (QPQ) protocol; the method supports a variety of encoding methods, including polarization encoding, timestamp-phase, etc., and can adapt to different quantum communication channels and light source characteristics.

[0078] The above description is only a preferred embodiment of the present invention, and the protection scope of the present invention is not limited to the above embodiment. Any equivalent modifications or changes made by ordinary technicians in this field based on the contents disclosed by the present invention should be included in the protection scope recorded in the claims.

Claims

1. A method for detecting anomalies in a quantum cryptographic system based on machine learning, characterized in that: Using a sliding window approach, the mismatched base data x is input into the Gaussian mixture model GMM in a continuous time series, and the anomaly type Y label As the output label of Gaussian mixture model GMM, the Gaussian mixture model GMM is trained; Get the trained Gaussian mixture model GMM, the number of trained Gaussian mixture models GMM and the anomaly type Y label The same number, that is, each exception type Y label Corresponding to a trained Gaussian mixture model GMM; The abnormal mismatch base data x is input into all trained Gaussian mixture models GMM in a sliding window manner, and the posterior probability of each set of sliding window sequence data for each abnormal type is calculated, and the abnormal type Y corresponding to the maximum posterior probability is selected. label As the exception type for mismatched base data x.

2. According to the method for detecting anomalies in a quantum cryptographic system based on machine learning in claim 1, it is characterized in that: The size of the sliding window is greater than or equal to 3, and the step size is 1; So the mismatched base data x is written as a continuous time series: t ,X t+1 ,X t+2 ,X t+3 …X t+N-1 ;X t Represents the unmatched base data at time t.

3. According to the method for detecting anomalies in a quantum cryptographic system based on machine learning in claim 1, it is characterized in that: The mismatched base data includes the counts of eight mismatched bases, represented as: MZ0X0, MZ0X1, MZ1X0, MZ1X1, MX0Z0, MX0Z1, MX1Z0, MX1Z1; Where MZ0X0 represents the count of Alice choosing Z-based coding bit 0 and Bob choosing X-based coding bit 0; MZ0X1 means Alice chooses the Z-based encoding bit 0 and Bob chooses the X-based encoding bit 1 count; MZ1X0 means Alice chooses the Z-based encoding bit 1, and Bob chooses the X-based encoding bit 0 count; MZ1X1 means Alice chooses the Z-based coded bit 1 and Bob chooses the count of X-based coded bit 1; MX0Z0 means Alice chooses the X basis to encode bit 0, and Bob chooses the Z basis to encode the count of bit 0; MX0Z1 means Alice chooses the count of bit 0 in the X-base code and bit 1 in the Z-base code; MX1Z0 means Alice chooses the X-base coded bit 1 and Bob chooses the Z-base coded bit 0 count; MX1Z1 means Alice chooses the X-base coded bit 1 and Bob chooses the count of the Z-base coded bit 1.

4. According to the method for detecting anomalies in a quantum cryptography system based on machine learning in claim 1, it is characterized in that: Exception type Y label Including phase error, efficiency mismatch, intensity fluctuation, phase error + efficiency mismatch, efficiency mismatch + intensity fluctuation, phase error + intensity fluctuation, phase error + efficiency mismatch + intensity fluctuation and attack.

5. According to the method for detecting anomalies in a quantum cryptography system based on machine learning in claim 1, it is characterized in that: The abnormal mismatching base data refers to the abnormal score S(x) of the mismatching base data x being outside the normal fluctuation range; The calculation process of the anomaly score S(x) is as follows: In the actual quantum cryptography system, mismatched base data are obtained, and the probability density function p(x) obtained by multiple Gaussian distributions in the quantum key distribution system is used. The probability density function p(x) is first logarithmized and then inverted to obtain the abnormal score S(x) of the mismatched base data.

6. According to the method for detecting anomalies in a quantum cryptographic system based on machine learning in claim 5, it is characterized in that: The method for obtaining the normal fluctuation range is as follows: Under a normally operating quantum cryptography system, mismatched base data are obtained, and the probability density function p(x) required by multiple Gaussian distributions is fitted. The probability density function p(x) is first logarithmized and then inverted to obtain the abnormal score S(x) of the normal mismatched base data. 正常 ), the abnormal score S(x) of the normal mismatch base data 正常 ) is the normal fluctuation range.

7. According to claim 5, a method for detecting anomalies in a quantum cryptography system based on machine learning is characterized in that: Does not match the base data x single Gaussian distribution as follows: d represents the vector dimension of the mismatched base data points, μ is the mean vector of the Gaussian component, Σ is the covariance matrix of the Gaussian component, |Σ| is the determinant of the covariance matrix, Σ -1 is the inverse of the covariance matrix; The Gaussian mixture model GMM is a weighted sum of multiple Gaussian distributions, and its probability density function p(x) is: K is the number of Gaussian components, ω k is the weight of the kth Gaussian component, satisfying μ k and Σ k are the mean vector and covariance matrix of the kth Gaussian component respectively; The anomaly score S(x) is expressed as: S(x)=-log(p(x)).

8. According to the method for detecting anomalies in a quantum cryptographic system based on machine learning in claim 7, it is characterized in that: The expectation-maximization (EM) algorithm is used to estimate the parameters of the Gaussian mixture model (GMM).

9. According to claim 7, a method for detecting anomalies in a quantum cryptography system based on machine learning is characterized in that: The expectation-maximization EM algorithm includes two steps: an expectation step E-step and a maximization step M-step; E-step: Calculate the unmatched basis data x for the i-th input to the Gaussian mixture model GMM i The posterior probability γ belonging to the kth Gaussian component ik ; x is an N×8 dataset, where i∈[1,N], μ j and Σ j are the mean vector and covariance matrix of the jth Gaussian component, μ k and Σ k are the mean vector and covariance matrix of the kth Gaussian component respectively; M-step: Update the Gaussian mixture model GMM parameters according to the posterior probability calculated in E-step; Repeat the E-step and M-step until the Gaussian mixture model GMM parameter ω k , μ k and Σ k The change value is less than the set threshold or the maximum number of iterations is reached.

10. The method for detecting anomalies in a quantum cryptography system based on machine learning according to claim 1, characterized in that: The posterior probability of each type of anomaly in each set of sliding window sequence data is less than 10 -500 When , it is considered that there are unknown anomalies in the quantum cryptography system.

Citation Information

Patent Citations

  • Attack detection method for continuous variable quantum key distribution system

    CN113037778A

  • Abnormal communication detection method for continuous variable quantum key distribution process

    CN113452523A

  • Universal double-field quantum key distribution protocol simulation method

    CN114666046A

  • Star-machine quantum key distribution simulation method under effect of boundary layer

    CN115664647A

  • Detection method for QKD system defect and hacker attack based on machine learning

    CN116319010A