True random number generator and generation method of mixed entropy source
By combining random jitter and metastable entropy sources, using the xOR gate and inverter to construct a true random number generator, the problems of low random number generation rate and output deviation in the prior art are solved, and high randomness and accuracy are achieved The generation meets the needs of high-security applications.
Patent Information
- Application Number
- CN202411468008.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-21
- Publication Date
- 2025-01-17
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The random number generation rate of existing true random number generators is low and the output may be biased, making it difficult to meet the needs of high-security applications.
Design a true random number generator with mixed entropy sources, using two entropy sources, random jitter and metastable state, build a random number generation module through the XOR gate and the inverter, and combines the D flip-flop to acquire and process random signals to generate High-quality random numbers.
It realizes the generation of random numbers with high randomness and precision, passed the NIST SP800-22 test, meets the standard requirements in the field of cryptographic communications, and has high throughput and practicality.
Smart Images

Figure CN119322602A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of digital circuits, and in particular to a true random number generator with a mixed entropy source and a generation method thereof. Background Art
[0002] True Random Number Generator (TRNG) plays a vital role in modern information technology, especially in the fields of encryption, secure communication, authentication, and scientific computing. TRNG generates random numbers by capturing the inherent randomness in physical phenomena. Unlike pseudo-random number generators (PRNG), TRNG relies on real unpredictable events, so it has higher security and randomness.
[0003] The design of TRNG usually relies on physical noise sources, such as thermal noise, oscillator jitter, quantum effects, etc. These physical phenomena are highly random and can provide independent and unpredictable random numbers. TRNG based on these noise sources generates random numbers by sampling the uncertainty in these physical phenomena. For example, TRNG based on oscillator jitter measures the phase jitter of the oscillation signal and converts it into random data. In addition, quantum effects, as a new noise source, have also been widely studied and applied in TRNG design in recent years. Since the randomness of quantum phenomena is determined by the laws of physics, it provides extremely high randomness and is particularly suitable for high-security applications.
[0004] In the field of information security, the application of TRNG is crucial. Cryptographic systems require high-quality random numbers to generate keys, initialization vectors, and other random parameters in encryption algorithms. If the output of the random number generator can be predicted or reproduced, the entire encryption system will face serious security threats. The unpredictability provided by TRNG makes it an ideal choice for generating encryption keys. In addition, TRNG is also widely used in scenarios such as digital signatures, identity authentication, blockchain, and cryptocurrency.
[0005] The implementation of TRNG usually relies on hardware, because the physical noise source needs to be effectively collected in a specific circuit environment. In modern hardware design, field programmable gate arrays (FPGAs) and application-specific integrated circuits (ASICs) are common platforms for implementing TRNG. The core of the TRNG circuit is a noise acquisition module, which extracts the randomness from the physical noise source and then ensures that the generated random numbers meet the statistical randomness requirements through post-processing steps (such as debiasing, hashing, etc.). In addition, TRNG also needs to pass randomness tests such as NIST SP800-22 to ensure that the random numbers it generates have sufficient security and random quality. However, the random number generation rate of some true random number generators (TRNG) is currently low, and the output random numbers may be biased, which needs to be compensated by post-processing (such as debiasing, hashing, etc.). Summary of the invention
[0006] The purpose of the present invention is to provide a true random number generator with a mixed entropy source and a generation method, which can improve the randomness and accuracy of the true random number generator.
[0007] To achieve the above object, the present invention provides the following solutions:
[0008] A true random number generator with a mixed entropy source comprises: a random number generation module, a data acquisition module and a 5-input-1-output XOR gate connected in sequence; the random number generation module comprises an XOR gate and a plurality of inverters respectively connected to the XOR gate; the data acquisition module comprises a plurality of D flip-flops; the input ends of the D flip-flops are connected to the output ends of the XOR gate in a one-to-one correspondence; the output ends of the D flip-flops are connected to the input ends of the 5-input-1-output XOR gate.
[0009] Optionally, the random number generation module specifically includes: 1 XOR gate and 14 inverters; wherein the Y input end of the XOR gate is connected to 3 inverters to form a first loop, the X input end of the XOR gate is connected to 11 inverters to form a second loop, and the Z output end of the XOR gate is connected to the first loop and the second loop respectively.
[0010] Optionally, the ring oscillator periods of the first loop and the second loop are T=2nt, wherein n is the number of inverters, and t is the time required for each inverter to respond.
[0011] Optionally, there is a time difference, the XOR gate produces a metastable phenomenon; wherein T1 represents the period of the first loop, and T2 represents the period of the second loop.
[0012] Optionally, the random number generation module includes two entropy sources: random jitter and metastable state.
[0013] Optionally, the number of the random number generation modules is five, and five D flip-flops are correspondingly provided.
[0014] The present invention also provides a method for generating true random numbers with a mixed entropy source, based on the true random number generator as described above, comprising:
[0015] The random number generation module is used to generate random oscillation information from two entropy sources, random jitter and metastable state, and the random oscillation information is collected by the data acquisition module. Finally, the random oscillation information is XOR-processed by a 5-input-1-output XOR gate to generate random data.
[0016] According to the specific embodiments provided by the present invention, the present invention discloses the following technical effects:
[0017] The present invention discloses a true random number generator of a mixed entropy source and a generation method, wherein the generator comprises a random number generation module, a data acquisition module and a 5-input-1-output XOR gate connected in sequence; the random number generation module comprises an XOR gate and a plurality of inverters respectively connected to the XOR gate; the data acquisition module comprises a plurality of D flip-flops; the input end of the D flip-flop is connected to the output end of the XOR gate in a one-to-one correspondence; the output end of the D flip-flop is connected to the input end of the 5-input-1-output XOR gate. The true random number generator proposed by the present invention has a simple structure and excellent random performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. 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 paying creative labor.
[0019] Figure 1 It is a schematic diagram of the structure of a true random number generator of a mixed entropy source of the present invention;
[0020] Figure 2 Schematic diagram of the application principle of the inverter in this embodiment;
[0021] Figure 3 Schematic diagram of random jitter in the oscillation circuit in this embodiment;
[0022] Figure 4 Schematic representation of the symbol and truth value of the XOR gate in this embodiment;
[0023] Figure 5 Schematic diagram of the short pulse phenomenon of the XOR gate in this embodiment;
[0024] Figure 6 This is a schematic diagram of the specific structure of the random number generation module in this embodiment;
[0025] Figure 7 is a structural diagram of TRNG in this embodiment. DETAILED DESCRIPTION
[0026] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0027] The purpose of the present invention is to provide a true random number generator with a mixed entropy source and a generation method, which can improve the randomness and accuracy of the true random number generator.
[0028] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0029] like Figure 1 As shown, the present invention provides a true random number generator with a mixed entropy source, comprising: a random number generation module, a data acquisition module and a 5-input-1-output XOR gate connected in sequence; the random number generation module comprises an XOR gate and a plurality of inverters respectively connected to the XOR gate; the data acquisition module comprises a plurality of D flip-flops; the input end of the D flip-flop is connected to the output end of the XOR gate in a one-to-one correspondence; the output end of the D flip-flop is connected to the input end of the 5-input-1-output XOR gate. Wherein, the random number generation module comprises two entropy sources, random jitter and metastable state.
[0030] As a specific implementation, the random number generation module specifically includes: 1 XOR gate and 14 inverters; wherein the Y input end of the XOR gate is connected to 3 inverters to form a first loop, the X input end of the XOR gate is connected to 11 inverters to form a second loop, and the Z output end of the XOR gate is connected to the first loop and the second loop respectively.
[0031] The ring oscillator period of the first loop and the second loop is T=2nt; n is the number of inverters, and t is the time required for each inverter to respond. time difference, the XOR gate produces a metastable phenomenon; wherein T1 represents the period of the first loop, and T2 represents the period of the second loop.
[0032] As a specific implementation, the number of the random number generation modules is five, and five D flip-flops are correspondingly provided.
[0033] Based on the above technical solution, the following embodiments are provided.
[0034] In this embodiment, the generator is composed of the following modules: a random number generation module, a data acquisition module, and a 5-input-1-output XOR gate. The random number generation module includes an XOR gate and fourteen inverters; the data acquisition module is composed of five D flip-flops, which are used to collect random data and transmit it to the 5-input-1-output XOR gate to generate true random numbers. This design can be implemented through a field programmable gate array (FPGA), and can pass the SP800-22 test of the National Institute of Standards (NIST) of the United States without a post-processing circuit, and meets the standard requirements in the field of cryptographic communications. The present invention has a simple structure and can be implemented using inverters and XOR gates, and has the advantages of easy implementation and high practicality. Among them, the operating principle of the generator includes:
[0035] Oscillation state: The classic ring oscillator (RO) can maintain its output in an oscillation state to ensure the generation of random signals. Figure 2 As shown in the figure, when an odd number of inverters (the function of the inverter is to invert the input signal and output it) are linked together to form a loop, the relationship between its input and output can be described as follows: when the input is '1', after passing through an odd number of inverters, its output is '0'; this output '0' will be input to the first inverter through the loop, and after passing through an odd number of inverters, the output is '1'. Therefore, no matter how the input of RO changes, its output must be opposite to the input, making the output of RO in an oscillating state. If RO is composed of an even number of inverters, its input and output must be the same, causing RO to be in a holding state.
[0036] Random jitter in oscillation circuits: Deterministic jitter and random jitter exist in actual circuits. Random jitter (generated by thermal and shot noise) in the TRNG circuit structure is the real entropy source, which causes the rising and falling edges of the clock signal to deviate from the scheduled time. Figure 3 As shown in the figure, the rising edge affected by random jitter arrives late, causing the signal period to change and continuously affecting the subsequent clock signal. Therefore, the classic TRNG structure based on a ring oscillator (RO) uses an odd number of inverters to form a circuit loop to ensure that the RO maintains an oscillation state. When the D flip-flop collects a rising edge or falling edge that deviates from the predetermined time, it collects random information (due to the existence of random jitter, it is impossible to determine whether it collects '1' or '0').
[0037] Metastable phenomenon of XOR gate: Symbol (left) and truth table (right) of XOR gate Figure 4 As shown in the figure, when the inputs of X and Y are the same, its output Z is '0'; when the inputs of X and Y are different, its output Z is '1'; but in the actual circuit, the input changes of X and Y have time differences, and X may change first, and then Y changes, and they cannot change synchronously. Therefore, the output Z of the XOR gate may have unstable short pulses. As shown in the output formula, it is assumed that the response time required by the XOR gate for the changes of X and Y inputs is d; t sxd and t syd are the X and Y terminals, respectively, and the time when the input changes; Δt s It is the time error caused by jitter, which may be positive or negative. When in the first case, the absolute value of the three is 0, and the XOR gate output Z remains unchanged; when in the third case, the absolute value of the three is greater than or equal to d, the XOR gate has sufficient time to respond, and the XOR gate output Z is the inversion of the original; only when in the second case, the absolute value of the three is less than d and greater than 0, the XOR gate output Z is changing, but it has not completely reached the normal output value, and Z will produce a short pulse phenomenon. Figure 5 As shown in the figure, this is the short pulse phenomenon of the XOR gate. When the D trigger is sampling, this short pulse phenomenon is collected and random data will be generated.
[0038] The output formula above is:
[0039]
[0040] Among them, Z′ is the output of the XOR gate, Z is the output of the first case, and Z sp is the output in the second case, This is the output in the third case.
[0041] Therefore, as a more specific generator design and application, the following specific structure and operation process are provided.
[0042] The main purpose of this generator is to build a random number generation module using inverters and XOR gates, where the entropy sources come from random jitter and metastable states. The true random number generator based on this module has strong practicality, high throughput, and is easy to port to other FPGA development boards.
[0043] In order to achieve the above object, the random number generation module designed by the present invention is as follows: Figure 6 As shown. It contains a total of 14 inverters and an XOR gate, where the Y input of the XOR gate is connected to a loop consisting of three inverters, and the other end X input is connected to a loop consisting of 11 inverters; the output Z of the XOR gate will be input into the input of the above two inverter loops.
[0044] It is known that the period of an odd number of ring oscillators is T. Where T = 2nt, n is the number of inverters, and t is the time required for each inverter to respond. Therefore, the period of a loop with three inverters and a loop with eleven inverters is obviously different. Even if the inputs of the two loops are the same and the outputs are both at the Z end, there is a time difference between the inputs at the X end and the Y end. This time difference is the period difference between the two. Therefore, as described in the metastable phenomenon of the XOR gate, the XOR gate generates a metastable phenomenon, and after stabilization, random jitter will also be generated. Therefore, the random number generation module of the present invention includes two entropy sources: random jitter and metastable state.
[0045] Subsequently, because the randomness of a single random number generation module is insufficient, the present invention uses a total of five of the above-mentioned random number generation modules, and uses five D flip-flops to collect the outputs of their Z terminals respectively. The outputs collected by the D flip-flops will be input into a 5-input-1-output XOR gate for XOR processing to obtain the final random binary data. The complete TRNG structure diagram is shown in Figure 7 .
[0046] Related experiments: In order to verify the performance of the true random data generator of the present invention, we collected 100 megabits of data produced by this invention and input it into the NIST SP800-22 test of the National Bureau of Standards of the United States. Table 1 below is the 15 test data in NIST SP800-22. As can be seen from Table 1, the 100 megabits of test data passed all test items, and their P-value values were all greater than the required 0.01, and the Pass-rate was greater than or equal to 96. This shows the excellent performance of the present invention.
[0047] Table 1 Test data
[0048]
[0049] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0050] This article uses specific examples to illustrate the principles and implementation methods of the present invention. The above examples are only used to help understand the core idea of the present invention. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting the present invention.
Claims
1. A true random number generator and a generation method of a mixed entropy source, characterized in that: include: A random number generation module, a data acquisition module and a 5-input-1-output XOR gate connected in sequence; The random number generation module includes an XOR gate and multiple inverters respectively connected to the XOR gate; the data acquisition module includes multiple D flip-flops; the input ends of the D flip-flops are connected to the output ends of the XOR gate in a one-to-one correspondence; the output end of the D flip-flop is connected to the input end of the 5-input-1-output XOR gate.
2. The true random number generator and generation method of the mixed entropy source according to claim 1, characterized in that: The random number generation module specifically includes: 1 XOR gate and 14 inverters; wherein the Y input end of the XOR gate is connected to 3 inverters to form a first loop, the X input end of the XOR gate is connected to 11 inverters to form a second loop, and the Z output end of the XOR gate is connected to the first loop and the second loop respectively.
3. The true random number generator and generation method of the mixed entropy source according to claim 2, characterized in that: The ring oscillator periods of the first loop and the second loop are T=2nt, wherein n is the number of inverters, and t is the time required for each inverter to respond.
4. The true random number generator and generation method of the mixed entropy source according to claim 2, characterized in that: There is a gap between the first loop and the second loop time difference, the XOR gate produces a metastable phenomenon; wherein T1 represents the period of the first loop, and T2 represents the period of the second loop.
5. The true random number generator and generation method of the mixed entropy source according to claim 2, characterized in that: The random number generation module includes two entropy sources: random jitter and metastable state.
6. The true random number generator and generation method of the mixed entropy source according to claim 1, characterized in that: The number of the random number generation modules is five, and five D flip-flops are provided correspondingly.
7. A method for generating true random numbers with a mixed entropy source, based on the true random number generator as claimed in any one of claims 1 to 6, characterized in that: include: The random number generation module is used to generate random oscillation information from two entropy sources, random jitter and metastable state, and the random oscillation information is collected by the data acquisition module. Finally, the random oscillation information is XOR-processed by a 5-input-1-output XOR gate to generate random data.
Citation Information
Patent Citations
True random number generator based on time delay feedback oscillators
CN106293616A