TW580797B - Random number generator using audio card - Google Patents

Random number generator using audio card Download PDF

Info

Publication number
TW580797B
TW580797B TW92105156A TW92105156A TW580797B TW 580797 B TW580797 B TW 580797B TW 92105156 A TW92105156 A TW 92105156A TW 92105156 A TW92105156 A TW 92105156A TW 580797 B TW580797 B TW 580797B
Authority
TW
Taiwan
Prior art keywords
random number
value
length
random
number generator
Prior art date
Application number
TW92105156A
Other languages
Chinese (zh)
Other versions
TW200418266A (en
Inventor
Ming-Je Jang
Jian-Hung Chen
Geng-Hau Jang
Han-Jie Suen
Original Assignee
Chunghwa Telecom Co Ltd
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 Chunghwa Telecom Co Ltd filed Critical Chunghwa Telecom Co Ltd
Priority to TW92105156A priority Critical patent/TW580797B/en
Application granted granted Critical
Publication of TW580797B publication Critical patent/TW580797B/en
Publication of TW200418266A publication Critical patent/TW200418266A/en

Links

Abstract

A random number generator using audio card is disclosed, wherein the audio card widely installed on the personal computer or Unix workstation is used to extract the noise value in the microphone port as the primitive value of the random number sequence, and a procedure is performed to eliminate the concentrated distribution and the timing correlation in the noise signal, so as to obtain a real random number sequence with high quality. The principle of the present invention is based on the unpredictable property of the thermal noise in quantum mechanics. Thermal noise is extracted and used as the source of actual random number, and the characteristics of the hash algorithm such as scrambling/diffusion and compression in cryptography is utilized to relieve the concentrated distribution and the timing correlation in the noise value, and to greatly improve the statistical quality of the random number sequence. In addition, by using different sources of random number to form the random number sequence, the degree of difficulty in guessing the system random number can also be increased proportionally.

Description

發明所屬之技術領域、先前技術、內容 、實施方式及圖式簡單說明) 【發明所屬之技術領域】 本發明係關於一種利用音效卡的亂數產生器,特別是指一種利用個人 電腦或Unix工作站上的音效卡,擷取麥克風埠上的脅音值作為亂數序列的 原始值,再經過消除噪音訊號裡集中分佈與前後相關性之處理,以得到高 品質的真實亂數序列之亂數產生器。 【先前技術】 一個高品質的亂數產生器在許多應用系統上都扮演著十分重要的角 色,例如:保密安全系統、電腦遊戲、彩卷選取、系統模擬等。目前電腦 系統中所使用的亂數可分成兩類··以軟體演算法製作的虛擬亂數,以及利 用硬體上的隨機事件所軸之資料當作真魏數的麵。施亂數雖可擁 有若干統計分佈上的良好表現,但它在本質上屬於可預期的產出。特定的 初始值就產生特定的虛擬亂數值,其隨機性並不比某一自然數列好多少。 再者,不可預測的亂數在許多應用系統中都佔有關鍵性的地位,例如: 密碼演算所需的金鑰,即應具有無法預測的性質,才能確保系統的安全。 然而在一般電腦系統上所產生的亂數是採軟體演算法由給定的起始值算出 亂數值,這種看起來雜亂的數值卻是依序排列缺乏隨機性可言,以現在的 電腦效率已經可以在合理時間内完成分析並掌握其亂數之規律。真正隨機 產生而無任何規則性可供預測的亂數需要利用硬體來產生,例如使用電子 元件的熱雜訊當作亂數源,即是基於量子力學的測不準理論中電子自由運 動之不可預測性。然而要如何在一般電腦環境中收集電子元件上的熱雜訊 □續次頁(發明說明頁不敷使用時,請註記並使用續頁) 6 580797 卻非易事,-般是利用專屬的硬體插在Rs_232或USB阜,再透過驅動程 式擷取硬體產生的祕,但這麼做卻增加了硬體及安裝方面的成本及不 便。而有赛於高品質亂數在電腦系統中的日益重要,Intel公司於pentiumii 以後的版本也在CPU _L提供硬體產生的真魏數魏,然*它仍需要安裝 亂數驅動程式並加以設定,也有若干的不便之處。 由此可見,上述習用技術仍有諸多缺失,實非一良善之設計者,而亟待 加以改良。 本案發明人鑑於上述習用亂數產生方式所衍生的各項缺點,乃亟思加 以改良創新,並經多年苦心孤詣潛心研究後,終於成功研發完成本件利用 音效卡的亂數產生器。 【目的】 本發明之目的即在於提供一種利用音效卡的亂數產生器,係利用個人 電腦或Unix工作站上普遍裝設的音效卡,擷取麥克風阜上的噪音值作為亂 數序列的來源,無須另外安裝特定之驅動程式或進行任何設定,大為改善 了使用上的便利性且仍具備無可預測的硬體亂數品質,此外,在去除脅音 訊號的偏離性之處理上,採取理論及實驗分析所得之結果以設計後處理功 能,於最佳的亂數品質下兼顧系統之效能。 本發明之次一目的係在於提供一種利用音效卡的亂數產生器,係採取 無法預測的熱雜訊作為亂數原始值,再利用審慎設計的密碼學雜湊演算法 進行訊號的雜亂化,所得到的真實亂數序列在各種主要的隨機度評比指標 上都具備優良的表現。 續次頁(發明說明頁不敷使用時,請註記並使用續頁) 7The technical field to which the invention belongs, prior art, content, implementation, and drawings are briefly explained. [Technical field to which the invention belongs] The present invention relates to a random number generator using a sound card, and particularly to a personal computer or a Unix workstation The sound card on the card captures the bluffing sound value on the microphone port as the original value of the random number sequence, and then processes the centralized distribution and the back-and-forth correlation in the noise signal to obtain a high-quality random number generator of the random number sequence. . [Previous technology] A high-quality random number generator plays a very important role in many application systems, such as: security systems, computer games, color selection, system simulation, etc. The random numbers used in current computer systems can be divided into two categories: virtual random numbers made by software algorithms, and the data using random events on the hardware as the face of true Wei numbers. Although the chaos number can have some good performance in statistical distribution, it is essentially a predictable output. A specific initial value produces a specific virtual disorder value, and its randomness is not much better than a certain natural number sequence. Furthermore, unpredictable random numbers occupy a critical position in many application systems, such as: The keys required for cryptographic calculations should have unpredictable properties in order to ensure the security of the system. However, the random numbers generated on general computer systems are calculated by software algorithms from a given starting value. This kind of seemingly random values are arranged in order and lack randomness. At present computer efficiency It is already possible to complete the analysis and grasp the law of random numbers within a reasonable time. Random numbers that are generated randomly without any regularity to predict need to be generated by hardware. For example, the thermal noise of electronic components is used as the source of random numbers, which is the indispensability of free movement of electrons in the theory of uncertainty based on quantum mechanics. Predictive. However, how to collect the thermal noise on electronic components in a general computer environment? Continued page (When the description page of the invention is not enough, please note and use the continued page) 6 580797 It is not easy, usually using exclusive hardware The body is inserted in Rs_232 or USB, and then the secret generated by the hardware is retrieved through the driver, but this increases the cost and inconvenience of the hardware and installation. The high-quality random numbers are becoming increasingly important in computer systems. Intel Corporation's later versions of pentiumii also provide hardware-generated real Wei numbers. However, it still needs to install random number drivers and set them. There are also some inconveniences. It can be seen that there are still many shortcomings in the above-mentioned conventional technologies, and they are not a good designer. They need to be improved. In view of the various shortcomings derived from the conventional random number generation method described above, the inventor has been eager to improve and innovate. After years of painstaking research, he finally successfully developed this random number generator using a sound card. [Objective] The purpose of the present invention is to provide a random number generator using a sound effect card, which uses a sound effect card commonly installed on a personal computer or a Unix workstation to capture the noise value on the microphone as the source of the random number sequence. There is no need to install specific drivers or make any settings, which greatly improves the convenience in use and still has unpredictable quality of the hardware. In addition, in terms of removing the deviation of the threat signal, the theory and The results obtained from the experimental analysis are designed for post-processing functions to take into account the performance of the system under the best random number quality. A second object of the present invention is to provide a random number generator using a sound card, which uses unpredictable thermal noise as the original value of the random number, and then uses a carefully designed cryptographic hash algorithm to scramble the signal. The obtained real random number sequence has excellent performance on various main randomness evaluation indexes. Continued pages (note if the invention description page is insufficient, please note and use the continuation page) 7

本發明之另-目的係在於提供—種_音效卡的亂數產生器係利用. 512位元的單向雜湊演算法進行亂數序列的後處理作業不僅提高亂數的品· 質指標值’也消除了反向破解出原始噪音序列的可能。此外又讀取系統的 高解析度_值魏絲A錢行遮罩處理,伙滅數序_猜測困難 度。 可達成上述發明目的之利用音效卡的敗數產生器,係藉由下列原理達 成: 量子力學的測不準原理中電子自由運動之不可預測性,擷取熱雜訊以· 獲得隨機亂數之初始值;密碼學之雜函麵具制混淆、擴散及壓縮等 性質’以去除噪音訊號的偏離分佈情形。此外這種雜湊函式所具備的單向 性,亦可消除反向推算出原始噪音值的可能;結合數個不同的隨機亂數來 源以组成最終亂數序列,可以等比例提高系統亂數的猜測困難度。 就這些原理和若干實驗結果及其應用分述如下: 一、熱雜訊(Thermal Noise 或 White Noise): 熱雜訊是由J.BJ〇hnS〇n所發現的,也可稱為J〇hns〇n η〇&,此種雜— 訊源自於電阻性元件内部電子之隨機移動所產生,其強度與電阻的環境絕 對溫度成正比;這種雜訊之存在可由下列實驗得知··將一未連接任何電源 的一般電阻裝置在室溫環境中,這時候此電阻應是量測不到任何電壓值才 對,但不用直流電壓表而改以一精密的電子電壓表則可量測到存在著一隨 機之電壓值。這種熱雜訊依據量子力學的測不準原理,具有真正不可預測 的隨機性。 D續次頁(發明說明頁不敷使用時,請註記並使用續頁) 580797Another object of the present invention is to provide a kind of random number generator for sound cards. A 512-bit one-way hash algorithm for post-processing operations of random number sequences not only improves the quality and quality index values of random numbers. It also eliminates the possibility of reverse cracking the original noise sequence. In addition, we read the system's high-resolution _ value Wei Si A Qianxing mask processing, the number order _ guess difficulty. The defeat number generator using a sound card that can achieve the above-mentioned object of the invention is achieved by the following principles: Unpredictability of free movement of electrons in the uncertainty principle of quantum mechanics, capturing thermal noise to obtain random random numbers Initial value; Cryptography's miscellaneous masking features such as obfuscation, diffusion, and compression to remove deviations from noise signals. In addition, the one-way nature of this hash function can also eliminate the possibility of backward calculation of the original noise value; combining several different random random number sources to form the final random number sequence can increase the random number of the system in proportion. Difficulty guessing. These principles and several experimental results and their applications are described as follows: 1. Thermal Noise (Thermal Noise or White Noise): Thermal noise is discovered by J.BJ〇hnS〇n, also known as J〇hns 〇n η〇 & This kind of noise-originated from the random movement of the electrons inside the resistive element, its strength is proportional to the absolute temperature of the resistance environment; the existence of this noise can be known from the following experiments ... Place a general resistance device without any power supply at room temperature. At this time, the resistance should be measured without any voltage value, but it can be measured with a precision electronic voltmeter instead of a DC voltmeter. To the existence of a random voltage value. This thermal noise is based on the uncertainty principle of quantum mechanics and has truly unpredictable randomness. D Continued pages (If the invention description page is insufficient, please note and use the continuation page) 580797

熱雜訊一般可由如下公式表示·· K-2=4kTR(f) Af 2 其中《為熱雜訊所產生電壓降之平均平方值;k為波兹曼常數=1·抑 Κ’ Τ為絕對概度,f為響應的頻率;r(〇為光電元件之阻抗值, 一般為頻率之函數;Af為頻帶寬。 〇又R(f)為疋值’令R(f)=R,Af =B,則上式之雜訊可由一個等效電路 來代表,其中電壓源為熱雜訊=4kTRB=K?,或電_為y = 4KTB/R。 二、音效卡插上麥克風與與否對亂數值的影響: 分別測試:⑴不齡克風;(2)插上麥克風但無聲音輸人;⑶插上麥克 風但給予單調聲音輸人;⑷插上麥克風且給予富於變化的聲音輸入;等四 種情形進行輸人峨的亂數值分析,獲知岭⑷歸形所得的訊號最富隨 機性,接著是⑶及(2)的情形,最後才是⑴的情形。但這四者的差距不大, 尤其對於chi-square分佈的指標而言並無不同。 因此,本發明的設計可以忽略音效卡上是否有插麥克風這細素,但 卻需偵測音效卡的硬體是否失常而產生固㈣輸人訊號,因為在這種, 的狀況下所獲得的亂數序列就無法擁有良好的隨機性質。 三、雜湊函數之輸出/入長度對亂數值的影響: 一個亂數序列的熵值(Entropy)依據資訊理論中網的公式為: H = E[Pi*(-l〇g P〇] 即累計每一個可能輸出之機率乘上其負log值。於是可以猜想,是否愈 長的雜湊輸入值以及愈長的雜湊輸出值能夠改善亂數序列的品質。 □續次頁 (發明說明頁不敷使用時,請註記並使用續頁) 9 觀測本發明的亂數後處理程序中之雜湊函式在:(1)不同的輸入資料長产· (2)不同的輸出雜湊值長度;等兩種情形下對於亂數品質的影響。結果顯示, 輸入資料在超過某一長度(數個位元組)後對於亂數的品質並無顯著影響。然 而,不同的輸出雜湊值長度會影響亂數的熵值,越長的雜湊值得到越高的 熵值。但是雜湊值長度對於亂數序列的Chi Square分佈值而言,則無顯著 影響。因此,本發明可採用較長的雜湊函式進行亂數序列的後處理作業, 以獲得較佳的亂數品質。至於輸入資料的長度雖然在理論上增加其值可以 提昇亂數的隨機性,但通常於超過某一長度之後(因不同的作業系統及音效 卡設定而異)就不會有顯著的改進效果了。而在實務設計上,輸入資料的長 度通常也不會小到對亂數品質有影響的程度。故對於雜湊函數的輸入資料 長度,應該在滿足系統效能需求的情形下盡量增加其值。 【較佳實施例】 本發明利用音效卡以產製高品質的亂數序列,產製過程可分為兩個程 序,即熱雜訊擷取程序與亂數值後處理程序。熱雜訊擷取程序利用普遍裝 置於個人電腦或工作站上的音效卡,在不需插上麥克風的情況下讀取聲音· 訊號,並判斷輸入訊號之正常與否。後處理程序則將這些熱雜訊進行去偏 離化處理,以獲得高品質且無可預測的亂數序列。 一、熱雜訊擷取程序: 首先從音效卡讀取某一資料長度的聲音訊號, INaud = ReadMicrophone(INPUT—BUFFER—SIZE) INaud表示輸入音效卡的噪音值,jNpux^BUFFEi^SKE則為每次讀取 的資料長度,可在系統安裝之時設定,其最大值需視系統產生最終亂數的 D續次頁(發明說明頁不敷使用時,請註記並使用續頁) 580797Thermal noise is generally expressed by the following formula: K-2 = 4kTR (f) Af 2 where “is the average squared value of the voltage drop generated by thermal noise; k is the Boltzmann constant = 1. Probability, f is the frequency of the response; r (0 is the impedance value of the optoelectronic element, generally a function of frequency; Af is the frequency bandwidth. 〇R (f) is the value of '' Let R (f) = R, Af = B, the noise of the above formula can be represented by an equivalent circuit, where the voltage source is thermal noise = 4kTRB = K ?, or electrical_ is y = 4KTB / R. 2. Whether the sound card is plugged into the microphone or not The influence of random values: Test separately: ⑴ indecent grammar; (2) plug in the microphone but no sound is input; ⑶ plug in the microphone but give a monotonous sound input; ⑷ plug in the microphone and give a rich sound input; Let ’s wait for four cases to perform random numerical analysis of people ’s losses, and learn that the signal obtained by the ridge reduction is the most random, followed by the cases of ⑶ and (2), and finally the case of ⑴. But the difference between the four is not Large, especially for the index of chi-square distribution. Therefore, the design of the present invention can ignore whether there is a microphone inserted on the sound card. This is fine, but it is necessary to detect whether the hardware of the sound card is abnormal and generate a fixed input signal, because the random number sequence obtained under this condition cannot have good random properties. 3. Hash function The effect of the input / output length on the random value: The entropy value of an random number sequence according to the net theory in information theory is: H = E [Pi * (-l〇g P〇) that accumulates every possible output The probability is multiplied by its negative log value. So you can guess whether the longer hash input value and the longer hash output value can improve the quality of the random sequence. □ Continued page (when the invention description page is insufficient, please note And use the continuation page) 9 Observe the hash function in the random number post-processing program of the present invention in: (1) different input data is produced long; (2) different output hash value length; The effect of quality. The results show that after the input data exceeds a certain length (several bytes), there is no significant effect on the quality of the random number. However, the different output hash value length will affect the entropy of the random number, the longer The higher the entropy of the hash value However, the length of the hash value has no significant effect on the Chi Square distribution value of the random number sequence. Therefore, the present invention can use a longer hash function to perform the post-processing operation of the random number sequence to obtain a better random number. Quality. Although the length of the input data can theoretically increase the randomness of random numbers, it usually does not have a significant improvement after it exceeds a certain length (different due to different operating systems and sound card settings). Effect. In practice design, the length of the input data is usually not small enough to affect the quality of the random number. Therefore, the length of the input data of the hash function should be increased as much as possible while meeting the system performance requirements. [Preferred Embodiment] The present invention uses a sound effect card to produce a high-quality random number sequence. The production process can be divided into two programs, namely, a thermal noise acquisition program and a random value post-processing program. The thermal noise acquisition program uses sound cards commonly installed on personal computers or workstations to read sounds and signals without plugging in a microphone, and determines whether the input signals are normal or not. The post-processing program depolarizes these thermal noises to obtain high-quality and unpredictable random numbers. I. Thermal noise acquisition procedure: First read the sound signal of a certain data length from the sound card, INaud = ReadMicrophone (INPUT—BUFFER—SIZE) INaud represents the noise value of the input sound card, jNpux ^ BUFFEi ^ SKE is every The length of the data read each time can be set at the time of system installation. The maximum value depends on the system's final random number of D continuation pages (if the description page of the invention is insufficient, please note and use the continuation page) 580797

速率需求而定,最小值則視麥克風訊號的變化週期及亂數後處理的雜湊函 式長度而定,決定長度的原則是,若音效卡上的訊號在某一取樣長度下沒 有足夠的變化型態,則這個長度應定為INPUT_BUFFER_SIZE的最小值以 求取亂數之隨機性,且這個最小值也應大於亂數後處理的雜湊函式長度; 但是INPUT一BUFFER一SIZE愈大則系統產生亂數序列的速度也就愈慢,於 是須在這兩個因素之間作一個權衡以定出適當的INPUT_BUFFER_SIZE, 需要愈多的隨機性之應用系統可增加INPUTJBUFFER-SIZE,而講求系統The minimum value depends on the change period of the microphone signal and the length of the hash function for random post-processing. The principle for determining the length is that if the signal on the sound card does not have sufficient variation under a certain sampling length State, the length should be set to the minimum value of INPUT_BUFFER_SIZE to obtain randomness of random numbers, and this minimum value should also be greater than the length of the hash function after random numbers are processed; The speed of the number sequence is also slower, so a trade-off must be made between these two factors to determine the appropriate INPUT_BUFFER_SIZE. An application system that requires more randomness can increase the INPUTJBUFFER-SIZE.

執行效能者則採取最小值。亦即: 512 bits ^ INPUT一BUFFER SIZE $ INPUT—BUFFER—SIZE for minimum RNG speedPerformers take the minimum. That is: 512 bits ^ INPUT_BUFFER SIZE $ INPUT—BUFFER—SIZE for minimum RNG speed

為了幫助使用者在安裝本亂數產生器系統時,能有效的設定 INPUT一BUFFER一SIZE值,本發明提供一個麥克風訊號分析的工具程式, 以利於安裝過程中找出最佳的INPUTJBUFFER-SIZE值;這個工具是參考 麥克風輸入訊號的Entropy值,連續測試不同的讀取長度(從64測試到256 位元組’以32位元組為增加之單位)所產生的Entropy值,然後找出可在較 短之讀取長度下製造最大Entropy值的INPUTJ3UFFERJSIZE當作參數, 並寫入系統的組態設定檔;如果系統在此一讀取長度設定下執行效能太 慢,則使用者可以自行編輯此一組態設定檔,減少INPUT_BUFFER_SIZE 值以獲得所需的執行效能。 在系統初次執行讀取這些輸入訊號時,將進行一個訊號值的分析以判 斷麥克風是否處於正常狀況而能提供隨機的熱雜訊,以免因為音效卡硬體 的故障造成亂數品質的低劣;判斷的方法則以訊號之前後相關性為依據, □續次頁(發明說明頁不敷使用時,請註記並使用續頁) 11 580797In order to help the user to effectively set the INPUT_BUFFER_SIZE value when installing the random number generator system, the present invention provides a microphone signal analysis tool program to facilitate finding the best INPUTJBUFFER_SIZE value during the installation process. ; This tool refers to the Entropy value of the microphone input signal, and continuously tests the Entropy value generated by different read lengths (from 64 tests to 256 bytes' in increments of 32 bytes), and then finds the INPUTJ3UFFERJSIZE, which produces the largest Entropy value under a shorter read length, is used as a parameter and written into the system's configuration profile; if the system performs too slowly under this read length setting, the user can edit this one by himself Configure the profile and reduce the value of INPUT_BUFFER_SIZE to achieve the required execution performance. When the system reads these input signals for the first time, a signal value analysis will be performed to determine whether the microphone is in a normal state and can provide random thermal noise, so as to avoid the poor quality of random numbers caused by the failure of the sound card hardware; judgment The method is based on the correlation before and after the signal. □ Continued on the next page (if the description page of the invention is insufficient, please note and use the continued page) 11 580797

右INaud的相關係數(Serial correlation coefficient)絕對值大於〇·9則應視為硬 體故障,系統傳回相對的錯誤訊息並終止執行;若相關係數的絕對值介於 〇·7和0.9之間,則繼續讀取更多樣本訊號以進一步判別之。 輸入噪曰值的相關係數 INscc = ComputeCiorTelatiaiiClaeffideiit (INaud),若持續取樣所獲得的相關係數絕對值都是介於〇.7和〇.9之間,則 系統在取樣測試5次之後即傳回錯誤訊息並終止執行。 二、亂數值之後處理: 亂數後處理程序利用密碼學中的雜湊演算法所具有的混淆、擴散及壓 j 縮等特性,以解除噪音輸入值之集中分佈與前後相關性,並可大幅改進亂 數序列統計上的品質。The absolute value of the right correlation coefficient (Serial correlation coefficient) greater than 0.9 should be considered a hardware failure, the system returns a relative error message and terminates the execution; if the absolute value of the correlation coefficient is between 0.7 and 0.9 , Continue to read more sample signals for further discrimination. The correlation coefficient INscc = ComputeCiorTelatiaiiClaeffideiit (INaud) of the input noise value. If the absolute value of the correlation coefficient obtained by continuous sampling is between 0.7 and 0.9, the system returns an error after 5 sampling tests. Message and terminate execution. Second, post-processing of random values: The post-processing program of random numbers uses the characteristics of confusion, diffusion, and compression in hash algorithms in cryptography to eliminate the centralized distribution of noise input values and the front-back correlation, and can greatly improve Statistical quality of random numbers.

Outhash = SHA—512 (INaud)Outhash = SHA—512 (INaud)

Outhash表示經過SHA1的512位元雜湊演算法運算之後所得之亂數輸出 值,輸入訊號的INaud長度不應小於512位元,以免降低〇uthash輸出值的隨 機度。此外為了增加亂數序列的猜測難度,另行讀取系統的高解析度時間,Outhash indicates the random number output value obtained after the 512-bit hash algorithm operation of SHA1. The INaud length of the input signal should not be less than 512 bits, so as to avoid reducing the randomness of the output value of 0uthash. In addition, in order to increase the difficulty of guessing the random number sequence, the high-resolution time of the system is read separately.

僅取秒以下的數值進行SHA-1運算。Only SHA-1 is used for values below the second.

Timehash = SHA—1 (SysTimehigh一res) 此時將系統秒以下的高解析度時間SysTimehigh-res進行SHA-1運算,取 得160bit的雜湊值Timehash再與前面所得的Outhash作X〇R運算處理,這個 XOR運算並不作資料的填充(padding)處理。Timehash = SHA—1 (SysTimehigh_res) At this time, the high-resolution time SysTimehigh-res below the system second is subjected to SHA-1 operation to obtain a 160-bit hash value Timehash and then X0R calculation processing with Outhash obtained previously. The XOR operation does not pad the data.

RandomOutput = Outhash XOR Timehash 因此本亂數產生器利用音效卡上的熱雜訊所產生的亂數輸出值長度達 512位元,如果仍不足應用系統所需亂數的長度,則應用系統僅需重複呼叫 ]續次頁(發明說明頁不敷使用時,請註記並使用續頁) 12 580797RandomOutput = Outhash XOR Timehash. Therefore, the random number generator uses the thermal noise on the sound card to generate a random output value length of 512 bits. If the random number length is not enough for the application system, the application system only needs to repeat Call] Continued pages (Notes on the use of continuation pages when the invention description page is insufficient) 12 580797

本亂數產生器,即可獲得所需的亂數長度。一般而言這個輸出值會具有如 下的亂數品質指標:This random number generator can obtain the required random number length. Generally speaking, this output value will have the following random quality indicators:

Entropy 值 Chi square 分佈之亂數預 測值 算術平均值 Monte Carlo 圓周率 相關係數 約98% 25 〜75% 97 〜99% 正確率 0. 5^4.0% 錯誤率 約 0·01 上述的Entropy值指出亂數的資訊密集度,理論上愈趨近於100%代表 愈少重複多餘的資訊,也就是愈具有理想的雜亂度;Chi square分佈之亂數 預測值可用以分辨某亂數序列是屬於可預期的虛擬亂數序列,或是屬於難 以預測的真實亂數輸出,如果算出的Chi square預測值大於99%或小於 1%,則表示此亂數序列幾可確定為非隨機性輸出,若其值介於95%和99% 之間或是介於1°/。和5%之間,則亂數序列也是不夠隨機的,較理想的Chi square預測值應介於10%到90%之間,大量地比較虛擬亂數序列與硬體真 實亂數序列所測得的Chi square值,證實Chi square分佈之亂數預測值適於· 作為區別虛擬亂數的指標。本發明產製的亂數序列,其chi square預測值在 25〜75%之間,亦即具有隨機的不可預測性。 本發明產生亂數序列的作業流程可分為:熱雜訊擷取及亂數值之後處 理兩讎序。此外還有設定系統每次讀取麥克風訊號長度的作業。兹分述 其流程如下: 一、麥克風訊號讀取長度之設定流程(如圖一所示): 續次頁(發明說明頁不敷使鱗,請註記雌臓頁) 13 580797Entropy value Chi square distribution of random numbers Predicted values Arithmetic mean Monte Carlo Peripheral correlation coefficient is about 98% 25 ~ 75% 97 ~ 99% Accuracy rate 0.5 54.0% Error rate approx. 0.01 The above Entropy value indicates random numbers The theoretical density of information, the closer it is to 100% in theory, the less repeated redundant information, that is, the more ideal the degree of clutter; the predicted value of the random number of the Chi square distribution can be used to distinguish that a random number sequence is predictable. Virtual random number sequence, or real random number output that is difficult to predict. If the calculated Chi square predicted value is greater than 99% or less than 1%, it means that the random number sequence can be determined as a non-random output. Between 95% and 99% or between 1 ° /. And 5%, the random number sequence is not sufficiently random. The ideal Chi square prediction value should be between 10% and 90%. A large number of virtual random number sequences are compared with hardware real random number sequences. The value of Chi square confirms that the predicted value of the random number of the Chi square distribution is suitable as an index to distinguish the virtual random number. The random number sequence produced by the present invention has a chi square prediction value between 25 and 75%, that is, it has random unpredictability. The operation flow for generating random number sequences according to the present invention can be divided into two sequences: thermal noise acquisition and random value processing. There is also the operation of setting the system to read the length of the microphone signal each time. The process is as follows: 1. The setting process of the microphone signal reading length (as shown in Figure 1): Continued page (the description page of the invention is insufficient, please note the female page) 13 580797

1·執行迴圈以紀錄麥克風雜訊的Entropy值,讀取長度從64到256位元組, 每次增加32位元組; 2·依給定長度讀取麥克風訊號三次,計算其Entropy的平均值和加權值, 權值的算法為,W = E+17/ L。其中的E表示Entropy平均值,L表示 讀取訊號長度;紀錄這些數據於資料結構中; 3·從所有的分析紀錄中找到加權值最大的3筆,依照遞減次序寫入系統組 態檔;寫入格式為:L=dd,E=d.dd,W=d。(d表示數字)1. Perform a loop to record the Entropy value of the microphone noise, read the length from 64 to 256 bytes, and increase 32 bytes each time; 2. Read the microphone signal three times according to the given length, and calculate its average Entropy Value and weighted value, the weighting algorithm is, W = E + 17 / L. Among them, E means the average value of Entropy, and L means the length of the read signal. Record these data in the data structure. 3. Find the 3 most weighted values from all analysis records and write them to the system configuration file in descending order; write The input format is: L = dd, E = d.dd, W = d. (D represents a number)

二、熱雜訊擷取流程(如圖二所示)·· 1·如果是第一次被呼叫,讀取系統組態設定檔以獲得 INPUT一BUFFER一SIZE 值; 2·依據系統組態檔的訊號輸入長度,讀取麥克風上的熱雜訊inaud = ReadMicrophone(INPUT_BUFFER_SIZE);如果是第一次執行亂數產生函 式,則需執行3·以進行麥克風硬體狀態之分析,否則跳至4.;Second, the thermal noise acquisition process (as shown in Figure 2) ·· 1 · If it is the first time to call, read the system configuration configuration file to obtain the INPUT_BUFFER_SIZE value; 2 · According to the system configuration file Signal input length, read the thermal noise on the microphone inaud = ReadMicrophone (INPUT_BUFFER_SIZE); If this is the first time that the random number generation function is executed, you need to perform 3 · to analyze the microphone hardware status, otherwise skip to 4 .;

3·計算輸入訊號值的相關係數絕對值,若其值大於〇·9則應視為硬體故障, 系統傳回相對的錯誤訊息並終止執行; INscc = ComputeCorrelationCoefficient(INAUD);3. Calculate the absolute value of the correlation coefficient of the input signal value. If the value is greater than 0.9, it should be regarded as a hardware failure. The system returns a relative error message and terminates the execution; INscc = ComputeCorrelationCoefficient (INAUD);

If (INscc >= 0.9) return HW ERROR ;If (INscc > = 0.9) return HW ERROR;

If(0.7<INSCC<0.9){TRY-NO ++ ; If (TRY—NO > 5) return HW—ERROR ; GOTO 步驟 3 ; }; 若相關係數的絕對值介於0.7和〇·9之間,則繼續讀取更多樣本訊 號以進一步判別硬體狀態;低於〇·7的絕對值則屬於硬體正常的狀態, 0續次頁(發明說明頁不敷使用時,請註記並使用續頁) 14 580797If (0.7 < INSCC < 0.9) {TRY-NO ++; If (TRY-NO > 5) return HW_ERROR; GOTO step 3;}; if the absolute value of the correlation coefficient is between 0.7 and 0.9 Time, continue to read more sample signals to further determine the state of the hardware; absolute values below 0 · 7 belong to the normal state of the hardware, 0 continued pages (when the invention description page is insufficient, please note and use Continued) 14 580797

通過音效卡之賴’並標科態關_標。若觸取樣所獲得的 相關係數絕對值都是介於0.7和〇.9之間,系統在取樣測試5次之後即 傳回錯誤訊息並終止執行; 4·儲存輸入訊號值,完成熱雜訊操取程序。 三、亂數後處理(如圖三所示): 1·计真熱雜訊資料的SHA-1 512bit雜湊函式值:Pass through the effects of the sound card ’and mark the status _ mark. If the absolute value of the correlation coefficient obtained by touch sampling is between 0.7 and 0.9, the system will return an error message and terminate the execution after 5 sampling tests; 4. Store the input signal value and complete the thermal noise operation Take the program. 3. Random number post-processing (as shown in Figure 3): 1. SHA-1 512bit hash function value for calculating real thermal noise data:

Outhash = SHA_512 (INaud);Outhash = SHA_512 (INaud);

2.讀取系統的高解析度時間,僅取秒以下的數值,進行8^_丨運算;這個 秒以下的高解析度時間,在Unix上可達到_sec〇nd而系統 也可達到millisecond的精確度;2. Read the high-resolution time of the system, and only take the value below the second for 8 ^ _ 丨 calculation; the high-resolution time below this second can reach _sec〇nd on Unix and the system can also reach millisecond Accuracy;

Timehash = SHA—l (SysTimehigh_res); 3.將步驟1.的雜湊值與步驟2.所得之高解析度時間的雜凑值作x〇r運 鼻’ 個運算並不作資料的填充(padding)處理;Timehash = SHA—l (SysTimehigh_res); 3. Use the hash value of step 1. and the hash value of the high-resolution time obtained in step 2. as x〇r operation, and do not pad the data. ;

RandomOutput = Outhash XOR Timehash ;RandomOutput = Outhash XOR Timehash;

4.清除輸入訊號值,將步驟3.所得結果當作輸出值傳回;完成亂數後處理 程序。 本發明之較佳之實例: 本發明之亂數產生器可應用於SSL伺服器的握手協商及金鑰產製程序 中’以滿足亂數產生器的速率及品質上之要求。其程序如下: SSL伺服器 續次頁(發明說明頁不敷使用時,請註記並使用續頁) 15 5807974. Clear the input signal value and return the result obtained in step 3. as the output value; complete the random post-processing procedure. A preferred example of the present invention: The random number generator of the present invention can be applied to the handshake negotiation and key production procedure of an SSL server to meet the requirements on the speed and quality of the random number generator. The procedure is as follows: SSL server Continued page (If the description page is insufficient, please note and use the continuation page) 15 580797

步驟一: 接收客戶端傳至的Hello訊息; ClientHello ◄- 步驟二: 因為是SSL伺服器第一次執行音效卡亂數功能,需讀取系統組態設定 檔以獲得INPUTJBUFFEI^SIZE參數值;Step 1: Receive the Hello message from the client; ClientHello ◄- Step 2: Because this is the first time that the SSL server performs the random number function of the sound card, you need to read the system configuration settings file to obtain the INPUTJBUFFEI ^ SIZE parameter value;

步驟三: 系統呼叫音效卡亂數產生器的熱雜訊擷取功能 INaud = ReadMicrophone(INPUT一BUFFER一SIZE); 步驟四: 因為是第一次執行音效卡亂數功能,需計算訊號的相關係數絕對值以 判斷硬體狀態相關係數絕對值;Step 3: The system calls the thermal noise capture function of the sound card random number generator INaud = ReadMicrophone (INPUT_BUFFER_SIZE); Step 4: Because this is the first time that the sound card random number function is performed, the correlation coefficient of the signal needs to be calculated Absolute value to determine the absolute value of the hardware state correlation coefficient;

INscc = ComputeCorrelationCoefficient(INAUD);INscc = ComputeCorrelationCoefficient (INAUD);

If (INscc >= 0.9) return HW一ERROR;If (INscc > = 0.9) return HW_ERROR;

If(0.7< INscc <0.9) { TRY—NO ++;If (0.7 < INscc < 0.9) {TRY—NO ++;

If (TRY NO > 5) return HW^ERROR; GOTO步驟三; } 設定硬體檢驗旗標; 續次頁(發明說明頁不敷使用時,請註記並使用續頁) 580797If (TRY NO > 5) return HW ^ ERROR; GOTO step three;} Set the hardware inspection flag; Continued page (If the description page of the invention is insufficient, please note and use the continued page) 580797

步驟五: 計算熱雜訊資料的SHA-l 512bit雜凑函式值 Outhash = SHA一512 (INaud); 步驟六: 讀取系統秒以下的高解析度時間,進行運算,取得16〇恤的雜 湊值Step 5: Calculate the SHA-l 512-bit hash function value of the thermal noise data. Outhash = SHA-512 (INaud); Step 6: Read the high-resolution time below the system second and perform the operation to obtain a hash of 16 shirts. value

Timehash= SHA—1 (SysTimehigh res), 步驟七: 將步驟四的訊號雜湊值與步驟五所得之高解析度時間的雜湊值作 XOR運算,在此不作資料的長度填充處理;Timehash = SHA—1 (SysTimehigh res), Step 7: Perform the XOR operation on the hash value of the signal in step 4 and the hash value of the high-resolution time obtained in step 5, and do not perform data length padding processing here;

RandomOutput = Outhash XOR Timehash ; 步驟八:RandomOutput = Outhash XOR Timehash; Step 8:

ServerHello.random = RandomOutput ί 接著SSL伺服器以步驟六所得之亂數值組成回應的Hello訊息,回傳 給客戶端。 SSL伺服器ServerHello.random = RandomOutput ί Then the SSL server composes a Hello message in response with the random value obtained in step 6 and returns it to the client. SSL server

ServerHelloServerHello

ServerHelloDone □續次頁 (發明說明頁不敷使用時,請註記並使用續頁) 17ServerHelloDone □ Continued page (If the description page is insufficient, please note and use the continued page) 17

本發明所提供之_音效卡的亂數產生器,與其他制技術相互比較 時’更具有下列之優點·· 本發明利用音效卡的亂數產生器,係利用個人電腦或此匕工作站 上普遍裝設的音效卡,娜麥克風阜上的噪音值作舰數序列的來源,無 須另外文裝特定之驅動程式或進行任何設定,大為改善了使用上的便利性 且仍具備無可腳彳的硬齡數品f,此外,在去_音誠的性之處 理上’採取理論及實驗分析所得之結絲設計後處理魏,於最佳的亂數 品質下兼顧系統之效能。 二、本發明利用音效卡的亂數產生器,係採取無法預測的熱雜訊作為 亂數原始值,再利用審慎設計的密碼學雜湊演算法進行訊號的雜胤化,所 得到的真實亂數序列在各種主要的隨機度評比指標上都具備優良的表現。 二、本發明利用音效卡的亂數產生器,係利用512位元的單向雜湊演 算法進行亂數序列的後處理作業,不僅提高亂數的品質指標值,也消除了 反向破解出原始噪音序列的可能。此外又讀取系統的高解析度時間值與亂 數輸出值進行遮罩處理,更增加亂數序列的猜測困難度。 上列詳細說明係針對本發明之一可行實施例之具體說明,惟該實施例 並非用以限制本發明之專利範圍,凡未脫離本發明技藝精神所為之等效實 施或變更,均應包含於本案之專利範圍中。 綜上所述,本案不但在技術思想上確屬創新,並能較習用物品增進上 述多項功效’應已充分符合新穎性及進步性之法定發明專利要件,爰依法 提出申請’懇請貴局核准本件發明專利申請案,以勵發明,至感德便。 []續次頁(發明說明頁不敷使用時,請註記並使用續頁)The random number generator of the sound effect card provided by the present invention has the following advantages when compared with other manufacturing technologies. The random number generator of the sound effect card of the present invention is generally used on a personal computer or the workstation. The installed sound effect card, the noise value on the microphone of Na is used as the source of the ship number sequence, there is no need to install a specific driver or make any settings, which greatly improves the convenience of use and still has no fetters Hard-aged number f, in addition, in the treatment of _ Yincheng's sexuality ', we adopt the knot design obtained after theoretical and experimental analysis to process Wei, taking into account the performance of the system under the best random number quality. 2. The present invention uses a random number generator of a sound card, which uses unpredictable thermal noise as the original value of the random number, and then uses a carefully designed cryptographic hash algorithm to hash the signal. The real random number obtained is Sequences have excellent performance on various major randomness evaluation indicators. 2. The present invention uses a random number generator of a sound card to perform a post-processing operation of a random number sequence using a 512-bit one-way hash algorithm, which not only improves the quality index value of the random number, but also eliminates the reverse cracking of the original Noise sequence possible. In addition, the high-resolution time value and random number output value of the system are read for mask processing, which further increases the difficulty of guessing the random number sequence. The above detailed description is a specific description of a feasible embodiment of the present invention, but this embodiment is not intended to limit the patent scope of the present invention. Any equivalent implementation or change that does not depart from the technical spirit of the present invention should be included in Within the scope of the patent in this case. In summary, this case is not only technically innovative, but also enhances the above-mentioned multiple effects over conventional items. 'It should have fully met the requirements for novel and progressive statutory invention patents. Apply according to law' and ask your office to approve this. Application for invention patents, to encourage invention, to the utmost. [] Continued pages (Please note and use continuation pages when the invention description page is insufficient.)

【圖式簡單說明】 月參閱以下有關本發明_較佳實施例之詳細說明及其附圖,將可進一 步瞭解本發明之技術内容及其目的功效;有_實施例之附圖為: 圖-為本發明利用音效卡的亂數產生器之麥克風訊號讀取長度設定流 程圖; 圖一*為該利用曰效卡的亂i數產生|§之熱雜訊操取與判斷流程圖;以及 圖三為該利用音效卡的亂數產生器於亂數序列之後處理流程圖。[Brief description of the drawings] With reference to the following detailed description of the preferred embodiment of the present invention and the accompanying drawings, the technical content of the present invention and its purpose and effect can be further understood; the drawings of the embodiments are: Figure- FIG. 1 is a flowchart of setting a microphone signal reading length of a random number generator using a sound effect card according to the present invention; FIG. 1 * is a flowchart of thermal noise manipulation and judgment of the random number generation using the effect card; The third is a flowchart of processing the random number generator using the sound card after the random number sequence.

Claims (1)

580797 申請專利範圍 1. 一種_音效卡數產生器,係音效卡上的熱雜誠產生高品 質亂數序列之方法,其架構包含-普遍裝設於個人電腦與Unk工作站 上的音效卡、麥克風訊號擷取介面、本亂數產生器之函式庫以及一個 叹定麥克風讀取訊號長度的工具程式;產製亂數的流程可分為前處理 之熱雜訊擷取與分析及亂數序列之後處理兩部分。 2·如申请專利範圍第,項所述之利用音效卡的亂數產生器,其中該前處| 理程序,包括讀取熱雜訊長度之設定方法以及麥克風硬體可用狀態的 判斷方法,熱雜訊之讀取長度須設定為可在系統要求的執行效能下達 成最佳的亂數品質;硬體可用狀態之判斷方法是採取訊號之前後相關 性為依據,可以避免因為音效卡硬體之故障而造成亂數品質的低劣。 3·如申請專利範圍第1項所述之利用音效卡的亂數產生器,其中該後處 理程序,包括512位元單向雜湊函式之選用、亂數序列結合系統高解 析度時間等處理步驟;選取較長的雜湊值係基於理論與實驗分析所獲g 結果,可提高亂數序列之熵值;而結合作業系統的高解析度時間以組 成最終亂數序列,則可等比例提高亂數序列的猜測困難度。 4·如申請專利範圍第1項所述之利用音效卡的亂數產生器,其中該設定 麥克風讀取訊號長度的工具程式,其訊號分析及評比之流程與設定, 可找出在較短讀取長度下製造較大熵值的參數。 20580797 patent application scope 1. A sound card number generator, a method for generating high-quality random number sequences on the sound card, its architecture includes-sound cards and microphones commonly installed on personal computers and Unk workstations Signal acquisition interface, the library of the random number generator and a tool program to determine the length of the signal read by the microphone; the process of producing random numbers can be divided into the pre-processing thermal noise acquisition and analysis and random number sequence Two parts are processed afterwards. 2. The random number generator using a sound card as described in item 1 of the scope of patent application, wherein the pre-processing procedure includes a method for reading the length of the thermal noise and a method for judging the usable state of the microphone hardware. The read length of the noise must be set to achieve the best random number quality under the performance required by the system; the method of determining the hardware availability status is based on the correlation between the signals before and after, which can avoid the problem caused by the sound card hardware. Malfunction caused poor quality of random numbers. 3. The random number generator using a sound effect card as described in item 1 of the scope of the patent application, wherein the post-processing program includes the selection of a 512-bit one-way hash function, the random number sequence combined with the high-resolution time of the system, and other processing Steps: Selecting a longer hash value is based on the g and theoretical and experimental analysis results, which can increase the entropy of the random number sequence; while combining the high-resolution time of the operating system to form the final random number sequence, the random number can be increased in proportion. The difficulty of guessing a sequence of numbers. 4. The random number generator using a sound card as described in item 1 of the scope of patent application, wherein the tool program for setting the microphone to read the signal length, and the signal analysis and evaluation process and settings can be found in a short reading Take the parameter that produces a larger entropy at length. 20
TW92105156A 2003-03-11 2003-03-11 Random number generator using audio card TW580797B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW92105156A TW580797B (en) 2003-03-11 2003-03-11 Random number generator using audio card

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW92105156A TW580797B (en) 2003-03-11 2003-03-11 Random number generator using audio card

Publications (2)

Publication Number Publication Date
TW580797B true TW580797B (en) 2004-03-21
TW200418266A TW200418266A (en) 2004-09-16

Family

ID=32924617

Family Applications (1)

Application Number Title Priority Date Filing Date
TW92105156A TW580797B (en) 2003-03-11 2003-03-11 Random number generator using audio card

Country Status (1)

Country Link
TW (1) TW580797B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102083271B1 (en) * 2012-07-31 2020-03-02 삼성전자주식회사 Flash memory system generating random number using physical characteristic of flash memory and random number generating method thereof

Also Published As

Publication number Publication date
TW200418266A (en) 2004-09-16

Similar Documents

Publication Publication Date Title
Yalçin et al. True random bit generation from a double-scroll attractor
TW580797B (en) Random number generator using audio card
Raj et al. Reconfigurable color medical image encryptor using hardware accelerated Chao (S)-box triplets
Abood et al. Securing audio transmission based on encoding and steganography
Hanley et al. Unknown plaintext template attacks
CN115686437A (en) Random number generation method and device, computer equipment and storage medium
Zhu et al. Fragility analysis of adaptive quantization-based image hashing
Zhang et al. An efficient retrieval algorithm of encrypted speech based on inverse fast Fourier transform and measurement matrix
Shanmugapriya et al. Virtual key force—a new feature for keystroke
Aydin et al. Exposing side-channel leakage of seal homomorphic encryption library
Kumar et al. Towards an approach for improved security in wireless networks
Sivakumar et al. Generation of random key stream using word grid puzzle for the applications of cryptography
Teh et al. A true random number generator based on hyperchaos and digital sound
L’Ecuyer Random numbers
Bardis et al. True random number generation based on environmental noise measurements for military applications
Chen et al. Audio random number generator and its application
TWI690847B (en) True random number generators and true random number generation method
Gaeini et al. A General Evaluation Pattern for Pseudo Random Number Generators
Zhu et al. A study on the randomness measure of image hashing
Wang et al. Single-Trace Side-Channel Attacks on CRYSTALS-Dilithium: Myth or Reality?
Ye et al. An improved digital watermarking algorithm for meaningful image
Tong et al. A novel image encryption scheme based on feedback and 3D Baker
Yang et al. Implementation of software random number generator based on ShangMi algorithm
Guarnizo et al. Portable percussion MIDI controller
WO2021237538A1 (en) Apparatus and method for generating random numbers

Legal Events

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