CN114330734A - Quantum random number detection method and system - Google Patents

Quantum random number detection method and system Download PDF

Info

Publication number
CN114330734A
CN114330734A CN202111674829.6A CN202111674829A CN114330734A CN 114330734 A CN114330734 A CN 114330734A CN 202111674829 A CN202111674829 A CN 202111674829A CN 114330734 A CN114330734 A CN 114330734A
Authority
CN
China
Prior art keywords
random number
detection
detection result
correlation coefficient
number sequence
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111674829.6A
Other languages
Chinese (zh)
Inventor
齐宁
张旭
刘敦伟
陈燕
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
61062 Troops Of Pla
Original Assignee
61062 Troops Of Pla
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 61062 Troops Of Pla filed Critical 61062 Troops Of Pla
Priority to CN202111674829.6A priority Critical patent/CN114330734A/en
Publication of CN114330734A publication Critical patent/CN114330734A/en
Pending legal-status Critical Current

Links

Images

Abstract

The application discloses a quantum random number detection method and system. Firstly, acquiring a random number sequence generated by a quantum random number generator; then, respectively carrying out statistical bias detection on the random number sequences to determine a first detection result; performing first-order correlation coefficient detection on the random number sequence to determine a second detection result; performing pseudo-random number standard packet detection on the random number sequence to determine a third detection result; and finally, determining the randomness detection result of the random number sequence according to the first detection result, the second detection result and the third detection result. Therefore, the quantum random number sequence is sequentially subjected to statistical bias detection, first-order correlation coefficient detection and pseudo-random number detection, so that quantum random number detection is completed, and a detection result is given.

Description

Quantum random number detection method and system
Technical Field
The invention relates to the field of random number detection, in particular to a quantum random number detection method and system.
Background
Random numbers have important application values in the fields of information security and the like, and the initial steps of various encryption algorithms are to generate high-quality random numbers. The random number is divided into a pseudo random number and a true random number, generally, the pseudo random number is a random number obtained by a mathematical method, a regular electronic circuit or other physical methods, and has the defects of limited length, regularity, repeatability, predictability and the like; true random numbers have completely reliable randomness, and quantum random numbers are representative thereof.
At present, pseudo-random number detection methods are rich and have multiple standards and test software, but with the generation of highly reliable and high-quality random numbers such as quantum random numbers, the conventional pseudo-random number detection methods are not satisfactory and cannot support the detection evaluation requirements of the higher-quality random numbers. Due to the limitation of manual experiments and implementation means, the quality of the quantum random number is different at present, so that the generated quantum random number needs to be strictly detected, but the existing pseudo-random number detection method is not enough to support quantum random number detection, and the detection effect of the existing method on the quantum random number is not good.
Disclosure of Invention
Based on this, the embodiment of the application provides a quantum random number detection method and system, which complete quantum random number detection and improve the detection effect of quantum random numbers through statistical bias detection, first-order correlation coefficient detection and pseudo-random number detection packets.
In a first aspect, a quantum random number detection method is provided, which includes:
acquiring a random number sequence generated by a quantum random number generator;
performing statistical bias detection on the random number sequence to determine a first detection result;
performing first-order correlation coefficient detection on the random number sequence to determine a second detection result;
performing pseudo-random number standard packet detection on the random number sequence to determine a third detection result;
and determining the randomness detection result of the random number sequence according to the first detection result, the second detection result and the third detection result.
Optionally, performing statistical bias detection on the random number sequence, including:
calculating the probability average value of all random numbers and the variance and standard deviation when the random number is 1 according to the random number sequence;
and determining a first detection result according to the standard deviation of the probability of the random number being 1.
Optionally, performing first-order correlation coefficient detection on the random number sequence, including:
defining a first order correlation coefficient of the random number;
and obtaining the standard deviation of the first-order correlation coefficient, and determining a second detection result according to the standard deviation of the first-order correlation coefficient.
Optionally, the defining a first order correlation coefficient of the random number includes:
defining a first order correlation coefficient of a random number according to a first formula, wherein the first formula specifically comprises:
Figure BDA0003450755030000021
wherein, a1Representing first order correlation coefficients, n representing the amount of data, xiDenotes the value of the ith random number, and p (1) is the proportion of 1 in the current data volume.
Optionally, performing statistical bias detection on the random number sequence, and determining a first detection result, includes:
setting detection intervals of the random number sequence, and performing statistical bias detection on each detection interval;
obtaining the detection passing results of all detection intervals;
and when the proportion of the detection passing results is not lower than the first threshold value, determining that the first detection result is passing.
Optionally, performing first-order correlation coefficient detection on the random number sequence, and determining a second detection result, includes:
setting detection intervals of the random number sequence, and carrying out first-order correlation coefficient detection on each detection interval;
obtaining the detection passing results of all detection intervals;
and when the proportion of the detection passing results is not lower than the second threshold value, determining that the second detection result is passing.
In a second aspect, there is provided a quantum random number detection system, the system comprising:
the acquisition module is used for acquiring a random number sequence generated by the quantum random number generator;
the first detection module is used for carrying out statistical bias detection on the random number sequence and determining a first detection result;
the second detection module is used for detecting the first-order correlation coefficient of the random number sequence and determining a second detection result;
the third detection module is used for carrying out pseudo-random number standard packet detection on the random number sequence and determining a third detection result;
and the determining module is used for determining the randomness detection result of the random number sequence according to the first detection result, the second detection result and the third detection result.
Optionally, performing statistical bias detection on the random number sequence, including:
calculating the probability average value of all random numbers and the variance and standard deviation when the random number is 1 according to the random number sequence;
and determining a first detection result according to the standard deviation of the probability of the random number being 1.
Optionally, performing first-order correlation coefficient detection on the random number sequence, including:
defining a first order correlation coefficient of the random number;
and obtaining the standard deviation of the first-order correlation coefficient, and determining a second detection result according to the standard deviation of the first-order correlation coefficient.
In the technical scheme provided by the embodiment of the application, firstly, a random number sequence generated by a quantum random number generator is obtained; then, respectively carrying out statistical bias detection on the random number sequences to determine a first detection result; performing first-order correlation coefficient detection on the random number sequence to determine a second detection result; performing pseudo-random number standard packet detection on the random number sequence to determine a third detection result; and finally, determining the randomness detection result of the random number sequence according to the first detection result, the second detection result and the third detection result. The invention designs a statistical bias and first-order correlation coefficient detection method, combines a pseudo-random number detection package, constructs a quantum random number detection method and a system, and a quantum random number sequence with detection sequentially passes through the statistical bias detection, the first-order correlation coefficient detection and the pseudo-random number detection package, thereby completing the quantum random number detection and giving a detection result.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below. It should be apparent that the drawings in the following description are merely exemplary, and that other embodiments can be derived from the drawings provided by those of ordinary skill in the art without inventive effort.
FIG. 1 is a flow chart of a quantum random number detection method according to an embodiment of the present disclosure;
FIG. 2 is a block diagram of a quantum random number detection process provided in an embodiment of the present application;
fig. 3 is a block diagram of a quantum random number detection system according to an embodiment of the present disclosure.
Detailed Description
The present invention is described in terms of particular embodiments, other advantages and features of the invention will become apparent to those skilled in the art from the following disclosure, and it is to be understood that the described embodiments are merely exemplary of the invention and that it is not intended to limit the invention to the particular embodiments disclosed. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The present application relates to a random number detection technology, and more particularly, to a quantum random number detection method and system. Aiming at the characteristics of randomness, statistical bias and the like of the quantum random number, detection methods such as a correlation coefficient, the statistical bias and the like are designed, and an integrated quantum random number detection system is designed by combining a pseudo-random number detection packet.
Specifically, please refer to fig. 1, which shows a flowchart of a quantum random number detection method provided in an embodiment of the present application, and the method may include the following steps:
step 101, acquiring a random number sequence generated by a quantum random number generator.
In the embodiment of the application, the random number in the random number sequence is binary, namely "0" or "1", the random number sequence of the quantum random number generator is obtained in real time, and the sequence length is not less than 100M bits.
Step 102, performing statistical bias detection on the random number sequence, and determining a first detection result.
In the embodiment of the application, the probability average value of all random numbers and the variance and standard deviation when the random number is 1 are calculated according to the random number sequence; and determining a first detection result according to the standard deviation of the probability of the random number being 1.
Specifically, the quantum random number statistical bias method is designed as follows:
in a random sequence of length nbit, there are a total of 2nIn a possible case, the probability of the mean x/n of the random code is:
p(x/n)=n!/[2nx!(n-x)!]
the variance of the number x of occurrences of a "1" can be calculated as:
Figure BDA0003450755030000051
where n is the length (number of bits), E (x)2) Is x2E (x) is a desire for x.
x follows a standard normal distribution, thus:
Figure BDA0003450755030000052
thus, the standard deviation of the probability p (1) of the occurrence of "1" is:
Figure BDA0003450755030000053
in an optional embodiment of the present application, a detection interval of the random number sequence may also be set, and statistical bias detection is performed on each detection interval;
obtaining the detection passing results of all detection intervals;
when the ratio of the detection passing results is not lower than the first threshold value (the passing ratio is not lower than 96%), the first detection result is determined to be passing.
And 103, performing first-order correlation coefficient detection on the random number sequence, and determining a second detection result.
In the embodiment of the application, a first-order correlation coefficient of a random number is defined; and obtaining the standard deviation of the first-order correlation coefficient, and determining a second detection result according to the standard deviation of the first-order correlation coefficient.
Specifically, the quantum random number first order correlation coefficient method is designed as follows:
the first order correlation coefficient of the random number is defined as a first formula, specifically:
Figure BDA0003450755030000061
wherein, a1Representing first order correlation coefficients, n representing the amount of data, xiA value (0 or 1) indicating the ith random number, and p (1) is a proportion of 1 in the current data amount.
Similar to the derivation procedure above, E (a) can be obtained1) 0 and E (a)1 2) 1/n, then the variance is:
Figure BDA0003450755030000062
according to the central limit theorem, when n approaches infinity, the first-order correlation coefficient also satisfies the standard normal distribution:
Figure BDA0003450755030000063
the standard deviation of the first order correlation coefficient can be estimated as:
Figure BDA0003450755030000064
in an optional embodiment of the present application, a detection interval of the random number sequence may also be set, and first-order correlation coefficient detection is performed on each detection interval;
obtaining the detection passing results of all detection intervals;
when the ratio of the detection passing results is not lower than the second threshold value (the passing ratio is not lower than 96%), it is determined that the second detection result is a pass.
And 104, performing pseudo-random number standard packet detection on the random number sequence, and determining a third detection result.
And 105, determining a randomness detection result of the random number sequence according to the first detection result, the second detection result and the third detection result.
In this embodiment of the application, when all of the first detection result, the second detection result, and the third detection result passes the detection, it is determined that the randomness detection result of the random number sequence passes, and if any one of the first detection result, the second detection result, and the third detection result does not pass, it is determined that the randomness detection result of the random number sequence does not pass.
Referring to fig. 2, a block diagram of a quantum random number detection process provided by the embodiment of the present application is provided, and in an optional embodiment of the present application, in addition to the above statistical bias detection on the random number sequence, the first-order correlation coefficient detection is performed on the random number sequence, and the pseudo random number standard packet detection is performed on the random number sequence. Other tests may also be performed on the random number sequence and the randomness test results determined.
An alternative embodiment for applying the method is given below, in particular:
(1) starting up the quantum random number generator to be tested, and starting a random number sequence acquisition program at the same time;
(2) acquiring a random number sequence of a quantum random number generator in real time, wherein the sequence length is not less than 100M bits;
(3) carrying out statistical bias detection on the obtained quantum random number sequence, wherein the statistical length interval is not less than 10 kbit;
(4) calculating the 0 and 1 statistical bias of the quantum random number sequence in each statistical interval, wherein the deviation of the proportion of 0 and 1 is not more than 0.1, and the passing proportion is not less than 96%;
(3) carrying out first-order correlation coefficient detection on the obtained quantum random number sequence, wherein the detection length interval is not less than 10 kbit;
(4) calculating a first-order correlation coefficient of the quantum random number sequence in each statistical interval, wherein the passing proportion is not lower than 96%;
(5) carrying out pseudo-random number standard packet detection aiming at the obtained quantum random number sequence;
(6) a detection report is generated giving a conclusion as to whether the quantum random number passed the detection, and the percent passage, with the minimum passage typically set at 96%.
Referring to fig. 3, a block diagram of a quantum random number detection system 200 according to an embodiment of the present application is shown. As shown in fig. 3, the apparatus 200 may include: the device comprises an acquisition module 201, a first detection module 202, a second detection module 203, a third detection module 204 and a determination module 205.
An obtaining module 201, configured to obtain a random number sequence generated by a quantum random number generator;
a first detection module 202, configured to perform statistical bias detection on the random number sequence, and determine a first detection result;
the second detection module 203 is configured to perform first-order correlation coefficient detection on the random number sequence to determine a second detection result;
a third detection module 204, configured to perform pseudo-random number standard packet detection on the random number sequence, and determine a third detection result;
a determining module 205, configured to determine a randomness detection result of the random number sequence according to the first detection result, the second detection result, and the third detection result.
In an optional embodiment of the present application, the performing, in the first detection module 202, statistical bias detection on the random number sequence specifically includes:
calculating the probability average value of all random numbers according to the random number sequence, and the variance and standard deviation when the random number is 1;
and determining a first detection result according to the standard deviation of the probability of the random number being 1.
In an alternative embodiment of the present application, the first-order correlation coefficient detection performed on the random number sequence in the second detection module 203 includes:
defining a first order correlation coefficient of the random number;
and obtaining the standard deviation of the first-order correlation coefficient, and determining a second detection result according to the standard deviation of the first-order correlation coefficient.
The quantum random number detection system provided in the embodiment of the present application is used for implementing the quantum random number detection method, and for specific limitations of the quantum random number detection system, reference may be made to the above limitations on the quantum random number detection method, which is not described herein again. The various components of the quantum random number detection system described above may be implemented in whole or in part by software, hardware, and combinations thereof. The modules can be embedded in a hardware form or independent from a processor in the device, and can also be stored in a memory in the device in a software form, so that the processor can call and execute operations corresponding to the modules.
The technical features of the embodiments described above may be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the embodiments described above are not described, but should be considered as being within the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the claims. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (9)

1. A method for quantum random number detection, the method comprising:
acquiring a random number sequence generated by a quantum random number generator;
performing statistical bias detection on the random number sequence to determine a first detection result;
performing first-order correlation coefficient detection on the random number sequence to determine a second detection result;
performing pseudo-random number standard packet detection on the random number sequence to determine a third detection result;
and determining the randomness detection result of the random number sequence according to the first detection result, the second detection result and the third detection result.
2. The method of claim 1, wherein performing statistical bias detection on the sequence of random numbers comprises:
calculating the probability average value of all random numbers and the variance and standard deviation when the random number is 1 according to the random number sequence;
and determining a first detection result according to the standard deviation of the probability of the random number being 1.
3. The method of claim 1, wherein performing first order correlation coefficient detection on the random number sequence comprises:
defining a first order correlation coefficient of the random number;
and obtaining the standard deviation of the first-order correlation coefficient, and determining a second detection result according to the standard deviation of the first-order correlation coefficient.
4. The method of claim 3, wherein the defining the first order correlation coefficient of the random number comprises:
defining a first order correlation coefficient of a random number according to a first formula, wherein the first formula specifically comprises:
Figure FDA0003450755020000011
wherein, a1Representing first order correlation coefficients, n representing the amount of data, xiDenotes the value of the ith random number, and p (1) is the proportion of 1 in the current data volume.
5. The method of claim 1, wherein performing a statistical bias test on the sequence of random numbers to determine a first test result comprises:
setting detection intervals of the random number sequence, and performing statistical bias detection on each detection interval;
obtaining the detection passing results of all detection intervals;
and when the proportion of the detection passing results is not lower than the first threshold value, determining that the first detection result is passing.
6. The method of claim 1, wherein performing a first order correlation coefficient detection on the random number sequence to determine a second detection result comprises:
setting detection intervals of the random number sequence, and carrying out first-order correlation coefficient detection on each detection interval;
obtaining the detection passing results of all detection intervals;
and when the proportion of the detection passing results is not lower than the second threshold value, determining that the second detection result is passing.
7. A quantum random number detection system, the system comprising:
the acquisition module is used for acquiring a random number sequence generated by the quantum random number generator;
the first detection module is used for carrying out statistical bias detection on the random number sequence and determining a first detection result;
the second detection module is used for detecting the first-order correlation coefficient of the random number sequence and determining a second detection result;
the third detection module is used for carrying out pseudo-random number standard packet detection on the random number sequence and determining a third detection result;
and the determining module is used for determining the randomness detection result of the random number sequence according to the first detection result, the second detection result and the third detection result.
8. The system of claim 7, wherein performing statistical bias detection on the sequence of random numbers comprises:
calculating the probability average value of all random numbers and the variance and standard deviation when the random number is 1 according to the random number sequence;
and determining a first detection result according to the standard deviation of the probability of the random number being 1.
9. The system of claim 7, wherein performing first order correlation coefficient detection on the random number sequence comprises:
defining a first order correlation coefficient of the random number;
and obtaining the standard deviation of the first-order correlation coefficient, and determining a second detection result according to the standard deviation of the first-order correlation coefficient.
CN202111674829.6A 2021-12-31 2021-12-31 Quantum random number detection method and system Pending CN114330734A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111674829.6A CN114330734A (en) 2021-12-31 2021-12-31 Quantum random number detection method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111674829.6A CN114330734A (en) 2021-12-31 2021-12-31 Quantum random number detection method and system

Publications (1)

Publication Number Publication Date
CN114330734A true CN114330734A (en) 2022-04-12

Family

ID=81020012

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111674829.6A Pending CN114330734A (en) 2021-12-31 2021-12-31 Quantum random number detection method and system

Country Status (1)

Country Link
CN (1) CN114330734A (en)

Similar Documents

Publication Publication Date Title
CN107478455B (en) Timing truncation reliability test method suitable for Weibull distribution type product
EP3220304A1 (en) Method of testing the resistance of a circuit to a side channel analysis
JP4263623B2 (en) Monobit run frequency online randomness test
EP2838022B1 (en) User sensory quality estimation device, terminal bottleneck determination device, similar operation extraction device, and methods and programs therefor
US20130179966A1 (en) Password authentication circuit and method
CN111835518A (en) Error injection method and system in security evaluation of elliptic curve public key cryptographic algorithm
US8638930B2 (en) Random number verification method and random number verification apparatus
JP4220398B2 (en) Hadamard transform online irregularity test
CN110620671B (en) Encryption algorithm evaluation method, medium, equipment and device
Wang et al. Side-channel analysis of Saber KEM using amplitude-modulated EM emanations
US20160246573A1 (en) Arrangement and method for checking the entropy of a random number sequence
CN114330734A (en) Quantum random number detection method and system
JP4263622B2 (en) Gap average online randomness test
US11206274B2 (en) Method and apparatus for calibrating a system for recognizing attempts to penetrate a computer network
JP2016081247A (en) Quality testing method of physical random number generation circuit, random number generator, and electronic device
US11055064B2 (en) Testing of physical random number generators
CN107204856B (en) A kind of method and device detecting elliptic curve loophole
EP3767415B1 (en) Device, method, and computer program that identify abnormal facilities
US20030187889A1 (en) Functional gap average on-line randomness test
JP2004524783A (en) Equipment error rate test method
JP2005528827A (en) Method for testing device error rate using prior probabilities
JPWO2007040111A1 (en) Digital watermark detection device
Kang et al. On the additional chi-square tests for the IID assumption of NIST SP 800-90B
KR101981623B1 (en) Light-weight random number health test apparatus
CN109462611B (en) Integrity certification method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination