CN105426158B - A kind of random-number generating method and its device - Google Patents

A kind of random-number generating method and its device Download PDF

Info

Publication number
CN105426158B
CN105426158B CN201510905753.1A CN201510905753A CN105426158B CN 105426158 B CN105426158 B CN 105426158B CN 201510905753 A CN201510905753 A CN 201510905753A CN 105426158 B CN105426158 B CN 105426158B
Authority
CN
China
Prior art keywords
voice data
random number
seed
pseudo
module
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.)
Active
Application number
CN201510905753.1A
Other languages
Chinese (zh)
Other versions
CN105426158A (en
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.)
Rockchip Electronics Co Ltd
Original Assignee
Fuzhou Rockchip Electronics 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 Fuzhou Rockchip Electronics Co Ltd filed Critical Fuzhou Rockchip Electronics Co Ltd
Priority to CN201510905753.1A priority Critical patent/CN105426158B/en
Publication of CN105426158A publication Critical patent/CN105426158A/en
Application granted granted Critical
Publication of CN105426158B publication Critical patent/CN105426158B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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/582Pseudo-random number generators

Abstract

The present invention provides a kind of random number generating apparatus, including audio data collecting module and voice data processing module;The audio data collecting module is connected with the voice data processing module;The audio data collecting module sets sample frequency and sampling resolution to be acquired the ambient sound of surrounding;The voice data processing module quantifies the voice data of collection and is encoded to carry out CRC operation again and obtain the seed of pseudo-random algorithm;The voice data processing module performs pseudo-random algorithm to the seed and obtains random number.Present invention also offers a kind of method that random number produces, the present invention produces true random number in the case where not increasing hardware, using pseudo-random algorithm, and arithmetic speed is fast.

Description

A kind of random-number generating method and its device
Technical field
The present invention relates to encryption technology field, more particularly to a kind of random-number generating method and its device.
Background technology
Need to use random number function in a large amount of intelligent movable equipment production processes, random number is divided to two classes at present:It is truly random Number and pseudo random number.True random number be by physical phenomenon randomness generation (such as:Electronic component noise, thermal noise and Frequency jitter of ring oscillator etc.), but need to increase additional hardware, all it is not equipped with these in general intelligent movable equipment Hardware;Pseudo random number is to calculate to produce using mathematical algorithm using seed number as input, if its cycle is grown but input Seed is identical with algorithm, and the random number produced is also by as.At present in intelligent movable device procedures are produced using to be all Pseudo random number, the seed of pseudo-random algorithm largely all use present clock, the hardware and software of all devices during due to producing Environment is identical, so the random number repetitive rate for being used as seed generation by clock is very high.
The content 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, the present invention can be not In the case of increasing hardware, true random number is produced using pseudo-random algorithm, and arithmetic speed is fast.The true random number is to pass through environment The security that noise obtains is higher.
What one of technical problem of the present invention was realized in:A kind of random number generating apparatus,
Including audio data collecting module and voice data processing module;
The audio data collecting module is connected with the voice data processing module;
The audio data collecting module sets sample frequency and sampling resolution to be acquired the ambient sound of surrounding;
The voice data processing module quantifies the voice data of collection and is encoded to carry out CRC operation again and obtain puppet The seed of random algorithm;
The voice data processing module performs pseudo-random algorithm to the seed and obtains random number.
Further, the voice data processing module includes:Quantify and coding module, authentication module, seed generate mould Block;The quantization and coding module, authentication module, seed generation module are sequentially connected;
It is described to quantify the voice data after the voice data of collection is quantified and encoded with coding module;
The authentication module judges whether the voice data after coding is all 0 or is all 1, is then to resurvey audio Data;It is no, then perform seed generation module;
The seed generation module does the voice data after coding CRC operation and obtains the CRC check code conduct of 4 bytes The seed of pseudo-random algorithm.
Further, the audio data collecting module is the microphone of intelligent movable equipment.
Further, the setting sample frequency is 44.1KHz, and sampling resolution is 16.
Further, the pseudo-random algorithm is the rand functions of C language.
The second technical problem to be solved by the present invention, is to provide a kind of method that random number produces, is not increasing hardware In the case of, true random number is produced using pseudo-random algorithm, and arithmetic speed is fast.The true random number is obtained by environmental noise Security it is higher.
What the two of the technical problem of the present invention were realized in:A kind of method that random number produces, the method are:
Sample frequency and sampling resolution is set to be acquired the ambient sound of surrounding by an intelligent movable equipment;
The voice data of collection is quantified and is encoded to carry out CRC operation again and obtain the seed of pseudo-random algorithm;
Pseudo-random algorithm is performed to the seed and obtains random number.
Further, described pair collection voice data quantified and encode carry out again CRC operation obtain pseudorandom calculation The seed of method, is specially:
Voice data after the voice data of collection is quantified and encoded;
Judge whether the voice data after coding is all 0 or is all 1, be then to resurvey voice data;It is no, then hold Row is in next step;
CRC operation is done to the voice data after coding and obtains kind of the CRC check code of 4 bytes as pseudo-random algorithm Son.
Further, the intelligent movable equipment is acquired the ambient sound of surrounding using microphone.
Further, the setting sample frequency is 44.1KHz, and sampling resolution is 16.
Further, the pseudo-random algorithm is the rand functions of C language.
The invention has the advantages that:Since environmental noise is that intelligent movable equipment change at random and most of all carries Microphone, it is possible to the sound of surrounding environment is obtained using microphone, the audio of acquisition is sampled, quantified and encoded To a section audio data, the seed that pseudo-random algorithm is calculated in CRC is carried out to voice data, pseudo-random algorithm is carried out initial Change, then perform pseudo random number algorithm and obtain final random number.It can be made using the present invention in the case where not increasing hardware True random number is produced with pseudo-random algorithm, and arithmetic speed is fast.The true random number is the security ratio obtained by environmental noise It is higher.
Brief description of the drawings
Fig. 1 is the structure diagram of the first embodiment of apparatus of the present invention.
Fig. 2 is the structure diagram of the second embodiment of apparatus of the present invention.
Fig. 3 is the method schematic diagram of the first embodiment of the method for the present invention.
Fig. 4 is the method schematic diagram of the second embodiment of the method for the present invention.
Embodiment
Referring to Fig. 1, it is the structure diagram of the first embodiment of apparatus of the present invention.A kind of random number generating apparatus,
Including audio data collecting module 10 and voice data processing module 11;
The audio data collecting module 10 is connected with the voice data processing module 11;
The audio data collecting module 10 sets sample frequency and sampling resolution to be acquired the ambient sound of surrounding;
The voice data processing module 11 quantifies the voice data of collection and is encoded to carry out CRC operation again and obtain The seed of pseudo-random algorithm;
The voice data processing module 11 performs pseudo-random algorithm to the seed and obtains random number.
Referring to Fig. 2, it is the structure diagram of the second embodiment of apparatus of the present invention.A kind of random number generating apparatus,
Including audio data collecting module 21 and voice data processing module 22;
The audio data collecting module 21 is connected with the voice data processing module 22;
The audio data collecting module 21 sets sample frequency and sampling resolution to be acquired the ambient sound of surrounding;
The voice data processing module 22 quantifies the voice data of collection and is encoded to carry out CRC operation again and obtain The seed of pseudo-random algorithm;
The voice data processing module 22 performs pseudo-random algorithm to the seed and obtains random number.
Wherein, the voice data processing module 22 includes:Quantify and coding module 221, authentication module 222, seed are given birth to Into module 223;The quantization and coding module 221, authentication module 222, seed generation module 223 are sequentially connected;
It is described to quantify the audio number after the voice data of collection is quantified and encoded with coding module 221 According to;
The authentication module 222 judges whether the voice data after coding is all 0 or is all 1, is then to resurvey sound Frequency evidence;It is no, then perform seed generation module;
The seed generation module 223 does the voice data after coding CRC operation and obtains the CRC check code of 4 bytes Seed as pseudo-random algorithm.The pseudo-random algorithm is the rand functions of C language.
In the present invention, the audio data collecting module is the microphone of intelligent movable equipment.It is described that sampling frequency is set Rate is 44.1KHz, and sampling resolution is 16.
Referring to Fig. 3, it is the method schematic diagram of the first embodiment of apparatus of the present invention.A kind of method that random number produces, The method is:
S31, by an intelligent movable equipment set sample frequency and sampling resolution to be acquired the ambient sound of surrounding;
S32, the voice data to collection are quantified and are encoded to carry out CRC operation again and obtain the seed of pseudo-random algorithm;
S33, obtain random number to seed execution pseudo-random algorithm.
Referring to Fig. 4, it is the method schematic diagram of the second embodiment of apparatus of the present invention.A kind of method that random number produces, The method is:
S41, by an intelligent movable equipment set sample frequency and sampling resolution to be acquired the ambient sound of surrounding;
S42, the voice data to collection are quantified and are encoded to carry out CRC operation again and obtain the seed of pseudo-random algorithm;
The voice data of described pair of collection is quantified and is encoded to carry out CRC operation again and obtain the seed of pseudo-random algorithm, Specially:
Voice data after the voice data of collection is quantified and encoded;
S43, judge whether the voice data after coding is all 0 or is all 1, is then to resurvey voice data;It is no, Then perform next step;
S44, do the voice data after coding CRC operation and obtain the CRC check code of 4 bytes as pseudo-random algorithm Seed.
S45, obtain random number to seed execution pseudo-random algorithm.The pseudo-random algorithm is the rand letters of C language Number.
In the present invention, the intelligent movable equipment is acquired the ambient sound of surrounding using microphone.It is described to set It is 44.1KHz to put sample frequency, and sampling resolution is 16.
With reference to an instantiation, the invention will be further described:
The sample frequency and sampling resolution of 1.1 setting microphones (use 44.1KHz sample frequencys and 16 sample bits Number)
Open the surrounding environment sound that microphone obtains 100ms
1.2 pairs of voice datas got are quantified and are encoded
1.3 judge coding after voice data whether full 0 or complete 1, if it is resampling, no, then into 1.4;
Voice data after 1.4 pairs of codings does CRC operation, obtains the CRC check code of 4 bytes
Initial seed as pseudo-random algorithm
1.6 perform pseudo-random algorithm, obtain final random number.
In short, since environmental noise is that intelligent movable equipment change at random and most of all carries microphone, so can To obtain the sound of surrounding environment using microphone, the audio of acquisition is sampled, is quantified and coding obtains a section audio number According to carrying out CRC to voice data and the seed of pseudo-random algorithm be calculated, pseudo-random algorithm is initialized, is then performed Pseudo random number algorithm obtains final random number.It can be calculated using the present invention in the case where not increasing hardware using pseudorandom Method produces true random number, and arithmetic speed is fast.The true random number is that the security obtained by environmental noise is higher.
The foregoing is merely presently preferred embodiments of the present invention, all equivalent changes done according to scope of the present invention patent with Modification, should all belong to the covering scope of the present invention.

Claims (8)

  1. A kind of 1. random number generating apparatus, it is characterised in that:
    Including audio data collecting module and voice data processing module;
    The audio data collecting module is connected with the voice data processing module;
    The audio data collecting module sets sample frequency and sampling resolution to be acquired the ambient sound of surrounding;
    The voice data processing module quantifies the voice data of collection and is encoded to carry out CRC operation again and obtain pseudorandom The seed of algorithm;
    The voice data processing module performs pseudo-random algorithm to the seed and obtains random number;
    The voice data processing module includes:Quantify and coding module, authentication module, seed generation module;It is described quantization and Coding module, authentication module, seed generation module are sequentially connected;
    It is described to quantify the voice data after the voice data of collection is quantified and encoded with coding module;
    The authentication module judges whether the voice data after coding is all 0 or is all 1, is then to resurvey voice data; It is no, then perform seed generation module;
    The seed generation module voice data after coding is done CRC operation obtain the CRC check codes of 4 bytes as it is pseudo- with The seed of machine algorithm.
  2. A kind of 2. random number generating apparatus according to claim 1, it is characterised in that:The audio data collecting module is The microphone of intelligent movable equipment.
  3. A kind of 3. random number generating apparatus according to claim 1, it is characterised in that:It is described setting sample frequency be 44.1KHz, sampling resolution are 16.
  4. A kind of 4. random number generating apparatus according to claim 1, it is characterised in that:The pseudo-random algorithm is C language Rand functions.
  5. 5. a kind of method that random number produces, it is characterised in that:The method is:
    Sample frequency and sampling resolution is set to be acquired the ambient sound of surrounding by an intelligent movable equipment;
    The voice data of collection is quantified and is encoded to carry out CRC operation again and obtain the seed of pseudo-random algorithm;Described pair is adopted The voice data of collection is quantified and is encoded to carry out CRC operation again and obtain the seed of pseudo-random algorithm, is specially:
    Voice data after the voice data of collection is quantified and encoded;
    Judge whether the voice data after coding is all 0 or is all 1, be then to resurvey voice data;It is no, then under performing One step;
    CRC operation is done to the voice data after coding and obtains seed of the CRC check code of 4 bytes as pseudo-random algorithm;
    Pseudo-random algorithm is performed to the seed and obtains random number.
  6. 6. the method that a kind of random number according to claim 5 produces, it is characterised in that:The intelligent movable equipment uses Microphone is acquired the ambient sound of surrounding.
  7. 7. the method that a kind of random number according to claim 5 produces, it is characterised in that:It is described setting sample frequency be 44.1KHz, sampling resolution are 16.
  8. 8. the method that a kind of random number according to claim 5 produces, it is characterised in that:The pseudo-random algorithm is C languages The rand functions of speech.
CN201510905753.1A 2015-12-09 2015-12-09 A kind of random-number generating method and its device Active CN105426158B (en)

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 CN105426158A (en) 2016-03-23
CN105426158B true 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)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105913536B (en) * 2016-05-24 2019-08-16 上海申彩信息系统有限公司 A kind of automatic music lot cast machine and lottery rocking method
CN107450886B (en) * 2017-08-14 2020-06-05 北京睿信丰科技有限公司 Method and device for generating Gaussian random signal simulating Gaussian white noise
CN107980135B (en) * 2017-10-27 2021-11-09 福建联迪商用设备有限公司 Method and system for generating random number of terminal
CN111914271B (en) * 2020-07-09 2023-04-18 清远职业技术学院 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
CN115632782B (en) * 2022-12-22 2023-03-21 湖南密码工程研究中心有限公司 Random number generation method, system and equipment based on SM4 counter mode

Family Cites Families (5)

* Cited by examiner, † Cited by third party
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
KR100813954B1 (en) * 2003-01-16 2008-03-14 삼성전자주식회사 Data Encryption apparatus and method
CN102541509B (en) * 2012-01-13 2016-04-27 河南科技大学 A kind of true random number generation method based on chaos encryption
CN103294447B (en) * 2013-05-30 2016-08-10 华为技术有限公司 A kind of method and apparatus generating random number
CN103617020B (en) * 2013-12-23 2018-03-23 网易乐得科技有限公司 A kind of method and apparatus that random number is generated in application program

Also Published As

Publication number Publication date
CN105426158A (en) 2016-03-23

Similar Documents

Publication Publication Date Title
CN105426158B (en) A kind of random-number generating method and its device
CN104935429B (en) A kind of data processing method and its system using multi-enciphering
CN106778101B (en) It is a kind of that method is obscured with the Python code that shape is obscured based on control stream
CN115051798B (en) Random number generation method and device, electronic equipment and storage medium
Bao et al. A new chaotic system for image encryption
CN106375079A (en) Chaotic encryption method for voice information
CN107026859A (en) A kind of safe transmission method of privacy cloud medical data
CN110324147B (en) GAN game countermeasure encryption method based on chaos model
CN103019648A (en) True random number generator with digital post-processing circuit
Alwahbani et al. Speech scrambling based on chaotic maps and one time pad
CN106656459A (en) Side channel energy analysis method and device for SM3-HMAC
SG11201808823PA (en) Video compressed sensing reconstruction method, system, electronic device, and storage medium
Jallouli Chaos-based security under real-time and energy constraints for the Internet of Things
CN104269175B (en) A kind of ip voice steganography method matched based on Best similarity degree
Bhattacharjee et al. Unified GPU technique to boost confidentiality, integrity and trim data loss in big data transmission
Coşkun et al. A new computer-controlled platform for ADC-based true random number generator and its applications
CN103701591B (en) A kind of sequential cipher realization method and key stream generate method and device
CN106330424B (en) The anti-attack method and device of crypto module based on SM3 algorithm
CN110730453B (en) Wireless body area network, key generation method, key distribution method and related device thereof
CN105912834A (en) An apparatus and method for checking the entropy of a sequence of random numbers
Khan et al. Probing 3D chaotic Thomas’ cyclically attractor with multimedia encryption and electronic circuitry
CN109036439A (en) A kind of perceptual hash feature extraction method and system encrypting voice signal
Sadkhab et al. Design and implementation voice scrambling model based on hybrid chaotic signals
Jallouli et al. Comparative study of two pseudo chaotic number generators for securing the iot
CN104123945B (en) Embedding method and extracting method for wav-format audio information

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.