CN-121980560-A - Method and equipment for rapidly evaluating random number safety based on neural network
Abstract
The invention belongs to the technical field of information security, and particularly relates to a method and equipment for rapidly evaluating random number security based on a neural network. The method utilizes the high-speed nonlinear mapping capability of the photon reserve pool to map the random bit stream into a high-dimensional time state sequence, and highlights key time structure characteristics by means of a time sequence mode attention mechanism so as to realize the sensitive detection of the randomness change of the physical entropy source. Compared with the existing method relying on statistical tests or large-scale deep learning models, the method fully utilizes the high-speed computing capacity of the photon reserve pool neural network and the extracting capacity of a time mode attention mechanism on a key time structure, does not need complex model training, is light and efficient in computing process, is easy to integrate with the hardware of an optical random number generator, and is suitable for real-time minimum entropy assessment of a high-speed physical entropy source.
Inventors
- GUO YUJING
- ZHANG JIANGUO
- WU TAO
- LI JINGXIA
Assignees
- 太原理工大学
Dates
- Publication Date
- 20260505
- Application Date
- 20260123
Claims (10)
- 1. A method for rapidly evaluating the safety of a random number based on a neural network is characterized by comprising the following steps: Acquiring an original random bit stream output by a physical entropy source to be detected, and performing mask modulation on the original random bit stream to generate an input signal; Constructing an optical reserve tank, modulating optical signals output by mutual injection coupling lasers in the optical reserve tank through the input signals, inputting the modulated optical signals into a delay feedback optical loop in the optical reserve tank, and outputting a high-dimensional time state sequence corresponding to the original random bit stream; performing time sequence mode attention analysis on the high-dimensional time state sequence to obtain a time context characteristic for prediction; Predicting the output result of random bits at the next moment of the physical entropy source to be detected based on the time context characteristics, and counting the matching condition between the predicted output result and the actual output result; And calculating global prediction probability and local prediction probability according to the prediction output result, calculating a minimum entropy evaluation value according to a larger value in the global prediction probability and the local prediction probability, and judging the safety of the random number output according to the minimum entropy evaluation value.
- 2. The method for quickly evaluating the random number security based on the neural network according to claim 1, wherein the masking modulation is performed on the original random bit stream to generate an input signal, and the method comprises the following steps: mapping the original random bit stream by adopting a single-heat coding mode to obtain a coded signal; and carrying out bit-by-bit amplitude modulation on the coded signal through a random mask sequence to generate the input signal.
- 3. The method for quickly evaluating the random number security based on the neural network according to claim 1, wherein the optical reserve pool comprises two master lasers, slave lasers and Mach-Zehnder modulators; Constructing an optical reserve tank, modulating an optical signal output by a mutual injection coupling laser in the optical reserve tank through the input signal, and inputting the modulated optical signal into a delay feedback optical loop in the optical reserve tank, wherein the delay feedback optical loop comprises: The two main lasers form a mutual injection coupling laser in a bidirectional light injection mode, and nonlinear dynamic coupling is generated between the two main lasers in the mutual injection coupling laser; Loading an output optical signal of the mutual injection coupling laser and the input signal to the Mach-Zehnder modulator, and modulating the output optical signal of the mutual injection coupling laser through the input signal; the modulated output optical signal is input into the slave laser, and the output optical signal of the slave laser is partially fed back to the input end of the slave laser after passing through an optical fiber delay line, an optical attenuator and an optical fiber reflector.
- 4. A method for rapid evaluation of random number security based on neural network according to claim 3, wherein outputting a high-dimensional time state sequence corresponding to the original random bit stream comprises: Photoelectric detection and high-speed sampling are carried out on the output signals of the photon storage pool, and a corresponding electric signal sequence is obtained; due to the time expansion effect of mask modulation, a plurality of sampling points can be obtained in each input random bit period, and a plurality of virtual node states are corresponding; Setting delay time of delay feedback loop Sampling interval is The number of virtual nodes is: Combining the sampling points to obtain a moment Photon reservoir state vector of (c): Wherein the method comprises the steps of The number of virtual nodes; With continuous injection of random bit stream, a high-dimensional time state sequence corresponding to the original random bit stream is formed 。
- 5. The method for rapid evaluation of random number security based on neural network of claim 4, wherein performing a time-series pattern attention analysis on the high-dimensional time state sequence to obtain a time context feature for prediction comprises: Processing the high-dimensional time state sequence along the time dimension by adopting a plurality of groups of one-dimensional convolution operators through a time sequence mode attention module, extracting time sequence mode characteristics under different time scales, and forming a time sequence mode characteristic matrix through setting a multi-scale convolution kernel; Calculating the correlation between the state vector of the photon storage pool at the current moment and the time sequence mode characteristics under different time scales through the time sequence mode attention module, and obtaining attention weights corresponding to the time sequence mode characteristics under different time scales through normalization processing; and carrying out weighted aggregation on the time sequence mode characteristics according to the attention weight to obtain a context characteristic vector.
- 6. The method for quickly evaluating the random number security based on the neural network according to claim 5, wherein predicting the output result of the random bit at the next time of the physical entropy source to be tested based on the time context feature and counting the matching condition between the predicted output result and the actual output result comprises: Fusing the context feature vector with the photon storage pool state vector at the current moment, and obtaining fusion features through a full-connection layer and a nonlinear activation function; Calculating the prediction probability of the fusion feature mapped to be 1 of the next bit through an output layer; and obtaining a predicted bit value based on the prediction probability, comparing the predicted bit value with the true random bit output bit by bit, and counting the matching condition between the predicted output result and the actual output result.
- 7. The method for quickly evaluating the safety of a random number based on a neural network according to claim 5, wherein calculating a global prediction probability and a local prediction probability according to the prediction output result, calculating a minimum entropy evaluation value according to a larger value of the global prediction probability and the local prediction probability, and judging the safety of the random number output according to the minimum entropy evaluation value, comprises: At length of The number of samples predicted to be correct is set as Prediction accuracy The definition is as follows: At 99% confidence level, global prediction probability The formula is: Wherein, the coefficient 2.576 is a standard normal distribution quantile value corresponding to the 99% confidence level; Further calculation of local prediction probabilities at the same confidence level Setting local statistical parameters as And (3) with The local prediction probability satisfies: wherein the auxiliary variable The calculation is performed according to the following recurrence relation: wherein the initial conditions are that ; After the global prediction probability and the local prediction probability are obtained, the larger value of the global prediction probability and the local prediction probability is taken as the most unfavorable prediction probability : Calculating a minimum entropy evaluation value : Minimum entropy evaluation value Comparing with a preset safety threshold, when When the randomness of the physical entropy source to be detected is reduced and triggers an alarm or takes degradation and switching protection measures when the randomness is smaller than the preset safety threshold value, and when the randomness is reduced, the physical entropy source to be detected is judged to be random When the entropy source is larger than the preset safety threshold value, judging that the entropy source is in a safety state; and continuously updating the minimum entropy evaluation result in a sliding time window mode to realize online safety monitoring of the physical entropy source to be tested.
- 8. A neural network-based random number security rapid assessment device, characterized by comprising: The input signal generation module is used for acquiring an original random bit stream output by a physical entropy source to be detected, performing mask modulation on the original random bit stream and generating an input signal; The high-dimensional time state sequence generation module is used for constructing an optical reserve tank, modulating optical signals output by the mutual injection coupling lasers in the optical reserve tank through the input signals, inputting the modulated optical signals into a delay feedback optical loop in the optical reserve tank, and outputting a high-dimensional time state sequence corresponding to the original random bit stream; the time context feature generation module is used for carrying out time sequence mode attention analysis on the high-dimensional time state sequence to obtain a time context feature for prediction; The matching module is used for predicting the output result of the random bit at the next moment of the physical entropy source to be detected based on the time context characteristics, and counting the matching condition between the predicted output result and the actual output result; And the safety evaluation module is used for calculating global prediction probability and local prediction probability according to the prediction output result, calculating a minimum entropy evaluation value according to a larger value in the global prediction probability and the local prediction probability, and judging the safety of the random number output according to the minimum entropy evaluation value.
- 9. A computer device comprising an input output unit, a memory and a processor, the memory having stored therein computer readable instructions which, when executed by the processor, cause the processor to perform the steps of the method of any of claims 1 to 7.
- 10. A storage medium storing computer readable instructions which, when executed by one or more processors, cause the one or more processors to perform the steps in the method of any one of claims 1 to 7.
Description
Method and equipment for rapidly evaluating random number safety based on neural network Technical Field The invention belongs to the technical field of information security, and particularly relates to a method and a device for rapidly evaluating random number security based on a neural network, computer equipment and a storage medium. Background The existing minimum entropy evaluation method mainly comprises a statistical detection method and a prediction method based on a learning model. The statistical detection method generally needs a longer data sequence to obtain a stable conclusion, and the random change of the random sequence in a short time scale or a local range is difficult to reflect, while the evaluation method based on the deep neural network can mine potential correlation in the random sequence through predictive analysis, but has a complex model structure, the training process depends on a large number of samples, and the calculation process is mainly based on an electronic calculation platform, is easy to be limited by inference delay and calculation resources in a high-speed random number output scene, and is difficult to realize online and continuous safety monitoring of a physical entropy source. With the development of high-bandwidth physical entropy sources such as a high-speed optical random number generator, a laser noise entropy source, a chaotic optical entropy source and the like, the random number output rate is continuously improved, and the traditional evaluation method gradually shows defects in the aspects of instantaneity and sensitivity. In view of the above problems, researchers have come to pay attention to a computational framework for time series analysis using the dynamics of the physical system itself. The photon reserve pool calculation utilizes the nonlinear response of the optical device and the time memory effect introduced by the delay feedback, and can directly map the input random bit stream into a high-dimensional dynamic state sequence in the optical domain, thereby realizing the characterization of a complex time structure with lower calculation cost. By mask modulating the random bit stream and injecting into the photon reservoir, a state sequence containing multi-time scale information can be obtained, providing a richer feature basis for analyzing the potential predictability in random number output. Meanwhile, the time sequence mode attention mechanism can distinguish the importance of different time modes in the state sequence without depending on a large-scale depth network, and the key time slices related to the prediction result are highlighted, so that the recognition of the short-time or local predictable structures possibly existing in the random sequence is facilitated. Therefore, the high-speed high-dimensional mapping capability of the photon reserve pool is combined with a time sequence mode attention mechanism, and the method is used for predictive analysis and minimum entropy evaluation of a random number output sequence, so that a random number safety evaluation thought which has high speed, instantaneity and low computational complexity is hopefully constructed, and a systematic method and engineering implementation aiming at the research direction are still to be further perfected. Disclosure of Invention The invention provides a method, a device, computer equipment and a storage medium for quickly evaluating the safety of random numbers based on a neural network, which aims to solve at least one technical problem in the prior art. The first technical object of the present invention is to provide a method for rapidly evaluating the random number security based on a neural network, comprising: the method comprises the steps of obtaining an original random bit stream output by a physical entropy source to be detected, performing mask modulation on the original random bit stream, and generating an input signal; Constructing an optical reserve tank, modulating optical signals output by the mutual injection coupling lasers in the optical reserve tank through input signals, inputting the modulated optical signals into a delay feedback optical loop in the optical reserve tank, and outputting a high-dimensional time state sequence corresponding to an original random bit stream; performing time sequence mode attention analysis on the high-dimensional time state sequence to obtain a time context characteristic for prediction; based on the time context characteristics, predicting the output result of random bits at the next moment of the physical entropy source to be detected, and counting the matching condition between the predicted output result and the actual output result; And calculating global prediction probability and local prediction probability according to the prediction output result, calculating a minimum entropy evaluation value according to a larger value in the global prediction probability and the local prediction probability, and