TW202020656A - True random number generators and true random number generation method - Google Patents

True random number generators and true random number generation method Download PDF

Info

Publication number
TW202020656A
TW202020656A TW107141334A TW107141334A TW202020656A TW 202020656 A TW202020656 A TW 202020656A TW 107141334 A TW107141334 A TW 107141334A TW 107141334 A TW107141334 A TW 107141334A TW 202020656 A TW202020656 A TW 202020656A
Authority
TW
Taiwan
Prior art keywords
random
sequence
random number
quasi
chaotic
Prior art date
Application number
TW107141334A
Other languages
Chinese (zh)
Other versions
TWI690847B (en
Inventor
李易青
萬培彥
廖德祿
顏錦柱
Original Assignee
樹德科技大學
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 樹德科技大學 filed Critical 樹德科技大學
Priority to TW107141334A priority Critical patent/TWI690847B/en
Application granted granted Critical
Publication of TWI690847B publication Critical patent/TWI690847B/en
Publication of TW202020656A publication Critical patent/TW202020656A/en

Links

Images

Landscapes

  • Complex Calculations (AREA)

Abstract

True random number generators and the method of generating true random numbers. The real random number generator device is mainly composed of a microcontroller for generating, a sequence of true random numbers. The true random number generator device comprises a seed module, a computing module and a processing module.The seed module has a mixing function and a chaotic system equation to generate a first pseudo-random number.The computing module has the chaotic system equation to generate a second pseudo-random number.Theprocessing module has a mixing function to dynamically modify the first pseudo-random number of seed module and the second pseudo-random number of the computingmodule,in order to get the sequence of the true random number.

Description

真亂數產生器裝置及其真亂數產生之方法True messy number generator device and method for generating genuine messy number

本創作係關於一種真亂數產生器裝置及其真亂數產生之方法,特別是一種利用微控制器產生真亂數之真亂數產生器裝置及其真亂數產生之方法。This creation relates to a device for generating a random number and a method for generating a random number, in particular, a device for generating a random number using a microcontroller and a method for generating a random number.

就隨機亂數產生器而言,主要可分兩個主要類別,即真隨機亂數產生器 (True random number generators;TRNG) 和擬隨機亂數產生器(Pseudo-random number generators;PRNG) 。As far as random random number generators are concerned, they can be divided into two main categories, namely True Random Number Generators (TrNG) and Pseudo-random Number Generators (PRNG).

TRNG 是無法事先預期及控制的,它常存在於我們周遭的自然界中,完全無人為因素,我們稱之為「真亂數」,例如:電磁雜訊、熱噪訊號、放射性元素的衰退輻射,這些都可以產生出真亂數,但這些訊號取得的技術需求較高,通常需要額外的硬體電路轉換方可萃取亂數,除成本較高外,因其建模困難的問題,無法有效控制,所以實際應用上受到限制。TRNG cannot be expected and controlled in advance. It often exists in the natural world around us. It is completely free of human factors. We call it "true chaos." Such as: electromagnetic noise, thermal noise signals, and radioactive radiation. These can produce true random numbers, but the technical requirements for obtaining these signals are relatively high. Usually, additional hardware circuit conversion is required to extract the random numbers. In addition to the high cost, due to the difficulty of modeling, it cannot be effectively controlled. , So practical application is restricted.

為了可以低成本取得亂數並達到實際應用的目的,以人為的方式來產生亂數的方法,稱為擬隨機亂數產生器 (PRNG),擬隨機亂數的設計方法是以固定的數學式以及選定的參數來產生擬亂數 (PRN),如:線性同餘法 (LCG,Linear Congruential Method),此方法所產生的亂數隨著時間單元的變化而產生不同的亂數,優點是快速且種子取得簡單,種子也是不易重覆,足夠提供一般的亂數隨機性。然而 PRNG 產生的亂數其分佈平均、隨機性、獨立性,在高品質的亂數品質要求時,如加密的應用、統計或數值分析時就不適合;若參數選擇不當則很容易讓亂數出現週期性的問題。In order to obtain random numbers at low cost and achieve the purpose of practical application, a method of artificially generating random numbers is called a quasi-random random number generator (PRNG). The design method of quasi-random random numbers is a fixed mathematical formula And selected parameters to generate quasi-random numbers (PRN), such as: linear congruential method (LCG, Linear Congruential Method), the random numbers generated by this method vary with the time unit and produce different random numbers, the advantage is fast And the seeds are easy to obtain, and the seeds are not easy to repeat, enough to provide general randomness of random numbers. However, the random numbers generated by PRNG are evenly distributed, random, and independent, and are not suitable for high-quality random number quality requirements, such as encryption applications, statistics, or numerical analysis; if the parameters are not selected properly, it is easy for random numbers to appear Periodic problems.

然而 PRNG 產生的亂數其分佈平均、隨機性、獨立性,在高品質的亂數品質要求時,如加密的應用、統計或數值分析時就不適合;若參數選擇不當則很容易讓亂數出現週期性的問題。此外,傳統 TRNG 中無法明確建模 (Modelling),因此限縮了使用範圍。However, the random numbers generated by PRNG are evenly distributed, random, and independent, and are not suitable for high-quality random number quality requirements, such as encryption applications, statistics, or numerical analysis; if the parameters are not selected properly, it is easy for random numbers to appear Periodic problems. In addition, the traditional TRNG cannot explicitly model (Modelling), so the scope of use is limited.

有鑑於上述問題,本創作之目的係利用一款有別於一般市上面的加密機制並使得在價格上有足夠的競爭力,且改善傳統混沌系統數位化之後取得之亂數隨機性不足的問題並提出真亂數建模的設計方法。In view of the above problems, the purpose of this creation is to use an encryption mechanism that is different from the general market and makes it sufficiently competitive in price, and to improve the problem of insufficient randomness of random numbers obtained after digitization of traditional chaotic systems. And put forward the design method of modeling of real random numbers.

本創作產生之亂數經過卡方測試 (Chi-square test) 與美國國家標準與技術研究院 NIST 測試都能有效證明亂數的品質,均通過真亂數序列的測試標準及要求。The random numbers generated by this creation can be effectively proved by the Chi-square test and the NIST test of the National Institute of Standards and Technology. They all pass the test standards and requirements of the real random number sequence.

為了達成上述目的,本創作一種真亂數產生器裝置及其真亂數產生之方法。真亂數產生器裝置以微控制器為主要架構,微控制器可產生真亂數序列。該真亂數產生器裝置包括種子模組、運算模組以及處理模組。種子模組具有混合函數以及混沌系統方程式,以產生第一擬隨機亂數序列。 運算模組具有該混沌系統方程式,以產生第二擬隨機亂數序列。處理模組具有混合函數,將種子模組以及運算模組輸入之第一擬隨機亂數序列以及第二擬隨機亂數序列進行動態調變,藉以得到該真亂數序列。In order to achieve the above purpose, the author creates a device for generating a random number generator and a method for generating a random number generator. The messy number generator device uses a microcontroller as the main structure, and the microcontroller can generate a messy number sequence. The real random number generator device includes a seed module, an arithmetic module and a processing module. The seed module has a mixed function and a chaotic system equation to generate a first quasi-random random number sequence. The operation module has the chaotic system equation to generate the second quasi-random random number sequence. The processing module has a mixed function, and dynamically modifies the first quasi-random random number sequence and the second quasi-random random number sequence input by the seed module and the operation module to obtain the true random number sequence.

上述的真亂數產生器裝置,其中,該混沌系統方程式為 Henon map 混沌系統的差分動態方程,以及該第二擬隨機亂數序列為 Henon map 混沌系統

Figure 02_image001
之狀態序列。The above-mentioned chaotic number generator device, wherein the chaotic system equation is the differential dynamic equation of the Henon map chaotic system, and the second quasi-random chaotic number sequence is the Henon map chaotic system
Figure 02_image001
The state sequence.

上述的真亂數產生器裝置,其中,該動態調變使用一浮點數數位化的方式,進行放大及混勻輸入之隨機序列,其至少包括下列步驟:In the foregoing random number generator device, the dynamic modulation uses a floating-point digitization method to amplify and mix the input random sequence, which includes at least the following steps:

(a) 隨機選用一個質數

Figure 02_image003
Figure 02_image005
;(a) Randomly choose a prime number
Figure 02_image003
,
Figure 02_image005
;

(b) 從中選擇質數 g,

Figure 02_image007
;(b) Select the prime number g,
Figure 02_image007
;

(c) 由一擬隨機亂數序列,經一浮點數數位化的方式,取得隨機動態正整數對 (r,x) ;(c) A random dynamic positive integer pair (r, x) is obtained from a quasi-random random number sequence, digitized by a floating-point number;

(d) 計算金鑰

Figure 02_image009
;(d) Calculate the key
Figure 02_image009
;

(e) 由另一擬隨機亂數序列取得

Figure 02_image011
,進行調變後序列函數
Figure 02_image013
。(e) obtained from another quasi-random random number sequence
Figure 02_image011
, Sequence function after modulation
Figure 02_image013
.

上述的真亂數產生器裝置,其中,該浮點數數位化的方式為依照 IEEE754 格式,將取得浮點數拆分為 8 Bytes,選用第六個 Bytes 作為 r 的來源,利用 r 的大小來對應 x 的範圍,使得 x 的範圍侷限在

Figure 02_image015
。The above-mentioned garbled number generator device, wherein the method of digitizing the floating-point number is to split the obtained floating-point number into 8 Bytes according to the IEEE754 format, select the sixth Bytes as the source of r, and use the size of r to Corresponding to the range of x, so that the range of x is limited to
Figure 02_image015
.

上述的真亂數產生器裝置,其中,

Figure 02_image017
表示以質數 p 及 q 以
Figure 02_image019
所形成之集合,所以
Figure 02_image021
的選擇為選擇一質數 p,再從
Figure 02_image017
中選擇
Figure 02_image007
。The above random number generator device, wherein,
Figure 02_image017
Expressed as prime numbers p and q
Figure 02_image019
The set formed, so
Figure 02_image021
Is to choose a prime number p, and then
Figure 02_image017
Choose
Figure 02_image007
.

為了達成前述目的,本創作一種真亂數產生之方法,係用於一真亂數產生器裝置,該方法包括以下步驟:In order to achieve the aforementioned purpose, this method creates a method for generating a random number, which is used in a random number generator device. The method includes the following steps:

(S100) 隨機選用一質數

Figure 02_image003
Figure 02_image005
;(S100) randomly select a prime number
Figure 02_image003
,
Figure 02_image005
;

(S200) 從

Figure 02_image017
中選擇質數
Figure 02_image023
Figure 02_image007
;(S200) From
Figure 02_image017
Choose prime number
Figure 02_image023
,
Figure 02_image007
;

(S300) 由一混沌系統方程式之

Figure 02_image025
狀態序列取得
Figure 02_image027
,經一浮點數數位化的方式,取得隨機動態正整數對 (r,x) ;(S300) From a chaotic system equation
Figure 02_image025
State sequence acquisition
Figure 02_image027
, After digitizing a floating-point number, obtain a random dynamic positive integer pair (r, x);

(S400) 計算金鑰

Figure 02_image009
;(S400) Calculate the key
Figure 02_image009
;

(S500) 由該混沌系統方程式之

Figure 02_image029
狀態序列,經該一浮點數數位化的方式取得
Figure 02_image011
,再對
Figure 02_image011
進行一動態調變,以得到一第一擬隨機亂數序列。(S500) From the equation of the chaotic system
Figure 02_image029
State sequence, obtained by digitizing the floating point number
Figure 02_image011
, Again
Figure 02_image011
Perform a dynamic modulation to obtain a first quasi-random random number sequence.

(S600) 重複執行步驟一到步驟二;(S600) Repeat steps 1 to 2;

(S700) 由一第二擬隨機亂數序列取得

Figure 02_image031
,經該浮點數數位化的方式,取得隨機動態正整數對 (r,x) ;(S700) Obtained from a second quasi-random random number sequence
Figure 02_image031
, After digitizing the floating-point number, a random dynamic positive integer pair (r, x) is obtained;

(S800) 計算金鑰

Figure 02_image009
;(S800) Calculate the key
Figure 02_image009
;

(S900) 由該第一擬隨機亂數序列取得

Figure 02_image033
,再對
Figure 02_image033
Figure 02_image031
進行該動態調變,以得到一真亂數序列。(S900) Obtained from the first quasi-random random number sequence
Figure 02_image033
, Again
Figure 02_image033
versus
Figure 02_image031
This dynamic modulation is performed to obtain a sequence of real numbers.

上述的真亂數產生之方法,其中,該混沌系統方程式為 Henon map 混沌系統的差分動態方程,以及該第二擬隨機亂數序列為 Henon map 混沌系統

Figure 02_image029
之狀態序列。The method for generating the above-mentioned chaotic numbers, wherein the chaotic system equation is the differential dynamic equation of the Henon map chaotic system, and the second quasi-random chaotic number sequence is the Henon map chaotic system
Figure 02_image029
The state sequence.

上述的真亂數產生之方法,其中,該動態調變使用一浮點數數位化的方式,進行放大及混勻輸入之隨機序列,其至少包括下列步驟:The above method for generating random numbers, wherein the dynamic modulation uses a floating-point digitization method to amplify and mix the input random sequence, which includes at least the following steps:

(a) 隨機選用一個質數

Figure 02_image003
Figure 02_image005
;(a) Randomly choose a prime number
Figure 02_image003
,
Figure 02_image005
;

(b) 從中選擇質數 g,

Figure 02_image007
;(b) Select the prime number g,
Figure 02_image007
;

(c) 由一擬隨機亂數序列,經一浮點數數位化的方式,取得隨機動態正整數對 (r,x) ;(c) A random dynamic positive integer pair (r, x) is obtained from a quasi-random random number sequence, digitized by a floating-point number;

(d) 計算金鑰

Figure 02_image009
;(d) Calculate the key
Figure 02_image009
;

(e) 由另一擬隨機亂數序列,經該浮點數數位化的方式取得

Figure 02_image011
,函數
Figure 02_image013
。(e) obtained from another quasi-random random number sequence by digitizing the floating-point number
Figure 02_image011
,function
Figure 02_image013
.

上述的真亂數產生之方法,其中,如申請專利範圍第6項所述的真亂數產生之方法,其中,

Figure 02_image017
表示以質數 p 及 q 以
Figure 02_image019
所形成之集合,所以
Figure 02_image021
的選擇為選擇一質數 p,再從
Figure 02_image017
中選擇
Figure 02_image007
。The above method for generating a random number, wherein the method for generating a random number as described in Item 6 of the patent application scope, wherein,
Figure 02_image017
Expressed as prime numbers p and q
Figure 02_image019
The set formed, so
Figure 02_image021
Is to choose a prime number p, and then
Figure 02_image017
Choose
Figure 02_image007
.

上述的真亂數產生之方法,其中,該浮點數數位化的方式為依照 IEEE754 格式,將取得浮點數拆分為 8Bytes,之選用第六個 Bytes 作為 r 的來源,利用 r 的大小來對應 x 的範圍,使得 x 的範圍侷限在

Figure 02_image015
。The method for generating the above-mentioned messy numbers, wherein the digitization method of the floating-point number is to split the obtained floating-point number into 8Bytes according to the IEEE754 format, and select the sixth Bytes as the source of r, using the size of r to Corresponding to the range of x, so that the range of x is limited to
Figure 02_image015
.

針對于現有技術,本創作的功效在於:For the existing technology, the effect of this creation is:

1. 創新使用混合函數實現真亂數序列,並解決傳統 TRNG 中無法明確建模 (Modelling) 的問題;1. Innovative use of mixed functions to realize the sequence of real messy numbers, and solve the problem of unclear modelling in traditional TRNG;

2. 改善混沌系統數位化後的亂數隨機性不足問題;2. Improve the problem of insufficient randomness of chaotic numbers after digitization of chaotic systems;

3. 改善混沌系統數位化後的亂數隨機性不足問題,設計出能產生出真隨機亂數的裝置。3. Improve the problem of insufficient randomness of chaotic numbers after digitization of chaotic systems, and design devices that can generate true random chaotic numbers.

4. 經過卡方測試 (Chi-square test) 與美國國家標準與技術研究院 NIST 測試都能有效證明亂數的品質。4. The Chi-square test and the National Institute of Standards and Technology NIST test can effectively prove the quality of random numbers.

5. 在可建模情況下,在未來可容延伸其後續的應用,例如:加解密技術、認證應用,就設計本身安全性考量是大幅提昇,因此,本創作可充分發揮其實用性,且未來的應用也能夠非常的多元。5. In the case of modelling, it is possible to extend its subsequent applications in the future, such as encryption and decryption technology, authentication applications, and the security considerations of the design itself are greatly improved. Therefore, this creation can give full play to its practicality, and Future applications can also be very diverse.

本創作將由圖式配合以下說明而得到充分瞭解,使得熟習本技藝之人士可據以完成,然本案之實施並非可由下列實施例而被限制其實施型態。This creation will be fully understood by the drawings and the following description, so that those skilled in the art can complete it, but the implementation of this case is not limited by the following embodiments.

請參閱圖 1,是本創作之真亂數產生器裝置之架構示意圖,如圖 1 所示,本創作一種真亂數產生器裝置 1 ,所述真亂數產生器裝置 1 以一微控制器 2 為主要架構,該微控制器 2 可產生一真亂數序列 3 ,該真亂數產生器裝置 1 包括一種子模組 4 、一運算模組 5 以及一處理模組 6 。Please refer to FIG. 1, which is a schematic structural diagram of the created random number generator device. As shown in FIG. 1, this created a random number generator device 1, which uses a microcontroller 2 is the main structure, the microcontroller 2 can generate a random number sequence 3, and the random number generator device 1 includes a sub-module 4, an arithmetic module 5 and a processing module 6.

該種子模組 4 具有一混合函數 41 以及一混沌系統方程式 42 ,用以產生一第一擬隨機亂數序列 43。該運算模組 5 具有該混沌系統方程式 42 ,用以產生一第二擬隨機亂數序列 51。該處理模組 6 連接該種子模組 4 以及該運算模組 5 ,具有該混合函數 41,將該種子模組 4 以及該運算模組 5 輸入之該第一擬隨機亂數序列 43 以及該第二擬隨機亂數序列 51 進行一動態調變 7 ,藉以得到該真亂數序列 3。The seed module 4 has a mixing function 41 and a chaotic system equation 42 for generating a first quasi-random random number sequence 43. The arithmetic module 5 has the chaotic system equation 42 for generating a second quasi-random random number sequence 51. The processing module 6 is connected to the seed module 4 and the operation module 5, has the mixing function 41, the first quasi-random random number sequence 43 and the first input to the seed module 4 and the operation module 5 The two pseudo-random random number sequences 51 undergo a dynamic modulation 7 to obtain the true random number sequence 3.

上述中,該混沌系統方程式 42 為 Henon map 混沌系統的差分動態方程,其方成組為:In the above, the chaotic system equation 42 is the differential dynamic equation of the Henon map chaotic system, and its square group is:

Figure 02_image035
Figure 02_image037
Figure 02_image035
Figure 02_image037

具有

Figure 02_image039
之狀態序列以及
Figure 02_image001
之狀態序列。have
Figure 02_image039
State sequence and
Figure 02_image001
The state sequence.

以及,該第二擬隨機亂數序列 51 為 Henon map 混沌系統

Figure 02_image001
之狀態序列。And, the second quasi-random random number sequence 51 is a Henon map chaotic system
Figure 02_image001
The state sequence.

請參閱圖 2,是本發明之動態調變之步驟流程圖。該動態調變 7 使用一浮點數數位化 8 的方式,進行放大及混勻輸入之隨機序列,其至少包括下列步驟:Please refer to FIG. 2, which is a flowchart of the steps of the dynamic modulation of the present invention. The dynamic modulation 7 uses a floating-point digitization 8 to amplify and mix the input random sequence, which includes at least the following steps:

(a) 隨機選用一個質數

Figure 02_image003
Figure 02_image005
;(a) Randomly choose a prime number
Figure 02_image003
,
Figure 02_image005
;

(b) 從中選擇質數 g,

Figure 02_image007
;(b) Select the prime number g,
Figure 02_image007
;

(c) 由一擬隨機亂數序列,經一浮點數數位化的方式,取得隨機動態正整數對 (r,x) ;(c) A random dynamic positive integer pair (r, x) is obtained from a quasi-random random number sequence, digitized by a floating-point number;

(d) 計算金鑰

Figure 02_image009
;(d) Calculate the key
Figure 02_image009
;

(e) 由另一擬隨機亂數序列取得

Figure 02_image011
,進行調變後序列函數
Figure 02_image013
。(e) obtained from another quasi-random random number sequence
Figure 02_image011
, Sequence function after modulation
Figure 02_image013
.

另外,該浮點數數位化 8 的方式為依照 IEEE754 格式,將取得浮點數拆分為 8Bytes,選用第六個 Bytes 作為 r 的來源,利用 r 的大小來對應 x 的範圍,使得 x 的範圍侷限在

Figure 02_image015
。其中,當 p=23,x的範圍為
Figure 02_image041
,如圖 3 所示。In addition, the method of digitizing the floating-point number 8 is to split the obtained floating-point number into 8Bytes according to the IEEE754 format, select the sixth Bytes as the source of r, and use the size of r to correspond to the range of x, so that the range of x Limited to
Figure 02_image015
. Among them, when p=23, the range of x is
Figure 02_image041
,As shown in Figure 3.

此外,上述中,

Figure 02_image017
表示以質數 p 及 q 以
Figure 02_image019
所形成之集合,所以
Figure 02_image021
的選擇為選擇一質數 p,再從
Figure 02_image017
中選擇
Figure 02_image007
。In addition, in the above,
Figure 02_image017
Expressed as prime numbers p and q
Figure 02_image019
The set formed, so
Figure 02_image021
Is to choose a prime number p, and then
Figure 02_image017
Choose
Figure 02_image007
.

請參閱圖 4,一種真亂數產生之方法 9,係用於一真亂數產生器裝置 1,該方法包括以下步驟:Please refer to FIG. 4, a method 9 for generating a random number is used for a random number generator device 1. The method includes the following steps:

(S100) 隨機選用一質數

Figure 02_image003
Figure 02_image005
;(S100) randomly select a prime number
Figure 02_image003
,
Figure 02_image005
;

(S200) 從

Figure 02_image017
中選擇質數
Figure 02_image023
Figure 02_image007
;(S200) From
Figure 02_image017
Choose prime number
Figure 02_image023
,
Figure 02_image007
;

(S300) 由一混沌系統方程式之

Figure 02_image025
狀態序列取得
Figure 02_image027
,經一浮點數數位化的方式,取得隨機動態正整數對 (r,x) ;(S300) From a chaotic system equation
Figure 02_image025
State sequence acquisition
Figure 02_image027
, After digitizing a floating-point number, obtain a random dynamic positive integer pair (r, x);

(S400) 計算金鑰

Figure 02_image009
;(S400) Calculate the key
Figure 02_image009
;

(S500) 由該混沌系統方程式之

Figure 02_image029
狀態序列,經該該浮點數數位化的方式取得
Figure 02_image011
,再對
Figure 02_image011
進行一動態調變,以得到一第一擬隨機亂數序列。(S500) From the equation of the chaotic system
Figure 02_image029
State sequence, obtained by digitizing the floating point number
Figure 02_image011
, Again
Figure 02_image011
Perform a dynamic modulation to obtain a first quasi-random random number sequence.

(S600) 重複執行步驟一到步驟二;(S600) Repeat steps 1 to 2;

(S700) 由一第二擬隨機亂數序列取得

Figure 02_image031
,經該浮點數數位化的方式,取得隨機動態正整數對 (r,x) ;(S700) Obtained from a second quasi-random random number sequence
Figure 02_image031
, After digitizing the floating-point number, a random dynamic positive integer pair (r, x) is obtained;

(S800) 計算金鑰

Figure 02_image009
;(S800) Calculate the key
Figure 02_image009
;

(S900) 由該第一擬隨機亂數序列取得

Figure 02_image033
,再對
Figure 02_image033
Figure 02_image031
進行該動態調變,以得到一真亂數序列。(S900) Obtained from the first quasi-random random number sequence
Figure 02_image033
, Again
Figure 02_image033
versus
Figure 02_image031
This dynamic modulation is performed to obtain a sequence of real numbers.

上述中,本創作產生之該真亂數序列 3 ,為證實能有效達到真亂數序列的品質,將以分別以卡方測試 (Chi-square test) 與美國國家標準與技術研究院 NIST 測試,證明通過真亂數序列的測試標準及要求。In the above, the chaotic number sequence 3 produced by this creation, in order to prove that it can effectively achieve the quality of the chaotic number sequence, will be tested by Chi-square test and NIST, respectively. Proof that the test standards and requirements for passing random numbers are passed.

首先,卡方測試 (Chi-square test) 使用的統計值為:

Figure 02_image043
其中,
Figure 02_image045
代表第
Figure 02_image047
個分類的數量、
Figure 02_image049
代表期望的第
Figure 02_image047
個分類的數量、以均勻分配為例,期望的第i個分類數量為:
Figure 02_image051
Figure 02_image053
代表觀測值的所有數量、
Figure 02_image055
代表間隔的總數,而這間隔的數字總數的跟其他間隔的數字總數需要相等。First, the statistical values used by the Chi-square test are:
Figure 02_image043
among them,
Figure 02_image045
Representative
Figure 02_image047
Number of categories,
Figure 02_image049
Represents the expected
Figure 02_image047
The number of categories, taking uniform distribution as an example, the expected number of the i-th category is:
Figure 02_image051
,
Figure 02_image053
Represents the total number of observations,
Figure 02_image055
Represents the total number of intervals, and the total number of digits in this interval needs to be equal to the total number of digits in other intervals.

請參閱圖5,將本創作之該真亂數序列 3 產出100組觀測值,將100組觀測值進行卡方測試 (Chi-square test) 中各項次的分類及運算要求,計算完成後,使用卡方測試顯著水準為α=0.01,驗證數據是否具有均勻性。Please refer to Fig. 5 to generate 100 sets of observations from the original random number sequence 3, and perform the classification and calculation requirements of each time in the Chi-square test (Chi-square test) after the 100 sets of observations are completed. , Using the chi-square test, the significance level is α=0.01, to verify whether the data is uniform.

此測試 N=100,n=15,分成15個等距的間隔。This test N=100, n=15, divided into 15 equally spaced intervals.

如前計算方式可得

Figure 02_image057
=2.292。Available as before
Figure 02_image057
=2.292.

Figure 02_image059
= 29.141 比較結果小於 29.141,因此沒有落入拒絕域內,該待測序列是具有均勻性的。versus
Figure 02_image059
= 29.141 The comparison result is less than 29.141, so it does not fall into the rejection field, and the sequence to be tested is uniform.

另外,將本創作產生之該真亂數序列 3 ,進行美國國家標準與技術研究院 NIST 測試,其測試值的結果稱為 p 值 (p-value)。如果 p 值 ≥ 0.01,則隨機性測試通過。In addition, the real random number sequence 3 produced by this creation was tested by the National Institute of Standards and Technology NIST, and the result of the test value was called p-value. If the p-value ≥ 0.01, the randomness test passes.

美國國家標準與技術研究院 NIST 測試,其隨機性測試項目(共15項) 說明如下:The National Institute of Standards and Technology NIST test, its randomness test items (a total of 15 items) are described as follows:

Frequency test:目的是測試序列均勻性,測試二進制序列中,“0”和“1”數目是否近似相等。如果是,則序列是隨機的。Frequency test: The purpose is to test the uniformity of the sequence and test whether the numbers of "0" and "1" in the binary sequence are approximately equal. If it is, the sequence is random.

BlockFrequency test : 目的是確定在測試序列中,所有非重疊的長度為m位的塊內的“0”和“1”的數目是否表現為隨機分佈。如果是,則序列是隨機的。BlockFrequency test: The purpose is to determine whether the number of "0" and "1" in all non-overlapping m-length blocks in the test sequence appears to be randomly distributed. If it is, the sequence is random.

Cumulative Sums test: 目的是確定該測試基於由序列累積和的隨機遊走的最大距離。足夠大的距離表示非隨機性。Cumulative Sums test: The purpose is to determine the maximum distance of this test based on the random walk by the cumulative sum of sequences. A sufficiently large distance indicates non-randomness.

Runs test: 目的是確定測試序列中,各種特定長度的“0”和“1”的數目是否如真隨機序列期望的那樣。如果是,則序列是隨機的。Runs test: The purpose is to determine whether the number of "0" and "1" of various specific lengths in the test sequence is as expected by a true random sequence. If it is, the sequence is random.

Longest Run test: 目的是確定待測序列中,最長連“1”串的長度是否與真隨機序列中最長連“1”串的長度近似一致。如果是,則序列是隨機的。Longest Run test: The purpose is to determine whether the length of the longest continuous "1" string in the sequence to be tested is approximately the same as the length of the longest continuous "1" string in the true random sequence. If it is, the sequence is random.

Rank test: 目的是檢測待測序列中,固定長度子序列的線性相關性。如果線性相關性較小,則序列是隨機的。Rank test: The purpose is to detect the linear correlation of fixed-length subsequences in the sequence to be tested. If the linear correlation is small, the sequence is random.

FFT test: 目的是通過檢測待測序列的周期性質,並與真隨機序列週期性質相比較,通過它們之間的偏離程度來確定待測序列隨機性。如果偏離程度較小,序列是隨機的。FFT test: The purpose is to determine the randomness of the sequence to be tested by detecting the periodic nature of the sequence to be tested and comparing it with the true random sequence. If the deviation is small, the sequence is random.

Non Overlapping Template test: 目的是檢測待測序列中,子序列是否與太多的非週期模板相匹配。太多就意味著待測序列是非隨機的。Non Overlapping Template test: The purpose is to detect whether the subsequence in the sequence to be tested matches too many non-periodic templates. Too much means that the sequence to be tested is non-random.

Overlapping Template test: 目的是統計待測序列中,特定長度的連續“1”的數目,是否與真隨機序列的情況偏離太大。太大是非隨機的。Overlapping Template test: The purpose is to count whether the number of consecutive “1”s of a specific length in the sequence to be tested deviates too much from the situation of a true random sequence. Too large is non-random.

Universal: 目的是檢測待測序列是否能在信息不丟失的情況下被明顯壓縮。一個不可被明顯壓縮的序列是隨機的。Universal: The purpose is to detect whether the sequence under test can be compressed significantly without losing information. A sequence that cannot be obviously compressed is random.

Approximate Entropy test: 目的是通過比較m位比特串與m-1位比特串在待測序列中出現的頻率,再與正態分佈的序列中的情況相對比,從而確定隨機性。Approximate Entropy test: The purpose is to determine the randomness by comparing the frequency of the m-bit bit string and the m-1 bit string in the sequence under test, and then comparing it with the situation in the normally distributed sequence.

Random Excursions test: 目的是確定在一個隨機遊程中,某個特定狀態出現的次數是否遠遠超過真隨機序列中的情況。如果是,則序列是非隨機的。Random Excursions test: The purpose is to determine whether the number of occurrences of a particular state in a random run far exceeds the situation in a true random sequence. If it is, the sequence is non-random.

Random Excursions Variant test: 目的是檢測待測序列中,某一特定狀態在一個隨機遊程中出現次數與真隨機序列的偏離程度。如果偏離程度較大,則序列是非隨機的。Random Excursions Variant test: The purpose is to detect the deviation of the number of occurrences of a particular state in a random run from a true random sequence in the sequence to be tested. If the deviation is large, the sequence is non-random.

Serial test : 目的是確定待測序列所有可能的m位比特的組合子串出現的次數是否與真隨機序列中的情況近似相同,如果是,則序列是隨機的。Serial test: The purpose is to determine whether the number of possible m-bit combined substrings of the sequence under test is approximately the same as that in a true random sequence. If it is, the sequence is random.

Linear Complexity test: 目的是確定待測序列是否足夠複雜,如果是,則序列是隨機的。Linear Complexity test: The purpose is to determine whether the sequence to be tested is sufficiently complex. If it is, the sequence is random.

測試條件參數設置:UniversalTest condition parameter setting: Universal

測試參數設置: 序列長度 n =

Figure 02_image061
位元,子序列個數 m = 10Test parameter setting: sequence length n =
Figure 02_image061
Bits, number of subsequences m = 10

其他項測試:序列長度 n =

Figure 02_image063
位元,子序列個數 m = 10Other tests: sequence length n =
Figure 02_image063
Bits, number of subsequences m = 10

請參閱圖 6,看出本創作所提出之該真亂數序列 3 全部通過了 NIST 的測試,在整體測試項目的 P-value 都有顯著的 p 值 ≥ 0.01,整體觀之,隨機性是通過認證,也驗證本方法之可行性。Please refer to Fig. 6, we can see that the real random number sequence 3 proposed by this creation has all passed the NIST test, and the P-value of the overall test item has a significant p value ≥ 0.01. Overall, the randomness is passed Certification also verifies the feasibility of this method.

綜合以上說明及測試分析結果,本創作改善混沌系統數位化後的亂數隨機性不足問題,設計出能產生出真隨機亂數的裝置,而此裝置產生之亂數經過卡方測試 (Chi-square test) 與美國國家標準與技術研究院 NIST 測試都能有效證明亂數的品質,均通過真亂數序列的測試標準及要求,本項技術研發具有足夠的新穎性、進步性。Based on the above description and test and analysis results, this work improves the problem of insufficient randomness of the random numbers after the digitization of the chaotic system, and designs a device that can generate true random random numbers, and the random numbers generated by this device have passed the chi-square test (Chi- square test) and the National Institute of Standards and Technology NIST test can effectively prove the quality of random numbers. Both have passed the test standards and requirements of real random number sequences. This technology research and development has sufficient novelty and progress.

上述僅為本發明的較佳實施例而已,並非用來限定本發明實施的範圍,在不背離本發明精神及其實質的情況下,熟悉本領域的技術人員當可根據本發明作出各種相應的改變和變形,但這些相應的改變和變形都應屬於本發明所附的權利要求的保護範圍。The above are only preferred embodiments of the present invention, and are not intended to limit the scope of the present invention. Without departing from the spirit and essence of the present invention, those skilled in the art can make various corresponding ones according to the present invention. Changes and modifications, but these corresponding changes and modifications shall fall within the scope of protection of the claims appended to the present invention.

1:真亂數產生器裝置2:微控制器3:真亂數序列4:種子模組41:混合函數42:混沌系統方程式43:第一擬隨機亂數序列5:運算模組51:第二擬隨機亂數序列6:處理模組7:動態調變8:浮點數數位化9:真亂數產生之方法1: True random number generator device 2: Microcontroller 3: True random number sequence 4: Seed module 41: Hybrid function 42: Chaos system equation 43: First quasi-random random number sequence 5: Operation module 51: No. Two quasi-random random number sequence 6: processing module 7: dynamic modulation 8: digitization of floating-point numbers 9: method of generating real random numbers

圖1係本創作之真亂數產生器裝置之架構示意圖。 圖2係本創作之動態調變之步驟流程圖。 圖3係本創作之浮點數數位化之對應圖。 圖4係本創作之真亂數產生之方法之步驟流程圖。 圖5係本創作之卡方測試之分類運算表。 圖6係本創作之 NIST 測試結果表。FIG. 1 is a schematic diagram of the structure of the created random number generator device. Figure 2 is a flow chart of the steps of dynamic modulation of this creation. Figure 3 is the corresponding diagram of the digitization of floating point numbers in this creation. Fig. 4 is a flow chart of the steps of the method for generating the random numbers in this creation. Figure 5 is the classification calculation table of the chi-square test of this creation. Figure 6 is the NIST test result table of this creation.

1:真亂數產生器裝置 1: True random number generator device

2:微控制器 2: microcontroller

3:真亂數序列 3: True messy number sequence

4:種子模組 4: Seed module

41:混合函數 41: Mixed function

42:混沌系統方程式 42: Chaos system equation

43:第一擬隨機亂數序列 43: The first quasi-random random number sequence

5:運算模組 5: arithmetic module

51:第二擬隨機亂數序列 51: Second quasi-random random number sequence

6:處理模組 6: Processing module

7:動態調變 7: Dynamic modulation

8:浮點數數位化 8: digitization of floating point numbers

Claims (10)

一種真亂數產生器裝置,所述真亂數產生器裝置以一微控制器為主要架構,該微控制器可產生一真亂數序列,該真亂數產生器裝置包括: 一種子模組,具有一混合函數以及一混沌系統方程式,用以產生一第一擬隨機亂數序列; 一運算模組,具有該混沌系統方程式,用以產生一第二擬隨機亂數序列; 一處理模組,連接該種子模組以及該運算模組,具有該混合函數,將該種子模組以及該運算模組輸入之該第一擬隨機亂數序列以及該第二擬隨機亂數序列進行一動態調變,藉以得到該真亂數序列。A disturbed number generator device. The disturbed number generator device has a microcontroller as a main structure. The microcontroller can generate a disturbed number sequence. The disturbed number generator device includes: a sub-module , With a mixed function and a chaotic system equation for generating a first quasi-random random number sequence; an operation module with the chaotic system equation for generating a second quasi-random random number sequence; a processing module , Connect the seed module and the operation module, have the mixed function, and perform a dynamic adjustment of the first quasi-random random number sequence and the second quasi-random random number sequence input by the seed module and the operation module Change, so as to get the sequence of real random numbers. 如申請專利範圍第1項所述的真亂數產生器裝置,其中,該混沌系統方程式為 Henon map 混沌系統的差分動態方程,以及該第二擬隨機亂數序列為 Henon map 混沌系統
Figure 03_image001
之狀態序列。
The chaotic number generator device as described in item 1 of the patent application range, wherein the chaotic system equation is the differential dynamic equation of the Henon map chaotic system, and the second quasi-random chaotic number sequence is the Henon map chaotic system
Figure 03_image001
The state sequence.
如申請專利範圍第1項所述的真亂數產生器裝置,其中,該動態調變使用一浮點數數位化的方式,進行放大及混勻輸入之隨機序列,其至少包括下列步驟: (a) 隨機選用一個質數
Figure 03_image003
Figure 03_image005
; (b) 從中選擇質數 g,
Figure 03_image007
; (c) 由一擬隨機亂數序列,經一浮點數數位化的方式,取得隨機動態正整數對 (r,x) ; (d) 計算金鑰
Figure 03_image009
; (e) 由另一擬隨機亂數序列取得
Figure 03_image011
,進行調變後序列函數
Figure 03_image013
The random number generator device as described in item 1 of the patent application scope, wherein the dynamic modulation uses a floating-point digitization method to amplify and mix the input random sequence, which includes at least the following steps: ( a) Randomly choose a prime number
Figure 03_image003
,
Figure 03_image005
; (b) Choose prime number g from it,
Figure 03_image007
; (c) obtain a random dynamic positive integer pair (r, x) from a quasi-random random number sequence, digitized by a floating point number; (d) calculate the key
Figure 03_image009
; (e) obtained from another quasi-random random number sequence
Figure 03_image011
, Sequence function after modulation
Figure 03_image013
.
如申請專利範圍第3項所述的真亂數產生器裝置,其中,該浮點數數位化的方式為依照 IEEE754 格式,將取得浮點數拆分為 8Bytes,選用第六個 Bytes 作為 r 的來源,利用 r 的大小來對應 x 的範圍,使得 x 的範圍侷限在
Figure 03_image015
The messy number generator device as described in item 3 of the patent application scope, wherein the digitization method of the floating-point number is to split the obtained floating-point number into 8Bytes according to the IEEE754 format, and select the sixth Bytes as the r Source, using the size of r to correspond to the range of x, so that the range of x is limited to
Figure 03_image015
.
如申請專利範圍第3項所述的真亂數產生器裝置,其中,
Figure 03_image017
表示以質數 p 及 q 以
Figure 03_image019
所形成之集合,所以
Figure 03_image021
的選擇為選擇一質數 p,再從
Figure 03_image017
中選擇
Figure 03_image007
The random number generator device as described in item 3 of the patent application scope, wherein,
Figure 03_image017
Expressed as prime numbers p and q
Figure 03_image019
The set formed, so
Figure 03_image021
Is to choose a prime number p, and then
Figure 03_image017
Choose
Figure 03_image007
.
一種真亂數產生之方法,係用於一真亂數產生器裝置,該方法包括以下步驟: (S100) 隨機選用一質數
Figure 03_image003
Figure 03_image005
;   (S200) 從
Figure 03_image017
中選擇質數
Figure 03_image023
Figure 03_image007
; (S300) 由一混沌系統方程式之
Figure 03_image025
狀態序列取得
Figure 03_image027
,經一浮點數數位化的方式,取得隨機動態正整數對 (r,x) ; (S400) 計算金鑰
Figure 03_image009
; (S500) 由該混沌系統方程式之
Figure 03_image029
狀態序列,經該一浮點數數位化的方式取得
Figure 03_image011
,再對
Figure 03_image011
進行一動態調變,以得到一第一擬隨機亂數序列。 (S600) 重複執行步驟一到步驟二; (S700) 由一第二擬隨機亂數序列取得
Figure 03_image031
,經該浮點數數位化的方式,取得隨機動態正整數對 (r,x) ; (S800) 計算金鑰
Figure 03_image009
; (S900) 由該第一擬隨機亂數序列取得
Figure 03_image033
,再對
Figure 03_image033
Figure 03_image031
進行該動態調變,以得到一真亂數序列。
A method for generating a random number is used for a random number generator device. The method includes the following steps: (S100) randomly select a prime number
Figure 03_image003
,
Figure 03_image005
; (S200) From
Figure 03_image017
Choose prime number
Figure 03_image023
,
Figure 03_image007
; (S300) From a chaotic system equation
Figure 03_image025
State sequence acquisition
Figure 03_image027
, Digitize a floating point number to obtain a random dynamic positive integer pair (r, x); (S400) calculate the key
Figure 03_image009
; (S500) From the equation of the chaotic system
Figure 03_image029
The state sequence is obtained by digitizing the floating point number
Figure 03_image011
, Again
Figure 03_image011
Perform a dynamic modulation to obtain a first quasi-random random number sequence. (S600) Repeat steps 1 to 2; (S700) Obtain from a second quasi-random random number sequence
Figure 03_image031
,According to the way of digitizing the floating point, obtain the random dynamic positive integer pair (r, x); (S800) Calculate the key
Figure 03_image009
; (S900) Obtained from the first quasi-random random number sequence
Figure 03_image033
, Again
Figure 03_image033
versus
Figure 03_image031
This dynamic modulation is performed to obtain a sequence of real numbers.
如申請專利範圍第6項所述的真亂數產生之方法,其中,該混沌系統方程式為 Henon map 混沌系統的差分動態方程,以及該第二擬隨機亂數序列為 Henon map 混沌系統
Figure 03_image001
之狀態序列。
The method for generating chaotic numbers as described in item 6 of the patent application scope, wherein the chaotic system equation is the differential dynamic equation of the Henon map chaotic system, and the second quasi-random chaotic number sequence is the Henon map chaotic system
Figure 03_image001
The state sequence.
如申請專利範圍第6項所述的真亂數產生之方法,其中,該動態調變為進行放大及混勻,其至少包括下列步驟: (a) 隨機選用一個質數
Figure 03_image003
Figure 03_image065
; (b) 從中選擇質數 g,
Figure 03_image067
; (c) 由一擬隨機亂數序列,經一浮點數數位化的方式,取得隨機動態正整數對 (r,x) ; (d) 計算金鑰
Figure 03_image069
; (e) 由另一擬隨機亂數序列,經該浮點數數位化的方式取得
Figure 03_image071
,函數
Figure 03_image073
The method for generating chaotic numbers as described in item 6 of the patent application scope, in which the dynamic modulation is amplified and mixed, which includes at least the following steps: (a) randomly select a prime number
Figure 03_image003
,
Figure 03_image065
; (b) Choose prime number g from it,
Figure 03_image067
; (c) obtain a random dynamic positive integer pair (r, x) from a quasi-random random number sequence, digitized by a floating point number; (d) calculate the key
Figure 03_image069
; (e) obtained from another quasi-random random number sequence by digitizing the floating-point number
Figure 03_image071
,function
Figure 03_image073
.
如申請專利範圍第6項所述的真亂數產生之方法,其中,
Figure 03_image017
表示以質數 p 及 q 以
Figure 03_image019
所形成之集合,所以
Figure 03_image021
的選擇為選擇一質數 p,再從
Figure 03_image017
中選擇
Figure 03_image007
The method for generating the chaotic number as described in item 6 of the patent application scope, in which
Figure 03_image017
Expressed as prime numbers p and q
Figure 03_image019
The set formed, so
Figure 03_image021
Is to choose a prime number p, and then
Figure 03_image017
Choose
Figure 03_image007
.
如申請專利範圍第6項所述的真亂數產生之方法,其中,該浮點數數位化的方式為依照 IEEE754 格式,將取得浮點數拆分為 8Bytes,之選用第六個 Bytes 作為 r 的來源,利用 r 的大小來對應 x 的範圍,使得 x 的範圍侷限在
Figure 03_image015
The method for generating a messy number as described in item 6 of the patent application scope, wherein the digitizing method of the floating-point number is to split the obtained floating-point number into 8Bytes according to the IEEE754 format, and select the sixth Bytes as r The source of, using the size of r to correspond to the range of x, so that the range of x is limited to
Figure 03_image015
.
TW107141334A 2018-11-20 2018-11-20 True random number generators and true random number generation method TWI690847B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW107141334A TWI690847B (en) 2018-11-20 2018-11-20 True random number generators and true random number generation method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW107141334A TWI690847B (en) 2018-11-20 2018-11-20 True random number generators and true random number generation method

Publications (2)

Publication Number Publication Date
TWI690847B TWI690847B (en) 2020-04-11
TW202020656A true TW202020656A (en) 2020-06-01

Family

ID=71134326

Family Applications (1)

Application Number Title Priority Date Filing Date
TW107141334A TWI690847B (en) 2018-11-20 2018-11-20 True random number generators and true random number generation method

Country Status (1)

Country Link
TW (1) TWI690847B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112115508A (en) * 2020-09-07 2020-12-22 翰顺联电子科技(南京)有限公司 Random number generation method and device applied to block chain and random number generator

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7170997B2 (en) * 2000-12-07 2007-01-30 Cryptico A/S Method of generating pseudo-random numbers in an electronic device, and a method of encrypting and decrypting electronic data
US20040086117A1 (en) * 2002-06-06 2004-05-06 Petersen Mette Vesterager Methods for improving unpredictability of output of pseudo-random number generators
WO2009095902A2 (en) * 2008-01-31 2009-08-06 Densbits Technologies Ltd. Systems and methods for handling immediate data errors in flash memory
WO2009053961A2 (en) * 2007-10-25 2009-04-30 Densbits Technologies Ltd. Systems and methods for multiple coding rates in flash devices

Also Published As

Publication number Publication date
TWI690847B (en) 2020-04-11

Similar Documents

Publication Publication Date Title
Erkan et al. 2D eπ-map for image encryption
Akhshani et al. Pseudo random number generator based on quantum chaotic map
Volos et al. Image encryption process based on chaotic synchronization phenomena
Dabal et al. A chaos-based pseudo-random bit generator implemented in FPGA device
CN106778304A (en) A kind of quick New chaotic image encryption method with related scramble mechanism in plain text
CN103635874A (en) Method of providing a portable true random number generator based on microstructure and noise found in digital images
Hu et al. A true random number generator based on mouse movement and chaotic cryptography
AL-khatib et al. Acoustic lightweight pseudo random number generator based on cryptographically secure LFSR
TWI690847B (en) True random number generators and true random number generation method
Krishnamoorthi et al. A modernistic approach for chaotic based pseudo random number generator secured with gene dominance
Chen et al. A novel image encryption scheme based on PWLCM and standard map
AVAROĞLU et al. A novel S-box-based postprocessing method for true random number generation
Etem et al. Self-generated encryption model of acoustics
TWM574715U (en) True random number generator device
Wu et al. An iteration-time combination method to reduce the dynamic degradation of digital chaotic maps
Kumar et al. A novel image encryption scheme using Lorenz attractor
Loutfi et al. Smartphone sensors as random bit generators
Teh et al. A true random number generator based on hyperchaos and digital sound
Kadir et al. Randomness analysis of pseudorandom bit sequences
Chen et al. Audio random number generator and its application
Raza et al. PRaCto: Pseudo Random bit generator for Cryptographic application
CN102904715A (en) Parallel pseudorandom bit generator based on coupling chaotic mapping system
Kösemen et al. Designing a random number generator for secure communication with wisp
CN106375082B (en) A kind of pseudo random number production method
El Den et al. An Enhanced Pseudorandom Number Generator Based Differential Lorenz system by using Runge-Kutta method

Legal Events

Date Code Title Description
MM4A Annulment or lapse of patent due to non-payment of fees