CN105426158A - Random number generating method and device - Google Patents
Random number generating method and device Download PDFInfo
- Publication number
- CN105426158A CN105426158A CN201510905753.1A CN201510905753A CN105426158A CN 105426158 A CN105426158 A CN 105426158A CN 201510905753 A CN201510905753 A CN 201510905753A CN 105426158 A CN105426158 A CN 105426158A
- Authority
- CN
- China
- Prior art keywords
- voice data
- random number
- seed
- module
- pseudo
- 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.)
- Granted
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F7/00—Methods or arrangements for processing data by operating upon the order or content of the data handled
- G06F7/58—Random or pseudo-random number generators
- G06F7/582—Pseudo-random number generators
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computational Mathematics (AREA)
- Mathematical Analysis (AREA)
- Mathematical Optimization (AREA)
- Pure & Applied Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Compression, Expansion, Code Conversion, And Decoders (AREA)
Abstract
The invention provides a random number generating device. The device comprises an audio data collecting module and an audio data processing module which are connected; the audio data collecting module sets a sampling frequency and a sampling digit to collect surrounding environment sounds; the audio data processing module quantizes and codes collected audio data and then performs CRC calculation to obtain seeds of a pseudorandom algorithm; the audio data processing module performs the pseudorandom algorithm on the seeds to obtain random numbers. The invention further provides a random number generating method. According to the random number generating method and device, on the condition that hardware is not increased, true random numbers are generated by using the pseudorandom algorithm, and the calculation speed is high.
Description
Technical field
The present invention relates to encryption technology field, particularly relate to a kind of random-number generating method and device thereof.
Background technology
Need in a large amount of intelligent movable device fabrication process to use random number function, current random number divides two classes: true random number and pseudo random number.True random number is (such as: the frequency jitter etc. of electronic component noise, thermonoise and ring oscillator) that produce by the randomness of physical phenomenon, but needs to increase additional hardware, and general intelligent movable equipment is not all equipped with these hardware; Pseudo random number utilizes mathematical algorithm to calculate using seed number as input and produces, if its cycle long still input seed is identical with algorithm, the random number produced also will be the same.What use in production intelligent movable device procedures at present is all pseudo random number, the seed major part of pseudo-random algorithm all uses present clock, during owing to producing all devices hardware and software environment facies with, so the random number repetition rate produced as seed by clock is very high.
Summary of the invention
One of the technical problem to be solved in the present invention, is to provide a kind of random number generating apparatus, and the present invention can, when not increasing hardware, use pseudo-random algorithm to produce true random number, and fast operation.This true random number is that the security obtained by environmental noise is higher.
One of technical matters of the present invention is achieved in that a kind of random number generating apparatus,
Comprise audio data collecting module and voice data processing module;
Described audio data collecting module is connected with described voice data processing module;
Described audio data collecting module installation sample frequency and the ambient sound of sampling resolution to surrounding gather;
Described voice data processing module quantizes and encodes to carry out the seed that CRC computing obtains pseudo-random algorithm again to the voice data gathered;
Described voice data processing module performs pseudo-random algorithm to described seed and obtains random number.
Further, described voice data processing module comprises: quantize and coding module, authentication module, seed generation module; Described quantification is connected successively with coding module, authentication module, seed generation module;
Described quantification and coding module quantize the voice data gathered and encode to obtain the voice data after encoding;
Described authentication module judges whether the voice data after encoding is 0 entirely or is 1 entirely, is, then Resurvey voice data; No, then perform seed generation module;
Described seed generation module does to the voice data after coding the seed of CRC check code as pseudo-random algorithm that CRC computing obtains 4 bytes.
Further, described audio data collecting module is the microphone of intelligent movable equipment.
Further, the described sample frequency that arranges is 44.1KHz, and sampling resolution is 16.
Further, described pseudo-random algorithm is the rand function of C language.
The technical problem to be solved in the present invention two, is a kind of method providing random number to produce, and when not increasing hardware, uses pseudo-random algorithm to produce true random number, and fast operation.This true random number is that the security obtained by environmental noise is higher.
Two of technical matters of the present invention is achieved in that a kind of method that random number produces, and described method is:
Sample frequency is set by an intelligent movable equipment and the ambient sound of sampling resolution to surrounding gathers;
Quantize and encode to carry out the seed that CRC computing obtains pseudo-random algorithm again to the voice data gathered;
Pseudo-random algorithm is performed to described seed and obtains random number.
Further, the described voice data to gathering quantizes and encodes to carry out the seed that CRC computing obtains pseudo-random algorithm again, is specially:
Quantize the voice data gathered and encode to obtain the voice data after encoding;
Judge whether the voice data after encoding is 0 entirely or is 1 entirely, is, then Resurvey voice data; No, then perform next step;
The seed of CRC check code as pseudo-random algorithm that CRC computing obtains 4 bytes is done to the voice data after coding.
Further, described intelligent movable equipment adopts the ambient sound of microphone to surrounding to gather.
Further, the described sample frequency that arranges is 44.1KHz, and sampling resolution is 16.
Further, described pseudo-random algorithm is the rand function of C language.
Tool of the present invention has the following advantages: due to environmental noise be random variation and most of intelligent movable equipment all with microphone, so microphone can be utilized to obtain the sound of surrounding environment, the audio frequency obtained is sampled, to be quantized and coding obtains section audio data, the seed that CRC calculates pseudo-random algorithm is carried out to voice data, initialization is carried out to pseudo-random algorithm, then performs pseudo random number algorithm and obtain final random number.The present invention is adopted when not increasing hardware, to use pseudo-random algorithm to produce true random number, and fast operation.This true random number is that the security obtained by environmental noise is higher.
Accompanying drawing explanation
Fig. 1 is the structural representation of first embodiment of apparatus of the present invention.
Fig. 2 is the structural representation of second embodiment of apparatus of the present invention.
Fig. 3 is the method schematic diagram of first embodiment of the inventive method.
Fig. 4 is the method schematic diagram of second embodiment of the inventive method.
Embodiment
Referring to Fig. 1, is the structural representation of first embodiment of apparatus of the present invention.A kind of random number generating apparatus,
Comprise audio data collecting module 10 and voice data processing module 11;
Described audio data collecting module 10 is connected with described voice data processing module 11;
Described audio data collecting module 10 arranges sample frequency and the ambient sound of sampling resolution to surrounding gathers;
Described voice data processing module 11 quantizes and encodes to carry out the seed that CRC computing obtains pseudo-random algorithm again to the voice data gathered;
Described voice data processing module 11 performs pseudo-random algorithm to described seed and obtains random number.
Referring to Fig. 2, is the structural representation of second embodiment of apparatus of the present invention.A kind of random number generating apparatus,
Comprise audio data collecting module 21 and voice data processing module 22;
Described audio data collecting module 21 is connected with described voice data processing module 22;
Described audio data collecting module 21 arranges sample frequency and the ambient sound of sampling resolution to surrounding gathers;
Described voice data processing module 22 quantizes and encodes to carry out the seed that CRC computing obtains pseudo-random algorithm again to the voice data gathered;
Described voice data processing module 22 performs pseudo-random algorithm to described seed and obtains random number.
Wherein, described voice data processing module 22 comprises: quantize and coding module 221, authentication module 222, seed generation module 223; Described quantification is connected successively with coding module 221, authentication module 222, seed generation module 223;
Described quantification and coding module 221 quantize the voice data gathered and encode to obtain the voice data after encoding;
Described authentication module 222 judges whether the voice data after encoding is 0 entirely or is 1 entirely, is, then Resurvey voice data; No, then perform seed generation module;
Described seed generation module 223 does to the voice data after coding the seed of CRC check code as pseudo-random algorithm that CRC computing obtains 4 bytes.Pseudo-random algorithm described in this is the rand function of C language.
In the present invention, described audio data collecting module is the microphone of intelligent movable equipment.The described sample frequency that arranges is 44.1KHz, and sampling resolution is 16.
Referring to Fig. 3, is the method schematic diagram of first embodiment of apparatus of the present invention.The method that random number produces, described method is:
S31, sample frequency is set by an intelligent movable equipment and the ambient sound of sampling resolution to surrounding gathers;
S32, to gather voice data quantize and encode to carry out the seed that CRC computing obtains pseudo-random algorithm again;
S33, pseudo-random algorithm is performed to described seed obtain random number.
Referring to Fig. 4, is the method schematic diagram of second embodiment of apparatus of the present invention.The method that random number produces, described method is:
S41, sample frequency is set by an intelligent movable equipment and the ambient sound of sampling resolution to surrounding gathers;
S42, to gather voice data quantize and encode to carry out the seed that CRC computing obtains pseudo-random algorithm again;
The described voice data to gathering quantizes and encodes to carry out the seed that CRC computing obtains pseudo-random algorithm again, is specially:
Quantize the voice data gathered and encode to obtain the voice data after encoding;
S43, judge encode after voice data whether be 0 entirely or be 1 entirely, be, then Resurvey voice data; No, then perform next step;
S44, to coding after voice data do the seed of CRC check code as pseudo-random algorithm that CRC computing obtains 4 bytes.
S45, pseudo-random algorithm is performed to described seed obtain random number.Described pseudo-random algorithm is the rand function of C language.
In the present invention, described intelligent movable equipment adopts the ambient sound of microphone to surrounding to gather.The described sample frequency that arranges is 44.1KHz, and sampling resolution is 16.
Below in conjunction with an instantiation, the invention will be further described:
1.1 sample frequency and the sampling resolutions (using 44.1KHz sample frequency and 16 sampling resolutions) that microphone is set
Open the surrounding environment sound that microphone obtains 100ms
1.2 pairs of voice datas got quantize and encode
1.3 judge the voice data whether full 0 or complete 1 after encoding, if it is resampling, no, then enter 1.4;
Voice data after 1.4 pairs of codings does CRC computing, obtains the CRC check code of 4 bytes
As the initial seed of pseudo-random algorithm
1.6 perform pseudo-random algorithm, obtain final random number.
In a word, due to environmental noise be random variation and most of intelligent movable equipment all with microphone, so microphone can be utilized to obtain the sound of surrounding environment, the audio frequency obtained is sampled, to be quantized and coding obtains section audio data, the seed that CRC calculates pseudo-random algorithm is carried out to voice data, initialization is carried out to pseudo-random algorithm, then performs pseudo random number algorithm and obtain final random number.The present invention is adopted when not increasing hardware, to use pseudo-random algorithm to produce true random number, and fast operation.This true random number is that the security obtained by environmental noise is higher.
The foregoing is only preferred embodiment of the present invention, all equalizations done according to the present patent application the scope of the claims change and modify, and all should belong to covering scope of the present invention.
Claims (10)
1. a random number generating apparatus, is characterized in that:
Comprise audio data collecting module and voice data processing module;
Described audio data collecting module is connected with described voice data processing module;
Described audio data collecting module installation sample frequency and the ambient sound of sampling resolution to surrounding gather;
Described voice data processing module quantizes and encodes to carry out the seed that CRC computing obtains pseudo-random algorithm again to the voice data gathered;
Described voice data processing module performs pseudo-random algorithm to described seed and obtains random number.
2. a kind of random number generating apparatus according to claim 1, is characterized in that:
Described voice data processing module comprises: quantize and coding module, authentication module, seed generation module; Described quantification is connected successively with coding module, authentication module, seed generation module;
Described quantification and coding module quantize the voice data gathered and encode to obtain the voice data after encoding;
Described authentication module judges whether the voice data after encoding is 0 entirely or is 1 entirely, is, then Resurvey voice data; No, then perform seed generation module;
Described seed generation module does to the voice data after coding the seed of CRC check code as pseudo-random algorithm that CRC computing obtains 4 bytes.
3. a kind of random number generating apparatus according to claim 1, is characterized in that: described audio data collecting module is the microphone of intelligent movable equipment.
4. a kind of random number generating apparatus according to claim 1, is characterized in that: the described sample frequency that arranges is 44.1KHz, and sampling resolution is 16.
5. a kind of random number generating apparatus according to claim 1, is characterized in that: described pseudo-random algorithm is the rand function of C language.
6. a method for random number generation, is characterized in that: described method is:
Sample frequency is set by an intelligent movable equipment and the ambient sound of sampling resolution to surrounding gathers;
Quantize and encode to carry out the seed that CRC computing obtains pseudo-random algorithm again to the voice data gathered;
Pseudo-random algorithm is performed to described seed and obtains random number.
7. the method for a kind of random number generation according to claim 6, is characterized in that: the described voice data to gathering quantizes and encode to carry out the seed that CRC computing obtains pseudo-random algorithm again, is specially:
Quantize the voice data gathered and encode to obtain the voice data after encoding;
Judge whether the voice data after encoding is 0 entirely or is 1 entirely, is, then Resurvey voice data; No, then perform next step;
The seed of CRC check code as pseudo-random algorithm that CRC computing obtains 4 bytes is done to the voice data after coding.
8. the method for a kind of random number generation according to claim 6, is characterized in that: described intelligent movable equipment adopts the ambient sound of microphone to surrounding to gather.
9. the method for a kind of random number generation according to claim 6, is characterized in that: the described sample frequency that arranges is 44.1KHz, and sampling resolution is 16.
10. the method for a kind of random number generation according to claim 6, is characterized in that: described pseudo-random algorithm is the rand function of C language.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510905753.1A CN105426158B (en) | 2015-12-09 | 2015-12-09 | A kind of random-number generating method and its device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510905753.1A CN105426158B (en) | 2015-12-09 | 2015-12-09 | A kind of random-number generating method and its device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN105426158A true CN105426158A (en) | 2016-03-23 |
CN105426158B CN105426158B (en) | 2018-05-01 |
Family
ID=55504389
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510905753.1A Active CN105426158B (en) | 2015-12-09 | 2015-12-09 | A kind of random-number generating method and its device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105426158B (en) |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105913536A (en) * | 2016-05-24 | 2016-08-31 | 上海申彩信息系统有限公司 | Automatic music lottery drawing machine and lottery drawing method |
CN107450886A (en) * | 2017-08-14 | 2017-12-08 | 北京睿信丰科技有限公司 | A kind of random digit generation method and device |
WO2019080109A1 (en) * | 2017-10-27 | 2019-05-02 | 福建联迪商用设备有限公司 | Terminal random number generation method and system |
CN111914271A (en) * | 2020-07-09 | 2020-11-10 | 清远职业技术学院 | Privacy protection system and method for big data release |
CN115277684A (en) * | 2022-09-29 | 2022-11-01 | 安徽华云安科技有限公司 | File transmission method, device, equipment and storage medium |
CN115632782A (en) * | 2022-12-22 | 2023-01-20 | 湖南密码工程研究中心有限公司 | Random number generation method, system and equipment based on SM4 counter mode |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6357032B1 (en) * | 1999-02-08 | 2002-03-12 | International Business Machines Corporation | Method and apparatus for implementing cyclic redundancy check calculation for data communications |
CN1518269A (en) * | 2003-01-16 | 2004-08-04 | 三星电子株式会社 | Data enciphering equipment and method |
CN102541509A (en) * | 2012-01-13 | 2012-07-04 | 河南科技大学 | True random number generation method based on chaotic encryption |
CN103294447A (en) * | 2013-05-30 | 2013-09-11 | 华为技术有限公司 | Method and device for generating random numbers |
CN103617020A (en) * | 2013-12-23 | 2014-03-05 | 乐得科技有限公司 | Method and equipment for generating random number in application program |
-
2015
- 2015-12-09 CN CN201510905753.1A patent/CN105426158B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6357032B1 (en) * | 1999-02-08 | 2002-03-12 | International Business Machines Corporation | Method and apparatus for implementing cyclic redundancy check calculation for data communications |
CN1518269A (en) * | 2003-01-16 | 2004-08-04 | 三星电子株式会社 | Data enciphering equipment and method |
CN102541509A (en) * | 2012-01-13 | 2012-07-04 | 河南科技大学 | True random number generation method based on chaotic encryption |
CN103294447A (en) * | 2013-05-30 | 2013-09-11 | 华为技术有限公司 | Method and device for generating random numbers |
CN103617020A (en) * | 2013-12-23 | 2014-03-05 | 乐得科技有限公司 | Method and equipment for generating random number in application program |
Non-Patent Citations (1)
Title |
---|
王根义: "CRC 校验码算法的研究与实现", 《电子设计工程》 * |
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105913536A (en) * | 2016-05-24 | 2016-08-31 | 上海申彩信息系统有限公司 | Automatic music lottery drawing machine and lottery drawing method |
CN105913536B (en) * | 2016-05-24 | 2019-08-16 | 上海申彩信息系统有限公司 | A kind of automatic music lot cast machine and lottery rocking method |
CN107450886A (en) * | 2017-08-14 | 2017-12-08 | 北京睿信丰科技有限公司 | A kind of random digit generation method and device |
CN107450886B (en) * | 2017-08-14 | 2020-06-05 | 北京睿信丰科技有限公司 | Method and device for generating Gaussian random signal simulating Gaussian white noise |
WO2019080109A1 (en) * | 2017-10-27 | 2019-05-02 | 福建联迪商用设备有限公司 | Terminal random number generation method and system |
CN111914271A (en) * | 2020-07-09 | 2020-11-10 | 清远职业技术学院 | Privacy protection system and method for big data release |
CN115277684A (en) * | 2022-09-29 | 2022-11-01 | 安徽华云安科技有限公司 | File transmission method, device, equipment and storage medium |
CN115632782A (en) * | 2022-12-22 | 2023-01-20 | 湖南密码工程研究中心有限公司 | Random number generation method, system and equipment based on SM4 counter mode |
Also Published As
Publication number | Publication date |
---|---|
CN105426158B (en) | 2018-05-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105426158A (en) | Random number generating method and device | |
CN112466275B (en) | Voice conversion and corresponding model training method, device, equipment and storage medium | |
US9367288B2 (en) | Device and method responsive to influences of mind | |
Renza et al. | High-uncertainty audio signal encryption based on the Collatz conjecture | |
CN115051798B (en) | Random number generation method and device, electronic equipment and storage medium | |
CN103019648A (en) | True random number generator with digital post-processing circuit | |
CN103294447A (en) | Method and device for generating random numbers | |
JP2013500660A (en) | Information encoding and decoding | |
Alwahbani et al. | Speech scrambling based on chaotic maps and one time pad | |
Mahmoud et al. | Enhancing LSB using binary message size encoding for high capacity, transparent and secure audio steganography–an innovative approach | |
SG11201808823PA (en) | Video compressed sensing reconstruction method, system, electronic device, and storage medium | |
Bhattacharjee et al. | Unified GPU technique to boost confidentiality, integrity and trim data loss in big data transmission | |
CN115587321A (en) | Electroencephalogram signal identification and classification method and system and electronic equipment | |
CN105912834A (en) | An apparatus and method for checking the entropy of a sequence of random numbers | |
El Assad et al. | Design and analyses of efficient chaotic generators for crypto-systems | |
CN110730453B (en) | Wireless body area network, key generation method, key distribution method and related device thereof | |
CN105991289A (en) | Side channel energy analysis method and device of SM3 cipher algorithm | |
CN103701591A (en) | Sequence password realization method and key stream generating method and device | |
CN107037262B (en) | Big data spectrum analysis system and method thereof | |
Desai et al. | Compressive sensing in speech processing: A survey based on sparsity and sensing matrix | |
CN109036439A (en) | A kind of perceptual hash feature extraction method and system encrypting voice signal | |
Elshoush et al. | Ameliorating LSB Using Piecewise Linear Chaotic Map and One-Time Pad for Superlative Capacity, Imperceptibility and Secure Audio Steganography | |
Akmeşe | A novel random number generator and its application in sound encryption based on a fractional-order chaotic system | |
Khan et al. | Probing 3D chaotic Thomas’ cyclically attractor with multimedia encryption and electronic circuitry | |
CN111008356A (en) | WTSVD algorithm-based background-subtracted gamma energy spectrum set analysis method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
CP01 | Change in the name or title of a patent holder | ||
CP01 | Change in the name or title of a patent holder |
Address after: 350000 building, No. 89, software Avenue, Gulou District, Fujian, Fuzhou 18, China Patentee after: Ruixin Microelectronics Co., Ltd Address before: 350000 building, No. 89, software Avenue, Gulou District, Fujian, Fuzhou 18, China Patentee before: Fuzhou Rockchips Electronics Co.,Ltd. |