CN113157250A - True random number generation method based on power supply - Google Patents

True random number generation method based on power supply Download PDF

Info

Publication number
CN113157250A
CN113157250A CN202110569608.6A CN202110569608A CN113157250A CN 113157250 A CN113157250 A CN 113157250A CN 202110569608 A CN202110569608 A CN 202110569608A CN 113157250 A CN113157250 A CN 113157250A
Authority
CN
China
Prior art keywords
microcontroller
random number
unit
data
power supply
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110569608.6A
Other languages
Chinese (zh)
Inventor
徐正昊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Beibeidian Technology Co ltd
Original Assignee
Guangdong Beibeidian Technology 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 Guangdong Beibeidian Technology Co ltd filed Critical Guangdong Beibeidian Technology Co ltd
Priority to CN202110569608.6A priority Critical patent/CN113157250A/en
Publication of CN113157250A publication Critical patent/CN113157250A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F7/00Methods or arrangements for processing data by operating upon the order or content of the data handled
    • G06F7/58Random or pseudo-random number generators
    • G06F7/588Random number generators, i.e. based on natural stochastic processes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Mathematical Optimization (AREA)
  • Pure & Applied Mathematics (AREA)
  • Mathematical Analysis (AREA)
  • Computational Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • Software Systems (AREA)
  • Charge And Discharge Circuits For Batteries Or The Like (AREA)

Abstract

A power-based true random number generation method adopts an upper computer, a microcontroller and a power module as random number generation tools, wherein the upper computer is internally provided with an instruction unit, a formatting unit and a data receiving and transmitting unit, and the microcontroller is internally provided with a data processing unit and a data transmission unit; setting an input pin of the microcontroller to an input mode and connecting with a power supply S1; s2, sending the number N of the random numbers to be collected by the operator to the microcontroller; s3, the microcontroller calls an internal analog-to-digital conversion module to acquire the voltage value of the power input pin and record time; s4, the data processing unit sends the recording time and the difference value; and S5, formatting the difference to obtain random numbers meeting the requirements, and sending the random numbers to required equipment to complete the generation and collection of the random numbers. The invention simplifies the hardware structure, reduces the cost, obtains the true random number by collecting the power supply change value as the random number by the microcontroller, and has larger practical application value.

Description

True random number generation method based on power supply
Technical Field
The invention relates to the technical field of information security, in particular to a true random number generation method based on a power supply.
Background
In the prior art, random numbers generated by a random generator are widely used in various fields. For example, the lottery industry, generates winning numbers by means of random numbers; in addition, the random number has many applications in information security and password products, such as generating dynamic passwords and dynamic certificate signatures, and the like, thereby greatly ensuring information security and the like.
At present, there are three main methods for generating random numbers, namely manual method, mathematical method and physical method. Wherein, the manual method is the method for generating true random at the earliest, and usually the method of shaking dice and drawing lots is adopted to determine the random number; however, as the application scale is enlarged, the random number generation scale is also enlarged, so people manually make a random number table to obtain random numbers, the table contains thousands of pre-generated true random numbers, and the method can obtain random numbers, but has low efficiency, so the application is limited. The second method is mathematical, which is also the most widely used method at present, and in the application, a certain distribution of random numbers are generated on a computer by a mathematical method, and the generated random numbers are generated according to a known algorithm and are not true random numbers, so the random numbers generated in the way are called pseudo-random numbers, and the pseudo-random numbers have the defects of periodicity and predictability, are difficult to ensure the safety of information encryption, and have limitations in application. The third method is a physical method, i.e. a computer is connected with a physical device, and the physical process is converted into a random number, for example, the random number is generated by the change of chaotic laser, but the method has high technical requirements on operators, and has high cost and no popularization value. In summary, it is necessary to provide a method for generating true random numbers based on a physical method with low technical requirements and low cost.
Disclosure of Invention
In order to overcome the defects that the safety of information encryption is difficult to ensure, the technical requirements on operators are high, the cost is high, the popularization value is not high, and the application is limited in the three methods for generating the random number, the invention provides hardware for generating the random number by using a microcontroller and an upper computer, and the method has the advantages of low cost, convenience in use and low requirements on the operators.
The technical scheme adopted by the invention for solving the technical problems is as follows:
a power-based true random number generation method is characterized in that an upper computer, a microcontroller and a power module are adopted as random number generation tools, the upper computer is internally provided with an instruction unit, a formatting unit and a data receiving and transmitting unit, and the microcontroller is internally provided with a data processing unit and a data transmission unit; the command unit, the formatting unit and the data receiving and transmitting unit are application software installed in an upper computer, and the data processing unit and the data transmission unit are application software installed in a microcontroller; the method for generating the true random number based on the power supply comprises the following steps that S1, an operator sets an input pin of the microcontroller into an input mode and is connected with the power supply, and the signal output end of an analog-to-digital conversion module of the microcontroller is connected with the signal input end of an upper computer through a data line; s2, when an operator needs to generate a true random number, the instruction unit sends a random number generation instruction, and the instruction unit of the upper computer sends the number N of the random numbers which the operator needs to collect to the data processing unit of the microcontroller; s3, when the data processing unit of the microcontroller receives the data of the number N of the random numbers sent by the upper computer, the microcontroller calls the internal self analog-to-digital conversion module to firstly collect the power input pin P for one timeinputVoltage value of (1), noted as V0Then at fixed time intervals TsPost-acquisition input pin PinputThe voltage values, in turn denoted V1,V2,L,VNThe data processing unit calculates the difference value of the collected voltage every two times as ri=Vi-Vi-11,2, N, recording the current time as Ti1,2, N; s4 the data processing unit records the time Ti1,2, N and the difference riThe N is sent to an upper computer data receiving and sending unit through a data transmission unit to be received and then processed in the next step; s5, the operator receives the difference r from the upper computeriN is formatted by a formatting unit according to its own needs to obtain a random number R meeting the requirementsiAnd the data receiving and transmitting unit sends the random number to required equipment to complete the generation and collection of the random number.
Further, in S1, P of the microcontrollerinputPinIs a data input pin.
Further, the microcontroller is a single chip microcomputer module of a model STM32F103C8T 6.
Further, in said S3, V0Is the voltage value collected; t issIs the acquisition time interval; n is the voltage value acquired for N times; r isiIs the difference between adjacent collected voltages; t isiIs riThe calculated system time.
Further, in the S4, TiIs riA calculated system time; r isiIs the difference between adjacent acquisition voltages.
Further, in the S5, riIs the difference between adjacent collected voltages; riIs riAnd (5) processing the data.
The invention has the beneficial effects that: in the invention, the microcontroller, the power module and the upper computer are combined by utilizing the characteristic of thermal noise generated by power generation and ADC (analog-to-digital conversion) technology, so that the hardware structure is greatly improved and simplified, the cost is reduced, in the application, the characteristic that the power voltage is changed by utilizing the thermal noise generated by the power when the power is electrified is used as a basis under the combined action of the upper computer, the microcontroller, the power module and related software units, the microcontroller acquires the power change value as a random number through the analog-to-digital conversion module, and further the true random number is obtained, so that the improvement of the production efficiency is realized, the method has a large practical application value, and can be widely applied to the fields of data encryption, secret communication and the like. Based on the above, the invention has good application prospect.
Drawings
FIG. 1 is a block diagram of the hardware architecture of the present invention.
Fig. 2 is a block diagram of the inventive workflow.
Detailed Description
As shown in fig. 1 and 2, a power supply-based true random number generation method adopts an upper computer, a microcontroller (a single chip microcomputer module of model STM32F103C8T 6) and a direct current power supply module as tools for generating random numbers, wherein the upper computer is internally provided with an instruction unit, a formatting unit and a data transceiver unit, and the microcontroller is internally provided with a data processing unit and a data transmission unit; the instruction unit, the formatting unit and the data receiving and transmitting unit are application software installed in an upper computer, and the data processing unit and the data transmission unit are application software installed in a microcontroller.
Referring to fig. 1 and 2, the method for generating a power-based true random number according to the present invention includes steps of setting a pin of a microcontroller to an input mode and connecting the pin to a positive electrode of a power supply, and outputting a signal output terminal of an analog-to-digital conversion module of the microcontroller (the analog-to-digital conversion module of the microcontroller mainly functions to collect a pin P when necessary) S1inputThe analog voltage signal is converted into a digital signal) and the signal input end of the upper computer are connected through a data line (the microcontroller supplies power through a power module); s2, when an operator needs to generate a true random number, the instruction unit sends a random number generation instruction, and the instruction unit of the upper computer sends the number N of the random numbers which the operator needs to collect to the data processing unit of the microcontroller; s3, when the data processing unit of the microcontroller receives the data of the number N of the random numbers sent by the upper computer, the microcontroller calls an internal analog-to-digital conversion module (ADC) to collect the pin P of the primary power input firstlyinput(i.e., data input pin) voltage value, denoted as V0(value of collected voltage) and then every fixed time Ts(acquisition time interval) post-acquisition input pin PinputThe voltage values, in turn denoted V1,V2,L,VN(voltage values acquired for N times), the data processing unit calculates the difference value of the acquired voltage for every two times as ri=Vi-Vi-1i=1,2,...,N(riDifference of adjacent collected voltages), recording the current time as Ti i=1,2,...,N(TiIs riCalculated system time); s4 the data processing unit records the time Ti i=1,2,...,N(TiIs riCalculated system time) and the difference rii=1,2,...,N(riThe difference value of adjacent collected voltages) is transmitted to an upper computer data transceiver unit through a data transmission unit and then is received by the upper computer data transceiver unit to be processed in the next step; s5, the operator receives the difference r by the upper computeri i=1,2,...,N(riDifference of adjacent collected voltages) rootThe random number R meeting the requirement is obtained by formatting processing through a formatting unit according to the self requirementii=1,2,...,N(RiIs riProcessed data), and the data transceiver unit sends the random number to the required equipment to complete the generation and collection of the random number.
As shown in fig. 1 and 2, the invention is based on the principle of uncertainty of heisenberg, and mainly utilizes the principle that thermal noise generated when a power supply is electrified is disordered movement of atoms and cannot predict the value of the next moment, so that data obtained by collecting the thermal noise is true random numbers. In the invention, the microcontroller, the power module and the upper computer are combined by utilizing the characteristic of thermal noise generated by power generation and ADC (analog-to-digital conversion) technology, so that the hardware structure is greatly improved and simplified, the cost is reduced, in the application, the characteristic that the power voltage is changed by utilizing the thermal noise generated by the power when the power is electrified is used as a basis under the combined action of the upper computer, the microcontroller, the power module and related software units, the microcontroller acquires the power change value as a random number through the analog-to-digital conversion module, and further the true random number is obtained, so that the improvement of the production efficiency is realized, the method has a large practical application value, and can be widely applied to the fields of data encryption, secret communication and the like. The method overcomes the defects that the safety of information encryption is difficult to ensure, the technical requirements on operators are high, the cost is high, the popularization value is not high, and the application is limited in the prior art.
While there have been shown and described what are at present considered the fundamental principles and essential features of the invention and its advantages, it will be apparent to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, but is capable of other specific forms without departing from the spirit or essential characteristics thereof. The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein.
Furthermore, it should be understood that although the present description refers to embodiments, the embodiments do not include only one independent technical solution, and such description is only for clarity, and those skilled in the art should take the description as a whole, and the technical solutions in the embodiments may be appropriately combined to form other embodiments that can be understood by those skilled in the art.

Claims (6)

1.一种基于电源的真随机数产生方法,其特征在于采用上位机、微控制器、电源模块作为随机数产生的工具,上位机内具有指令单元、格式化单元和数据收发单元,微控制器内具有数据处理单元、数据传输单元;所述指令单元、格式化单元和数据收发单元是安装在上位机内的应用软件,数据处理单元、数据传输单元是安装在微控制器内的应用软件;基于电源的真随机数产生方法步骤如下,S1:操作人员将微控制器的一个输入引脚设置为输入模式并与电源连接,将微控制器自身的模数转换模块信号输出端和上位机信号输入端经数据线相连;S2:当操作人员需要产生真随机数时经指令单元发送随机数产生指令,上位机的指令单元将操作人员需要采集的随机数个数N发送给微控制器的数据处理单元;S3:当微控制器的数据处理单元接收到上位机发送的随机数个数N数据后,微控制器调用内部自身模数转换模块先采集一次电源输入引脚Pinput的电压值,记为V0,之后每隔固定时间Ts后采集输入引脚Pinput电压值,依次记为V1,V2,L,VN,数据处理单元计算每两次采集电压的差值为ri=Vi-Vi-1i=1,2,...,N,记录当前时间为Tii=1,2,...,N;S4:数据处理单元将记录时间Tii=1,2,...,N和差值rii=1,2,...,N经数据传输单元发送给上位机数据收发单元接收后进行下一步处理;S5:操作人员将上位机接收到的差值rii=1,2,...,N根据自身需要经格式化单元进行格式化处理,以得到符合要求的随机数Rii=1,2,...,N,数据收发单元之后将随机数发送给所需设备,完成本次随机数的生成和采集。1. a true random number generation method based on power supply, it is characterized in that adopting host computer, microcontroller, power supply module as the tool that random number produces, in host computer there is instruction unit, formatting unit and data transceiver unit, micro-controller The device has a data processing unit and a data transmission unit; the instruction unit, formatting unit and data transceiver unit are application software installed in the host computer, and the data processing unit and data transmission unit are application software installed in the microcontroller The power-based true random number generation method steps are as follows, S1: the operator sets an input pin of the microcontroller as an input mode and is connected with the power supply, and the analog-to-digital conversion module signal output terminal of the microcontroller itself and the host computer are connected. The signal input end is connected by the data line; S2: When the operator needs to generate a true random number, the random number generation command is sent through the command unit, and the command unit of the upper computer sends the random number N that the operator needs to collect to the microcontroller. Data processing unit; S3: After the data processing unit of the microcontroller receives the random number N data sent by the host computer, the microcontroller calls the internal analog-to-digital conversion module to first collect the voltage value of the power input pin P input once , denoted as V 0 , then the voltage value of the input pin P input is collected after every fixed time T s , which is denoted as V 1 , V 2 , L, V N in turn, and the data processing unit calculates the difference between the two collected voltages as r i =V i -V i-1 i=1,2,...,N, record the current time as T i i=1,2,...,N; S4: The data processing unit will record the time T i i=1,2,...,N and the difference r i i=1,2,...,N are sent by the data transmission unit to the data transceiver unit of the upper computer and receive the next step; S5: the operator will The difference value ri i i=1,2,...,N received by the host computer is formatted by the formatting unit according to its own needs, so as to obtain random numbers that meet the requirements R i i=1,2,... ,N, the data transceiver unit then sends the random number to the required device to complete the generation and collection of the random number. 2.根据权利要求1所述的一种基于电源的真随机数产生方法,其特征在于,S1中,微控制器的Pinput引脚是数据输入引脚。2 . The method for generating a true random number based on power supply according to claim 1 , wherein, in S1 , the P input pin of the microcontroller is a data input pin. 3 . 3.根据权利要求1所述的一种基于电源的真随机数产生方法,其特征在于,微控制器是型号STM32F103C8T6的单片机模块。3 . The method for generating true random numbers based on power supply according to claim 1 , wherein the microcontroller is a single-chip microcomputer module of model STM32F103C8T6. 4 . 4.根据权利要求1所述的一种基于电源的真随机数产生方法,其特征在于,S3中,V0是采集的电压值;Ts是采集时间间隔;N是N次采集的电压值;ri为相邻采集电压的差值;Ti为ri计算的系统时间。4. The method for generating true random numbers based on power supply according to claim 1, wherein in S3, V 0 is the voltage value collected; T s is the collection time interval; N is the voltage value collected N times ; ri is the difference between adjacent collected voltages; T i is the system time calculated by ri . 5.根据权利要求1所述的一种基于电源的真随机数产生方法,其特征在于,S4中,Ti为ri计算的系统时间;ri为相邻采集电压的差值。5 . The method for generating true random numbers based on power supply according to claim 1 , wherein, in S4 , T i is the system time calculated by ri ; and ri is the difference between adjacent collected voltages. 6 . 6.根据权利要求1所述的一种基于电源的真随机数产生方法,其特征在于,S5中,ri为相邻采集电压的差值;Ri为ri经过处理后的数据。6 . The method for generating true random numbers based on a power supply according to claim 1 , wherein, in S5 , ri is the difference between adjacent collected voltages; and R i is the processed data of ri . 7 .
CN202110569608.6A 2021-05-25 2021-05-25 True random number generation method based on power supply Pending CN113157250A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110569608.6A CN113157250A (en) 2021-05-25 2021-05-25 True random number generation method based on power supply

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110569608.6A CN113157250A (en) 2021-05-25 2021-05-25 True random number generation method based on power supply

Publications (1)

Publication Number Publication Date
CN113157250A true CN113157250A (en) 2021-07-23

Family

ID=76877832

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110569608.6A Pending CN113157250A (en) 2021-05-25 2021-05-25 True random number generation method based on power supply

Country Status (1)

Country Link
CN (1) CN113157250A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008146526A (en) * 2006-12-13 2008-06-26 Le Tekku:Kk Physical random number generation device and physical random number generation circuit
CN101512480A (en) * 2006-09-11 2009-08-19 Gsip有限责任公司 Random number generators
JP2011238268A (en) * 2011-07-08 2011-11-24 Le Tech Co Ltd Physical random number generation device and circuit
CN106354476A (en) * 2016-10-20 2017-01-25 浙江神州量子网络科技有限公司 Laser phase fluctuation-based quantum random number generator and quantum random number generation method
CN112181363A (en) * 2020-10-19 2021-01-05 北京安石科技有限公司 Master control system with embedded quantum random number generator and generation system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101512480A (en) * 2006-09-11 2009-08-19 Gsip有限责任公司 Random number generators
JP2008146526A (en) * 2006-12-13 2008-06-26 Le Tekku:Kk Physical random number generation device and physical random number generation circuit
JP2011238268A (en) * 2011-07-08 2011-11-24 Le Tech Co Ltd Physical random number generation device and circuit
CN106354476A (en) * 2016-10-20 2017-01-25 浙江神州量子网络科技有限公司 Laser phase fluctuation-based quantum random number generator and quantum random number generation method
CN112181363A (en) * 2020-10-19 2021-01-05 北京安石科技有限公司 Master control system with embedded quantum random number generator and generation system

Non-Patent Citations (5)

* Cited by examiner, † Cited by third party
Title
叶世芬;李晓明;沈海斌;: "真随机数发生器的容差分析", 江南大学学报(自然科学版), no. 06 *
吴港生;吴龟灵;邹卫文;陈建平;: "光模数转换系统中数据存储与传输", 光通信技术, no. 03 *
张宏伟: "《PLC电气控制技术》", 30 September 2018, 中国矿业大学出版社, pages: 338 - 341 *
聂友奇;张军;: "实用化量子随机数发生器研究进展", 信息安全研究, no. 01 *
陈天宇;马原;荆继武;朱双怡;: "振荡采样型真随机数发生器的健壮性研究", 信息安全学报, no. 03 *

Similar Documents

Publication Publication Date Title
CN104348687B (en) A kind of method and electronic equipment of generation authorization
CN102354280A (en) Physical random number generator
CN109714158B (en) Bell state-based semi-quantum privacy comparison method and system
CN101621287A (en) Real random code generating device based on chaos laser and generating method thereof
CN110286878B (en) A True Random Number Generator for MCU Switching Bridge Voltage at Random Intervals and Its Generating Method
CN108182763B (en) Sharing oxygenerator
CN106940903A (en) Work attendance method, device and system
CN103415009B (en) A kind of two-way wireless speech secret signalling based on Lorenz chaotic circuit and method
CN112632544A (en) Block chain information data security management system and block chain dynamic anchoring method
CN110034928B (en) Electric energy metering information transmission device and method
CN103580873B (en) Identity identifying method, system and cipher protection apparatus
CN101000647A (en) Method and device for raising safety of data input
CN113157250A (en) True random number generation method based on power supply
CN111859339A (en) An Authentication System Based on Computer Network
CN112737801B (en) Centralized management system for Ethernet data collectors
CN103580874B (en) Identity identifying method, system and cipher protection apparatus
CN109782148B (en) Signal processing device and signal processing method based on semiconductor superlattice device
CN116780760A (en) Remote monitoring method based on power distribution high-voltage intelligent terminal
CN109587181A (en) A method of single-sign-on assets are realized based on two dimensional code identification authentication mode
CN112181361B (en) High-speed physical random number generation device and method
CN108924117B (en) Power quality monitoring and inquiring method
CN112749401A (en) Supervision work management method, system, computer device and storage medium
CN112181363A (en) Master control system with embedded quantum random number generator and generation system
CN113541920B (en) Design method of analog chaotic communication secret circuit
CN116094725B (en) Voiceprint authentication protection method and system based on sm2 algorithm

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20210723