CN110955407A - Random number taking method based on block chain - Google Patents
Random number taking method based on block chain Download PDFInfo
- Publication number
- CN110955407A CN110955407A CN201911148550.7A CN201911148550A CN110955407A CN 110955407 A CN110955407 A CN 110955407A CN 201911148550 A CN201911148550 A CN 201911148550A CN 110955407 A CN110955407 A CN 110955407A
- Authority
- CN
- China
- Prior art keywords
- random number
- index value
- block
- sub
- random
- 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
Images
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/588—Random number generators, i.e. based on natural stochastic processes
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/22—Indexing; Data structures therefor; Storage structures
- G06F16/2228—Indexing structures
- G06F16/2255—Hash tables
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/27—Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Databases & Information Systems (AREA)
- Data Mining & Analysis (AREA)
- Mathematical Analysis (AREA)
- Pure & Applied Mathematics (AREA)
- Computing Systems (AREA)
- Mathematical Optimization (AREA)
- Computational Mathematics (AREA)
- Software Systems (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention discloses a random number taking method based on a block chain. The method comprises the following steps: (1) generating a sub-loop generator index value based on the blockchain; (2) acquiring a system nanosecond timestamp as a random number seed; (3) generating a random number by taking the subcycle generator index value and the random number seed as inputs; (4) and recursively generating the random numbers in batches by taking the data set and the number of the extracted random numbers as input. The method utilizes block chain cryptography and generates randomness of block chain block hash and TWO _ CMRES is based on a most random CMR variant of all reversible sub-cycle generators and is irreversible and has TWO sub-cycle generators, and has very strong randomness, unpredictability and transparent disclosure, thereby providing a new method for random number taking.
Description
Technical Field
The invention relates to the technical field of random numbers, in particular to a block chain-based random number taking method.
Background
With the explosive development of blockchain technology, from blockchain 1.0 to blockchain 2.0 to the now-recognized blockchain 3.0 era, the term blockchain is slowly favored by experts in various fields, and because of the characteristics of blockchains, blockchain technology is slowly becoming mature, and blockchain applications fall into an emerging industry. At present, random numbers are generated mainly by using a set of random number algorithm (most linear co-location algorithm), only a timestamp is used as a seed, and the random number algorithm is not random enough and can not be predicted. And the generation algorithm of the random number based on the block chain is transparent, the unpredictable characteristic of the random number, and the traditional TWO _ CMRES random number generation algorithm and the block chain cryptography characteristic are fully combined to realize the algorithm function of random number taking.
Disclosure of Invention
Aiming at the defects of the prior art, the invention provides a random number taking method based on a block chain, which can improve the randomness and the unpredictable performance of random number generation.
The purpose of the invention is realized by the following technical scheme: a random number generation method based on a block chain is characterized by specifically comprising the following steps:
(1) generating a sub-loop generator index value based on the blockchain;
(2) acquiring a system nanosecond timestamp as a random number seed;
(3) taking the index value of the sub-loop generator generated in the step 1 and the random number seeds in the step 2 as input, and generating a random number by using a TWO _ CMRES random number algorithm;
(4) and 3, extracting a plurality of random numbers as input in a recursive mode in the process of generating the random numbers in the data set through the step 3, and generating the random numbers in batches.
Further, step 1 comprises the following sub-steps:
() Obtaining the block height: calling a block link port to acquire the height of the latest block according to the characteristics of the block link;
(1.2) block hash acquisition; calling a block link port to acquire the latest block hash according to the block link characteristics;
(1.3) index value data1 generates: performing summation calculation on the nanosecond timestamp of the current system and the current thread Id, performing exclusive OR calculation on the obtained result and the height of the latest block obtained in the step 1.1, calculating and processing the obtained result by using an MD5 algorithm, and performing molar remainder calculation to obtain an index value data 1;
(1.4) index value data2 generates: performing summation calculation on the nanosecond timestamp of the current system and the current thread Id, performing exclusive OR calculation on the obtained result and the hash of the latest block obtained in the step 1.2, performing calculation processing on the obtained result by using an MD5 algorithm, performing molar remainder calculation to obtain an index value data2, comparing the obtained index value data2 with the data1, and if the obtained index value data2 is not equal to the data1, returning the index value data 2; and if the data is equal to the data1 result, subtracting 1 from the obtained index value data2, jumping to the MD5 algorithm calculation processing tangent point, starting execution until the result is not equal to the data1 result, and returning to the index value data 2.
Further, the nanosecond timestamp is greenwich mean time.
Further, the generation of random numbers in step 3 uses the random seed, and the index values data1, data2 generated by using block chain cryptography and randomness of generating block hash as input parameters, and the TWO-way CMRES is based on a variant of the most random CMR among all reversible sub-cycle generators and is irreversible and has TWO sub-cycle generators to generate random numbers.
Compared with the prior art, the invention has the following beneficial effects: the invention relates to a random number taking method based on a block chain, which utilizes block chain cryptography and generates randomness of block hash and TWO _ CMRES, is based on the most random CMR variant in all reversible sub-cycle generators, is irreversible and is provided with TWO sub-cycle generators, has very strong randomness, unpredictability and transparent disclosure, and provides a new method for random number taking.
Drawings
Fig. 1 is a flow chart of the random number fetching method based on block chains according to the present invention.
Detailed Description
The block chain-based random number access method of the present invention is further described with reference to the accompanying drawings.
As shown in fig. 1, the block chain-based random number obtaining method of the present invention specifically includes the following steps:
(1) generating a sub-loop generator index value based on the blockchain:
(1.1) block height acquisition: calling a block link port to acquire the height of the latest block according to the characteristics of the block link;
(1.2) block hash acquisition; calling a block link port to acquire the latest block hash according to the block link characteristics;
(1.3) index value data1 generates: performing summation calculation on the nanosecond timestamp of the current system and the current thread Id, performing exclusive OR calculation on the obtained result and the height of the latest block obtained in the step 1.1, calculating and processing the obtained result by using an MD5 algorithm, and performing molar remainder calculation to obtain an index value data 1;
(1.4) index value data2 generates: performing summation calculation on the nanosecond timestamp of the current system and the current thread Id, performing exclusive OR calculation on the obtained result and the hash of the latest block obtained in the step 1.2, performing calculation processing on the obtained result by using an MD5 algorithm, performing molar remainder calculation to obtain an index value data2, comparing the obtained index value data2 with the data1, and if the obtained index value data2 is not equal to the data1, returning the index value data 2; and if the data is equal to the data1 result, subtracting 1 from the obtained index value data2, jumping to the MD5 algorithm calculation processing tangent point, starting execution until the result is not equal to the data1 result, and returning to the index value data 2.
By utilizing the complexity and unpredictability of blockchain cryptography and combining the currently existing MD5 algorithm, system nanosecond time and current thread Id, the finally generated index value is higher in complexity and more unpredictability, and the tamper-proof hash of the blockchain can be utilized for tracing.
(2) Acquiring a system nanosecond timestamp as a random number seed; the nanosecond timestamp is Greenwich mean time.
(3) Taking the index value of the sub-loop generator generated in the step 1 and the random number seeds in the step 2 as input, and generating a random number by using a TWO _ CMRES random number algorithm; generating random numbers by using blockchain cryptography and generating randomness of the blockhash and the twocmres is based on a variant of the most random CMR of all reversible sub-cycle generators and is irreversible and incorporates TWO sub-cycle generators, making the generated random numbers more irreversible.
(4) And 3, extracting a plurality of random numbers as input in a recursive mode in the process of generating the random numbers in the data set, and generating the random numbers in batches to ensure that the random numbers can be conveniently and quickly generated in batches.
Claims (4)
1. A random number generation method based on a block chain is characterized by specifically comprising the following steps:
(1) generating a sub-loop generator index value based on the blockchain;
(2) acquiring a system nanosecond timestamp as a random number seed;
(3) taking the index value of the sub-loop generator generated in the step 1 and the random number seeds in the step 2 as input, and generating a random number by using a TWO _ CMRES random number algorithm;
(4) and 3, extracting a plurality of random numbers as input in a recursive mode in the process of generating the random numbers in the data set through the step 3, and generating the random numbers in batches.
2. The random number generation method according to claim 1, wherein step 1 comprises the sub-steps of:
() Obtaining the block height: calling a block link port to acquire the height of the latest block according to the characteristics of the block link;
(1.2) block hash acquisition; calling a block link port to acquire the latest block hash according to the block link characteristics;
(1.3) index value data1 generates: performing summation calculation on the nanosecond timestamp of the current system and the current thread Id, performing exclusive OR calculation on the obtained result and the height of the latest block obtained in the step 1.1, calculating and processing the obtained result by using an MD5 algorithm, and performing molar remainder calculation to obtain an index value data 1;
(1.4) index value data2 generates: performing summation calculation on the nanosecond timestamp of the current system and the current thread Id, performing exclusive OR calculation on the obtained result and the hash of the latest block obtained in the step 1.2, performing calculation processing on the obtained result by using an MD5 algorithm, performing molar remainder calculation to obtain an index value data2, comparing the obtained index value data2 with the data1, and if the obtained index value data2 is not equal to the data1, returning the index value data 2; and if the data is equal to the data1 result, subtracting 1 from the obtained index value data2, jumping to the MD5 algorithm calculation processing tangent point, starting execution until the result is not equal to the data1 result, and returning to the index value data 2.
3. The random number generation method of claim 1, wherein the nanosecond timestamp is greenwich mean time.
4. The random number generation method of claim 1, wherein the random number generation in step 3 is performed by using the random seed, and the index values data1 and data2 generated by using the block chain cryptography and the randomness of generating the block hash as input parameters, and the random number generation using the TWO _ CMRES is based on a variant of the most random CMR among all reversible sub-cycle generators and is irreversible and has TWO sub-cycle generators.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911148550.7A CN110955407B (en) | 2019-11-21 | 2019-11-21 | Random number taking method based on block chain |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911148550.7A CN110955407B (en) | 2019-11-21 | 2019-11-21 | Random number taking method based on block chain |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110955407A true CN110955407A (en) | 2020-04-03 |
CN110955407B CN110955407B (en) | 2022-04-01 |
Family
ID=69977958
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201911148550.7A Active CN110955407B (en) | 2019-11-21 | 2019-11-21 | Random number taking method based on block chain |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110955407B (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112306457A (en) * | 2020-08-07 | 2021-02-02 | 神州融安科技(北京)有限公司 | Random number generation method and device |
CN113282803A (en) * | 2021-06-17 | 2021-08-20 | 浙江毫微米科技有限公司 | Workload certification algorithm optimization method and device, computer equipment and storage medium |
Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106790253A (en) * | 2017-01-25 | 2017-05-31 | 中钞信用卡产业发展有限公司北京智能卡技术研究院 | Authentication method and device based on block chain |
CN108845790A (en) * | 2018-06-20 | 2018-11-20 | 胡晓东 | A kind of application block chain generates the method and relevant apparatus of credible random number |
US20190104114A1 (en) * | 2017-10-02 | 2019-04-04 | Colossio, Inc. | One-time-pad encryption |
CN109934566A (en) * | 2019-02-11 | 2019-06-25 | 杭州复杂美科技有限公司 | Red packet processing method, equipment and storage medium |
CN109961550A (en) * | 2019-03-29 | 2019-07-02 | 北京金山安全软件有限公司 | Method and device for determining random number in block chain, electronic equipment and storage medium |
CN110024422A (en) * | 2016-12-30 | 2019-07-16 | 英特尔公司 | The name of Internet of Things and block chained record |
US20190273610A1 (en) * | 2018-03-02 | 2019-09-05 | International Business Machines Corporation | Distributed ledger for generating and verifying random sequence |
CN110336668A (en) * | 2019-08-08 | 2019-10-15 | 杭州复杂美科技有限公司 | A kind of random digit generation method, device and application, equipment and storage medium |
CN110365479A (en) * | 2019-07-11 | 2019-10-22 | 湖南天河国云科技有限公司 | Random digit generation method and device based on block chain |
US20190340110A1 (en) * | 2018-05-07 | 2019-11-07 | Proov Systems Ltd | Poc platform which compares startup s/w products including evaluating their machine learning models |
-
2019
- 2019-11-21 CN CN201911148550.7A patent/CN110955407B/en active Active
Patent Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110024422A (en) * | 2016-12-30 | 2019-07-16 | 英特尔公司 | The name of Internet of Things and block chained record |
CN106790253A (en) * | 2017-01-25 | 2017-05-31 | 中钞信用卡产业发展有限公司北京智能卡技术研究院 | Authentication method and device based on block chain |
US20190104114A1 (en) * | 2017-10-02 | 2019-04-04 | Colossio, Inc. | One-time-pad encryption |
US20190273610A1 (en) * | 2018-03-02 | 2019-09-05 | International Business Machines Corporation | Distributed ledger for generating and verifying random sequence |
US20190340110A1 (en) * | 2018-05-07 | 2019-11-07 | Proov Systems Ltd | Poc platform which compares startup s/w products including evaluating their machine learning models |
CN108845790A (en) * | 2018-06-20 | 2018-11-20 | 胡晓东 | A kind of application block chain generates the method and relevant apparatus of credible random number |
CN109934566A (en) * | 2019-02-11 | 2019-06-25 | 杭州复杂美科技有限公司 | Red packet processing method, equipment and storage medium |
CN109961550A (en) * | 2019-03-29 | 2019-07-02 | 北京金山安全软件有限公司 | Method and device for determining random number in block chain, electronic equipment and storage medium |
CN110365479A (en) * | 2019-07-11 | 2019-10-22 | 湖南天河国云科技有限公司 | Random digit generation method and device based on block chain |
CN110336668A (en) * | 2019-08-08 | 2019-10-15 | 杭州复杂美科技有限公司 | A kind of random digit generation method, device and application, equipment and storage medium |
Non-Patent Citations (1)
Title |
---|
王子钰等: "基于聚合签名与加密交易的全匿名区块链", 《计算机研究与发展》 * |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112306457A (en) * | 2020-08-07 | 2021-02-02 | 神州融安科技(北京)有限公司 | Random number generation method and device |
CN113282803A (en) * | 2021-06-17 | 2021-08-20 | 浙江毫微米科技有限公司 | Workload certification algorithm optimization method and device, computer equipment and storage medium |
CN113282803B (en) * | 2021-06-17 | 2022-06-17 | 浙江毫微米科技有限公司 | Workload certification algorithm optimization method and device, computer equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN110955407B (en) | 2022-04-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103870721B (en) | Multi-thread software based on thread section birthmark plagiarizes detection method | |
CN110955407B (en) | Random number taking method based on block chain | |
CN102857339B (en) | Secret distribution sharing and recovery recombining method based on sequences | |
CN113938691B (en) | Reversible information hiding method for encrypted image | |
CN116070206B (en) | Abnormal behavior detection method, system, electronic equipment and storage medium | |
CN103455306A (en) | Double-line parallel high-speed random number generating device based on semiconductor ring laser | |
CN107769923A (en) | A kind of true random-number generating method based on cpu clock and USB independent clocks | |
Wang et al. | A design of pseudo-random bit generator based on single chaotic system | |
CN106354475A (en) | High-performance random number generation method and generator | |
CN105302915A (en) | High-performance data processing system based on memory calculation | |
CN103092567B (en) | A kind of true random number sequence generation method based on single image | |
CN116346503B (en) | Encryption method and device for water carbon emission data based on full life cycle | |
CN111125193B (en) | Method, device, equipment and storage medium for identifying abnormal multimedia comments | |
CN110784315B (en) | Block chain-based number shaking method and device, computer equipment and storage medium | |
CN1914847B (en) | Apparatus and method for generating random number using digital logic | |
CN108319448B (en) | Method for realizing high-speed random extraction in random number generator | |
CN112994887B (en) | Communication encryption method and system suitable for power Internet of things terminal | |
CN116149604A (en) | Source-independent quantum random number generation method | |
CN104199635B (en) | The pseudorandom number generator of integrated CRC check circuit | |
CN109951282B (en) | Pseudo-random sequence generation method based on segmented CUBIC chaotic mapping | |
CN106027032A (en) | RM logic circuit delay optimization method in unit delay model | |
CN115507897B (en) | State monitoring method, device and equipment for tobacco production line detection device | |
CN104536721A (en) | Multichannel true random number sequence generation method and device based on super-bright light-emitting diode | |
CN110868469B (en) | Extensive equipment management algorithm for ubiquitous Internet of things | |
CN117633849B (en) | Intelligent control method and system for whole flow of coal mine operation |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |