Multi-entropy source true random number generator, control method, medium, device and terminal
By designing a multi-entropy source true random number generator, three types of entropy sources are used to solve the problems of insufficient PRNG security and high TRNG hardware requirements in the existing technology, and high quality and high rate true random number generation is achieved, which is suitable for scenarios with high security requirements.
Patent Information
- Application Number
- CN202210273127.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-19
- Publication Date
- 2025-03-14
- Estimated Expiration
- 2042-03-19
AI Technical Summary
The existing pseudo-random number generator PRNG is not suitable for scenarios with high security requirements, while the true random number generator TRNG is subject to high hardware requirements and cannot be widely promoted.
A multi-entropy source true random number generator is designed, using three types of entropy sources, namely resistive thermal noise, physical noise and radioactive decay, and high-quality true random numbers are generated through the authentication communication module, the acquisition quantization module, the online detection module and the post-processing module.
It realizes high-quality and high-speed true random number generation, can meet scenarios with high security requirements, and is small in size and easy to carry, filling the gap in the high-quality TRNG market for consumers.
Smart Images

Figure CN114706556B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of integrated circuits, and in particular relates to a multi-entropy source true random number generator, a control method, a medium, a device and a terminal. Background Art
[0002] At present, random numbers have a wide range of applications and play an important role in modern cryptography, information encryption communication systems, smart terminals, scientific experiments, etc. Random number generators (RNG) are key components of cryptographic systems. However, in the application of random number generators, pseudo-random number generators (PRNG) are not suitable for scenarios with high security requirements; true random number generators (TRNG) are subject to high hardware requirements and cannot be widely promoted. Therefore, it is necessary to propose a safe, fast, and practical portable true random number generator to fill the gap in the high-quality TRNG market for consumers.
[0003] Through the above analysis, the problems and defects of the prior art are as follows:
[0004] (1) The existing pseudo-random number generator (PRNG) is not suitable for scenarios with high security requirements.
[0005] (2) True random number generator (TRNG) cannot be widely promoted due to its high hardware requirements. Summary of the invention
[0006] In view of the problems existing in the prior art, the present invention provides a multi-entropy source true random number generator, a control method, a medium, a device and a terminal, and more particularly relates to a multi-entropy source true random number generator, a control method, a medium, a device and a terminal based on SM3.
[0007] The present invention is implemented as follows: a control method for a multi-entropy source true random number generator, the control method for the multi-entropy source true random number generator comprising the following steps:
[0008] Step 1: Use the physical entropy source module to select three types of entropy sources: resistor thermal noise, physical noise, and radioactive decay. Sample 32 bits for each type of entropy source and obtain the initial sequence.
[0009] Step 2: Use the authentication communication module to perform authentication communication processing between the upper computer and the lower computer, and use the acquisition and quantization module to perform sampling and quantization processing of the physical random source;
[0010] Step 3, using the online detection module to perform frequency detection, poker detection, total number of runs detection and linear complexity detection on the output sequence after sampling and quantization of the physical random source;
[0011] Step 4: Use the post-processing module to eliminate small deviations between the original bits, reduce the residual correlation in the random sequence, and make the output evenly distributed.
[0012] Furthermore, in step one, three types of entropy sources, namely, thermal noise of resistors, physical jitter caused by spatial angle changes of devices, and radioactive decay, are used, and the results of XOR of the three are used as the results of a round of sampling and quantization, and 8 rounds are performed; the obtained 8 groups of 32 bits are connected end to end and spliced into 256 bits as the initial sequence.
[0013] Furthermore, in step 2, the baud rate is configured to be 115200 Baud, the serial port data bit is 8 bits, and the stop bit is 1 bit.
[0014] Further, the two-way verification communication processing of the authentication communication module in the step 2 includes: using the certificate issuing authority CA to issue a certificate to the single-chip microcomputer, and using the private key generated by the CA to sign the public key of the single-chip microcomputer and the validity period information of the certificate for SM2, that is, hashing and encrypting; when the upper computer starts to request communication, the single-chip microcomputer sends the certificate to the upper computer, and the upper computer verifies it with the public key of the CA. If the signature verification is successful, the upper computer will generate a nonce and use the public key contained in the certificate to encrypt the nonce and the session key; the encrypted result is sent to the lower computer, and the lower computer decrypts it with its own private key K_pri, and then encrypts the nonce with the session key; the encrypted result is transmitted to the upper computer, and the upper computer compares the nonce encrypted by itself with the received result. If they are the same, it proves that the single-chip microcomputer has a legal private key and the lower computer authentication is successful.
[0015] Furthermore, the post-processing in step 4 adopts the SM3 algorithm, and mixes the 32nd compression value in the previous round of SM3 operation process into the entropy source of the next round to prevent backtracking attacks.
[0016] Another object of the present invention is to provide a computer device, the computer device comprising a memory and a processor, the memory storing a computer program, and when the computer program is executed by the processor, the processor performs the following steps:
[0017] The physical entropy source module uses three types of entropy sources: resistor thermal noise, physical noise, and radioactive decay. Each type of entropy source samples 32 bits and obtains the initial sequence. The authentication communication module is used to perform authentication communication processing from the upper computer to the lower computer, and the acquisition quantization module is used to perform sampling and quantization processing of the physical random source.
[0018] The online detection module is used to perform frequency detection, poker detection, total run detection and linear complexity detection on the output sequence after sampling and quantization of the physical random source; the post-processing module is used to eliminate small deviations between the original bits, reduce the residual correlation in the random sequence, and make the output evenly distributed.
[0019] Another object of the present invention is to provide a multi-entropy source true random number generator for executing the control method of the multi-entropy source true random number generator, wherein the multi-entropy source true random number generator includes a physical entropy source module, an authentication communication module, an acquisition and quantization module, an online detection module, and a post-processing module;
[0020] The physical entropy source module uses three types of entropy sources: resistance thermal noise, physical noise and radioactive decay. Each type of entropy source samples 32 bits and obtains an initial sequence.
[0021] The authentication communication module is used to perform authentication communication processing from the upper computer to the lower computer;
[0022] The acquisition and quantization module is used to perform sampling and quantization processing of a physical random source;
[0023] The online detection module is used to perform frequency detection, poker detection, total number of runs detection and linear complexity detection on the output sequence after sampling and quantization of the physical random source;
[0024] The post-processing module is used to eliminate small deviations between original bits, reduce residual correlation in the random sequence, and make the output uniformly distributed.
[0025] Another object of the present invention is to provide a computer-readable storage medium storing instructions, which, when executed on a computer, enable the computer to apply the multi-entropy source true random number generator.
[0026] Another object of the present invention is to provide an information data processing terminal, which is used to implement the multi-entropy source true random number generator.
[0027] In combination with the above technical solutions and the technical problems solved, please analyze the advantages and positive effects of the technical solutions to be protected by the present invention from the following aspects:
[0028] First, in view of the technical problems existing in the above-mentioned prior art and the difficulty of solving the problems, the technical solutions to be protected by the present invention and the results and data during the research and development process are closely combined to analyze in detail and deeply how the technical solutions of the present invention solve the technical problems, and some creative technical effects brought about after solving the problems. The specific description is as follows:
[0029] (1) The quality of the generated random numbers is high, comparable to the quality of TRNGs currently available on the market.
[0030] The present invention can generate full-entropy true random number sequences in batches, and passes the NIST SP 800-22 test issued by the National Institute of Standards and Technology of the United States, the GB / T32915-2016-Information Security Technology Binary Sequence Randomness Detection issued by the Cryptography Industry Standard of the People's Republic of China, and the random number quality standard AIS31 test issued by the German BSI company. The bit entropy obtained by the entropy estimation of NIST SP800-90B is not less than 0.92 / bit.
[0031] (2) High random number generation rate: Directly generating true random numbers can reach 47.8Kbps.
[0032] (3) Taking the Linux platform as an example, after injecting entropy, the LRNG true random number generation rate can reach 83.2 Kbps, which solves the problem of slow TRNG generation and easy blocking in general Linux systems.
[0033] (4) The final invention is small in size and easy to carry, filling the gap in the high-quality TRNG market for consumers.
[0034] Second, considering the technical solution as a whole or from the perspective of the product, the technical effects and advantages of the technical solution to be protected by the present invention are described in detail as follows:
[0035] (1) The random number generation rate is high.
[0036] (2) The generated true random numbers are of high quality.
[0037] (3) Good security: XOR processing is performed on multiple entropy sources, which greatly reduces the bias between entropy sources; the intermediate state of the 32nd round of SM3 compression is mixed into the entropy source for the next random number generation, which increases the difficulty of backtracking attacks; the input space is large enough to resist exhaustive attacks.
[0038] (4) Strong scalability and portability: It has strong scalability, optional peripheral expansion ports, and can add entropy sources at will. It supports ten-axis sensors, Geiger counters, etc. It has strong adaptability and can work normally on multiple platforms and devices. The software drives a human-computer interaction-friendly GUI interface that is easy to use and expand.
[0039] (5) Other aspects: The finished hardware carrier is in the form of a USB flash drive, which is plug-and-play, convenient and fast; the designed command line is lightweight and concise; it is miniaturized, has low hardware costs, is low-cost, is consumer-friendly, and has high practical value.
[0040] (6) Applying SM3 to the field of random number generation is conducive to a comprehensive evaluation of the security of the SM3 algorithm and can effectively promote the promotion and application of the SM3 algorithm in the field of information security. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments of the present invention. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0042] Figure 1 is a flow chart of a control method for a multi-entropy source true random number generator provided by an embodiment of the present invention;
[0043] Figure 2 It is a schematic diagram of the overall design of a true random number generator provided by an embodiment of the present invention;
[0044] Figure 3 is a flow chart of successful communication processing of two-way verification provided by an embodiment of the present invention;
[0045] Figure 4 is a schematic diagram of the SM3 post-processing process provided by an embodiment of the present invention;
[0046] Figure 5 It is a screenshot of some results of the NIST SP800-22 test provided by an embodiment of the present invention;
[0047] Figure 6 It is a schematic diagram of PROPORTION of 1 Gbit, 1.5 Gbit and 2 Gbit provided by an embodiment of the present invention;
[0048] Figure 7 This is a screenshot of the AIS31 test provided by an embodiment of the present invention;
[0049] Figure 8 It is a schematic diagram of the NIST SP800-90B entropy estimation result provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0050] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0051] In view of the problems existing in the prior art, the present invention provides a multi-entropy source true random number generator, a control method, a medium, a device and a terminal. The present invention is described in detail below with reference to the accompanying drawings.
[0052] 1. Explanatory Examples In order to enable those skilled in the art to fully understand how to implement the present invention, this section provides an illustrative example that expands and describes the technical solution of the claims.
[0053] like Figure 1 As shown, the control method of the multi-entropy source true random number generator provided by the embodiment of the present invention includes the following steps:
[0054] S101, using the physical entropy source module to select three types of entropy sources: resistor thermal noise, physical noise and radioactive decay, each type of entropy source samples 32 bits respectively, and obtains the initial sequence;
[0055] S102, using the authentication communication module to perform authentication communication processing of the upper computer to the lower computer, and using the acquisition quantization module to perform sampling quantization processing of the physical random source;
[0056] S103, using an online detection module to perform frequency detection, poker detection, total number of runs detection, and linear complexity detection on the output sequence after sampling and quantization of the physical random source;
[0057] S104, using a post-processing module to eliminate small deviations between original bits, reduce residual correlation in the random sequence, and make the output uniformly distributed.
[0058] like Figure 2 As shown, the multi-entropy source true random number generator provided by the embodiment of the present invention includes:
[0059] The physical entropy source module is used to select three types of entropy sources: resistor thermal noise, physical noise, and radioactive decay. Each type of entropy source samples 32 bits and obtains the initial sequence.
[0060] Authentication communication module, used for authentication communication processing between the upper computer and the lower computer;
[0061] The acquisition and quantization module is used to perform sampling and quantization processing of physical random sources;
[0062] An online detection module is used to perform frequency detection, poker detection, total number of runs detection and linear complexity detection on the output sequence after sampling and quantization of the physical random source;
[0063] The post-processing module is used to eliminate small deviations between the original bits, reduce the residual correlation in the random sequence, and make the output uniformly distributed.
[0064] Example 1
[0065] (1) Pseudo Random Number Generator (PRNG) cannot meet the requirements of systems with high random number quality.
[0066] PRNG uses some initial seeds and deterministic algorithms to generate pseudo-random numbers and can produce high throughput. However, once an attacker obtains the seed, all security is lost. Therefore, it is dangerous to use PRNG to generate keys. In cryptographic systems with high security levels, TRNG is usually used as a key generator. At present, many system platforms use SRNG to provide random number services, such as the Linux random number generator (LRNG), the Android system random number generator (APRNG) based on LRNG, the Yarrow used by the iOS system, the Fortuna random number generator based on the Yarrow design, and the Windows kernel random number generator CryptGenRandom. But at the same time, SRNG is very dependent on the randomness of the operating system and the interaction with the user, and the entropy source is not stable enough.
[0067] To solve the above problems, the random number generator designed by the present invention is based on hardware and generates true random numbers.
[0068] (2) The existing true random number generator (TRNG) can generate high-quality random numbers, but is not convenient for individual users.
[0069] TRNG generates binary sequences from unpredictable physical processes that have statistically random properties, such as thermodynamic noise, circuit noise, nuclear fission, photoelectric effect and quantum phenomena, non-deterministic effects of electronic circuits, and non-deterministic events such as system time, hard disk seek time, RAM content, and user interaction. The generated sequences have three characteristics: uniform distribution, unpredictability, and statistical independence. TRNG can be subdivided into hardware RNG (HRNG) based on physical sources and software RNG (SRNG) based on external non-physical sources. The data generated by HRNG usually has good unpredictability, but there are problems such as difficulty in hardware updates and high development costs.
[0070] Currently, there are several hardware implementation methods for generating random numbers:
[0071] 1. Discrete chaotic system method: Chaos is selected as a pseudo-random number generator using a dynamic system that is deterministic, quasi-random, non-periodic, convergent, and extremely sensitive to initial values. However, the random numbers it generates are essentially pseudo-random numbers, which are implemented through mathematical algorithms, not true random numbers; and the implementation method of chaotic circuits is very complex and consumes a large amount of power.
[0072] 2. Phase jitter method: Generate true random numbers based on the ring oscillator sampling method. The sampling principle is to use a low-frequency clock to sample the output signal of the ring oscillator (there is a phase noise offset) to obtain an output sequence with a certain randomness; however, using phase jitter or oscillator drift as a random source, the initial sequence has a large correlation and cannot achieve sufficient random performance.
[0073] 3. Metastable method: The speed of generating random number sequences is fast, but it is easily affected by pressure and temperature; the layout and wiring are difficult, and generally require customized circuits to complete, so the practicality is low.
[0074] 4. Method using thermal noise: including generating true random numbers based on natural noise, such as self-excited oscillation of power supply voltage, thermal noise of components such as resistors and capacitors, etc. Circuit thermal noise is generated by Brownian motion of electrons, and its statistical characteristics obey Gaussian distribution, so the random numbers generated are of good quality.
[0075] In view of the above situation, the present invention uses a variety of collection devices to collect three types of entropy sources: resistor thermal noise, physical noise (jitter), and radioactive decay, and designs a circuit to amplify thermal noise, and uses analog-to-digital converter ADC and barometer, gyroscope and various sensors to sample and quantize to obtain the initial sequence. The entropy detection and post-processing modules are implemented on the host computer, i.e., the computer end, to obtain the final random number.
[0076] (1) Entropy source selection
[0077] Considering the cost and portability, the present invention selects three types of entropy sources: resistor thermal noise, physical noise, and radioactive decay. These three types of entropy sources are cheap and easy to obtain, and are available on current mobile devices such as mobile phones, which is convenient for porting and overcomes the existing hardware limitations of TRNG. The specific information of entropy sources and collection is shown in Table 1.
[0078] Table 1 Physical entropy sources
[0079]
[0080] There are various noise sources in the circuit, some of which do not obey uniform distribution, and the circuit characteristics of the device itself will also cause the sampling source data to deviate from the uniform distribution. The present invention uses m-LSB, multi-channel physical random source XOR, and splicing methods to process the original entropy source, reduce various possible random number quality degradation problems, and finally obtain a 256-bit initial sequence.
[0081] (2) Authentication communication module
[0082] In order to ensure that the lower computer will not be maliciously controlled, the present invention designs an authentication module for the upper computer to the lower computer. Figure 3It shows the successful process of communication processing for both parties to verify: the present invention, as a certificate issuing authority CA, issues a certificate to the single-chip microcomputer, that is, the public key of the single-chip microcomputer, the validity period of the certificate and other information are SM2 signed (hashed and encrypted) with the private key generated by the CA of the present invention. When the upper computer starts to request communication, the single-chip microcomputer sends the certificate to the upper computer, and the upper computer verifies it with the public key of the CA. If the signature verification is successful, the PC will generate a nonce and use the public key contained in the certificate to encrypt the nonce and the session key, and send the encrypted result to the lower computer. The lower computer decrypts it with the private key K_pri generated by itself, and then encrypts the nonce with the session key, and transmits the encrypted result to the PC. The PC compares the nonce encrypted by itself with the received result. If they are the same, it proves that the single-chip microcomputer has a legal private key and the authentication of the lower computer is successful.
[0083] (3) Online detection
[0084] In order to enhance the robustness of the present invention, this module performs frequency detection, poker detection, total run detection and linear complexity detection on the output sequence after sampling and quantization of the physical random source in accordance with the cryptographic industry standard of the People's Republic of China "GM0078-2020 Cryptographic Random Number Generation Module Design Guide", so as to detect abnormalities and promptly alarm and stop output when the physical device for collecting and quantizing the entropy source fails, the entropy source is unstable, or the attacker maliciously manipulates the entropy source.
[0085] (4) Post-processing module
[0086] Although the entropy source can theoretically provide true randomness, the original random bit stream is inevitably mixed with deterministic noise. From a macroscopic point of view, the original random bit stream is relatively uniform, but in order to ensure the mathematical uniform distribution of random numbers, no residual correlation, to maximize security, eliminate small deviations between the original bits, and prevent attackers from adding deterministic noise, post-processing is used to reduce the residual correlation in the random sequence and make the output uniformly distributed (see Figure 4 ).
[0087] Example 2
[0088] The multi-entropy source true random number generator based on SM3 provided in an embodiment of the present invention includes modules such as physical entropy source, authentication communication, acquisition quantization, and post-processing.
[0089] The invention uses three types of entropy sources: thermal noise of resistors, physical jitter such as changes in device spatial angles, and radioactive decay. Each type of entropy source samples 32 bits, and the result of the XOR of the three is used as a round of sampling quantization results. This is repeated for 8 rounds. The 8 groups of 32 bits are connected end to end and spliced into 256 bits as the initial sequence.
[0090] In the communication module, considering that the serial communication distance is short and the bit error rate is not large, the baud rate is configured to 115200 Baud to provide a faster transmission rate. In addition, the serial port data bit is configured to 8 bits and the stop bit is configured to 1 bit. In order to ensure that the lower computer will not be maliciously controlled, the present invention designs an authentication module for the upper computer to the lower computer. The present invention, as a certificate issuing authority CA, issues a certificate to the single-chip microcomputer, that is, the public key of the single-chip microcomputer, the validity period of the certificate and other information are SM2 signed with the private key generated by the CA.
[0091] Before entering the post-processing module, the sequence is checked online to ensure that it is output only when the entropy source is stable. The post-processing uses the SM3 algorithm, and the 32nd compression value in the previous round of SM3 operation is mixed into the entropy source of the next round, ensuring the forward and backward security of the internal state of the generator and preventing backtracking attacks.
[0092] In addition, a lightweight and concise command line and an interactive and friendly GUI interface are designed to facilitate use by all types of users.
[0093] Another object of the present invention is to solve the problem of slow TRNG generation speed and easy blocking in the general Linux system by taking the Linux platform as an example.
[0094] Applying SM3 to the field of random number generation is conducive to a comprehensive assessment of the security of the SM3 algorithm and can effectively promote the promotion and application of the SM3 algorithm in the field of information security.
[0095] 2. Application Examples: In order to prove the creativity and technical value of the technical solution of the present invention, this section provides application examples of the technical solution of the claims on specific products or related technologies.
[0096] (1) It can provide high-quality true random numbers to individual users without high electricity and hardware costs;
[0097] (2) Entropy can be injected into common Linux platforms (including embedded devices) where entropy pools are blocked.
[0098] It should be noted that the embodiments of the present invention can be implemented by hardware, software, or a combination of software and hardware. The hardware part can be implemented using dedicated logic; the software part can be stored in a memory and executed by an appropriate instruction execution system, such as a microprocessor or dedicated design hardware. It can be understood by a person of ordinary skill in the art that the above-mentioned devices and methods can be implemented using computer executable instructions and / or contained in a processor control code, such as a carrier medium such as a disk, CD or DVD-ROM, a programmable memory such as a read-only memory (firmware), or a data carrier such as an optical or electronic signal carrier. Such code is provided on the carrier medium. The device and its modules of the present invention can be implemented by hardware circuits such as very large-scale integrated circuits or gate arrays, semiconductors such as logic chips, transistors, etc., or programmable hardware devices such as field programmable gate arrays, programmable logic devices, etc., can also be implemented by software executed by various types of processors, and can also be implemented by a combination of the above-mentioned hardware circuits and software, such as firmware.
[0099] 3. Evidence of the effects of the embodiments. The embodiments of the present invention have achieved some positive effects during the development or use process, and indeed have great advantages over the prior art. The following content is described in conjunction with the data, charts, etc. of the test process.
[0100] (1) The quality of the generated random numbers is high, comparable to the quality of TRNGs currently available on the market.
[0101] The present invention can generate full-entropy true random number sequences in batches, and passes the NIST SP 800-22 test issued by the National Institute of Standards and Technology of the United States, the GB / T 32915-2016-Information Security Technology Binary Sequence Randomness Detection issued by the Cryptography Industry Standard of the People's Republic of China, and the random number quality standard AIS31 test issued by the German BSI company. The bit entropy obtained by the entropy estimation of NIST SP800-90B is not less than 0.92 / bit.
[0102] 1. NIST SP 800-22 test results
[0103] The test of the present invention sets the significance level to 0.01, the total number of group test data is 1000, and when the pass rate is greater than 98.1%, the test is passed. After the test is completed, the result will be written into the finalAnalysisReport.txt file.
[0104] Some screenshots of NIST SP800-22 test results are as follows Figure 5 As shown, the data size is 1Gbit. The specific test results are shown in Table 2.
[0105] Table 2 NIST SP 800-22 test results
[0106] Test Name P-value PROPORTION result 1 Frequency detection 0.73992 0.990 PASS 2 Frequency detection within a block 0.91141 0.998 PASS 3 Run detection 0.35049 0.990 PASS 4 Longest run detection within a block 0.01791 0.997 PASS 5 Matrix rank detection 0.35049 0.994 PASS 6 Discrete Fourier Transform Detection 0.73992 0.988 PASS 7 Non-overlapping template matching detection 0.5031 0.995 PASS 8 Overlapping template matching detection 0.53415 0.990 PASS 9 General statistical tests 0.12233 0.990 PASS 10 Linear complexity test 0.35049 0.993 PASS 11 Sequence Detection 0.82567 0.996 PASS 12 Approximate Entropy Detection 0.73992 0.996 PASS 13 Accumulation and detection 0.30051 0.994 PASS 14 Random walk detection 0.4995 0.995 PASS 15 Random Walk Variant Detection 0.5756 0.994 PASS
[0107] The pass rate PROPORTION is greater than 0.981, and the P value is greater than 0.01. It can be considered that the random number generator designed by the present invention can pass the NIST SP800-22 randomness test.
[0108] 2. GB / T 32915-2016-Information security technology binary sequence randomness detection
[0109] The 1Gbit random number generated by the present invention is used to perform the randomness test of the binary sequence of the national secret GB / T 32915-2016-Information Security Technology, and the results are shown in Table 3 (only the proprietary items compared with NIST SP 800-20 are listed). Because the P-value is greater than 0.01 and the PROPORTION is greater than 0.981, the TRNG implemented by the present invention passes the randomness test of the binary sequence of the national secret GB / T 32915-2016-Information Security Technology.
[0110] Table 3 GB / T 32915-2016-Information security technology binary sequence randomness test results
[0111] Test Name P-value PROPORTION Measurement results Autocorrelation test 0.3476 0.991 PASS Poker Test 0.8572 0.987 PASS Run distribution test 0.6901 0.996 PASS Binary Derivation Detection 0.1756 0.983 PASS
[0112] The test was performed using random number data of 1Gbit, 1.5Gbit, and 2Gbit, and the pass rates PROPORTION were obtained. Figure 6 shown.
[0113] In these three tests, the actual average pass rate PROPORTION is approximately 0.99, and the minimum pass rate PROPORTION is 0.987, which is greater than 0.981. Therefore, it is believed that the random number generator designed by the present invention can pass the GM / T 0005-2012 randomness test.
[0114] 3.AIS31 test and results
[0115] The AIS31 test standard assessment includes a total of 9 test items, which can be divided into three parts: P1: T0, P1: T1-T5, P2-Special. Among them, the TO to T5 tests in P1 are basic test items, and T6 to T8 in P2 are special test items. AIS31 test screenshots are as follows Figure 7 shown.
[0116] The AIS31 test results are shown in Table 4. The random numbers generated by the present invention have good quality.
[0117] Table 4 AIS31 test results
[0118]
[0119]
[0120] 4. NIST SP800-90B estimation and results
[0121] For non-IID data, NIST SP800-90B contains 10 entropy estimators for calculating the randomness of the sequence to be tested, namely Most Common Value test, LZ78Y prediction test, Markov test, Compression test, T-tuple test, LRS test, MultiMCW test, Lag test, MultiMMC test, and Collision test. The entropy of the data to be tested is the minimum value of the results calculated by the 10 entropy estimators. When the statistical properties of the entropy source to be tested meet or are close to the expectations of a test in the 90B test package, a more accurate entropy estimation result can be obtained through the 90B test.
[0122] The 448Mbits data generated by the present invention was used for testing, and the following results were obtained: Figure 8 Results shown.
[0123] The present invention is repeatedly used to generate true random numbers and NIST SP800-90B is tested repeatedly, and the bit entropy of the TRNG of the present invention is in the range of 0.93-0.95. At the same time, the two random number generator interfaces of LRNG are repeatedly tested by NIST SP800-90B, and the bit entropies of / dev / random and / dev / urandom are 0.93 and 0.92-0.94 respectively, indicating that the quality of the TRNG implemented by the present invention is good, comparable to / dev / random, and better than / dev / urandom. The comparison results are shown in Table 5.
[0124] Table 5 compares the output quality of LRNG and the output quality of TRNG of the present invention
[0125]
[0126] (2) The random number generation rate is high.
[0127] Directly generating true random numbers can reach 47.8Kbps.
[0128] (3) Taking the Linux platform as an example, after injecting entropy, the LRNG true random number generation rate can reach 83.2 Kbps, which solves the problem of slow TRNG generation and easy blocking in general Linux systems.
[0129] (4) The final invention is small in size and easy to carry, filling the gap in the high-quality TRNG market for consumers.
[0130] The above description is only a specific implementation mode of the present invention, but the protection scope of the present invention is not limited thereto. Any modifications, equivalent substitutions and improvements made by any technician familiar with the technical field within the technical scope disclosed by the present invention and within the spirit and principle of the present invention should be covered by the protection scope of the present invention.
Claims
1. A control method for a multi-entropy source true random number generator, characterized in that: The control method of the multi-entropy source true random number generator comprises the following steps: Step 1: Use the physical entropy source module to select three types of entropy sources: resistor thermal noise, physical noise, and radioactive decay. Sample 32 bits for each type of entropy source and obtain the initial sequence. Step 2: Use the authentication communication module to perform authentication communication processing between the upper computer and the lower computer, and use the acquisition and quantization module to perform sampling and quantization processing of the physical random source; Step 3, using the online detection module to perform frequency detection, poker detection, total number of runs detection and linear complexity detection on the output sequence after sampling and quantization of the physical random source; Step 4: Use the post-processing module to eliminate small deviations between the original bits, reduce the residual correlation in the random sequence, and make the output uniformly distributed; In the step 1, three types of entropy sources, namely, thermal noise of resistors, physical jitter caused by spatial angle changes of devices, and radioactive decay, are used, and the results of the XOR of the three are used as the results of a round of sampling and quantization, and eight rounds are performed; the eight groups of 32 bits obtained are connected end to end and spliced into 256 bits as the initial sequence; In step 2, the baud rate is configured to be 115200 Baud, the serial port data bit is 8 bits, and the stop bit is 1 bit; The two-way verification communication processing of the authentication communication module in the step 2 includes: using the certificate issuing authority CA to issue a certificate to the single-chip microcomputer, using the private key generated by the CA to sign the public key of the single-chip microcomputer and the validity period of the certificate, and hashing and encrypting; when the upper computer starts to request communication, the single-chip microcomputer sends the certificate to the upper computer, and the upper computer verifies it with the public key of the CA. If the signature verification is successful, the PC will generate a nonce and encrypt the nonce and session key with the public key contained in the certificate; the encrypted result is sent to the lower computer, and the lower computer decrypts it with the private key K_pri generated by itself, and then encrypts the nonce with the session key; the encrypted result is transmitted to the PC, and the PC compares the nonce encrypted by itself with the received result. If they are the same, it proves that the single-chip microcomputer has a legal private key and the lower computer authentication is successful; The post-processing in step 4 adopts the SM3 algorithm, and mixes the 32nd compression value in the previous round of SM3 operation process into the entropy source of the next round to prevent backtracking attacks.
2. A computer device, characterized in that: The computer device includes a memory and a processor, the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the control method of the multi-entropy source true random number generator according to claim 1, comprising the following steps: The physical entropy source module is used to select three types of entropy sources: resistor thermal noise, physical noise and radioactive decay. Each type of entropy source samples 32 bits and obtains the initial sequence. The authentication communication module is used to perform authentication communication processing from the upper computer to the lower computer, and the acquisition quantization module is used to perform sampling and quantization processing of the physical random source. The online detection module is used to perform frequency detection, poker detection, total run detection and linear complexity detection on the output sequence after sampling and quantization of the physical random source; the post-processing module is used to eliminate small deviations between the original bits, reduce the residual correlation in the random sequence, and make the output evenly distributed.
3. A multi-entropy source true random number generator for executing the control method of the multi-entropy source true random number generator according to claim 1, characterized in that: The multi-entropy source true random number generator includes a physical entropy source module, an authentication communication module, an acquisition and quantification module, an online detection module and a post-processing module; The physical entropy source module uses three types of entropy sources: resistance thermal noise, physical noise and radioactive decay. Each type of entropy source samples 32 bits and obtains an initial sequence. The authentication communication module is used to perform authentication communication processing from the upper computer to the lower computer; The acquisition and quantization module is used to perform sampling and quantization processing of a physical random source; The online detection module is used to perform frequency detection, poker detection, total number of runs detection and linear complexity detection on the output sequence after sampling and quantization of the physical random source; The post-processing module is used to eliminate small deviations between original bits, reduce residual correlation in the random sequence, and make the output uniformly distributed.
4. A computer-readable storage medium storing instructions, which, when executed on a computer, enable the computer to apply the multi-entropy source true random number generator as claimed in claim 3.
5. An information data processing terminal, characterized in that: The information data processing terminal is used to implement the multi-entropy source true random number generator as described in claim 3.
Citation Information
Patent Citations
True random number generator applicable to wireless communication system
CN106027238A
TRNG evaluation method based on random model and online monitoring
CN111897514A