CN110955407B - Random number taking method based on block chain - Google Patents
Random number taking method based on block chain Download PDFInfo
- Publication number
- CN110955407B CN110955407B CN201911148550.7A CN201911148550A CN110955407B CN 110955407 B CN110955407 B CN 110955407B CN 201911148550 A CN201911148550 A CN 201911148550A CN 110955407 B CN110955407 B CN 110955407B
- Authority
- CN
- China
- Prior art keywords
- index value
- random number
- block
- random
- calculation
- 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
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)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Databases & Information Systems (AREA)
- General Engineering & Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Software Systems (AREA)
- Computational Mathematics (AREA)
- Mathematical Analysis (AREA)
- Mathematical Optimization (AREA)
- Pure & Applied Mathematics (AREA)
- Computing 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 (3)
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; specifically, by using block chain cryptography and the randomness generated index values data1, data2, a random seed as input parameters, the reuse of TWO _ CMRES is based on a variant of the most random CMR of all reversible subcycle generators and is irreversible and has TWO subcycle generators to generate random numbers;
(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:
(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.
3. The random number generation method of claim 1, wherein the nanosecond timestamp is greenwich mean time.
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 CN110955407A (en) | 2020-04-03 |
CN110955407B true 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) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112306457B (en) * | 2020-08-07 | 2023-07-14 | 神州融安数字科技(北京)有限公司 | Random number generation method and device |
CN113282803B (en) * | 2021-06-17 | 2022-06-17 | 浙江毫微米科技有限公司 | Workload certification algorithm optimization method and device, computer equipment and storage medium |
Citations (7)
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 |
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 |
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 |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US11190495B2 (en) * | 2017-10-02 | 2021-11-30 | Colossio, Inc. | One-time-pad encryption |
US10938557B2 (en) * | 2018-03-02 | 2021-03-02 | International Business Machines Corporation | Distributed ledger for generating and verifying random sequence |
US10860462B2 (en) * | 2018-05-07 | 2020-12-08 | Proov Systems Ltd. | System, computer program product and method for enhanced production environment behavior mirroring E.G. while conducting pilot on proof-of-concept (PoC) platforms |
-
2019
- 2019-11-21 CN CN201911148550.7A patent/CN110955407B/en active Active
Patent Citations (7)
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 |
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 |
---|
基于聚合签名与加密交易的全匿名区块链;王子钰等;《计算机研究与发展》;20181015;全文 * |
Also Published As
Publication number | Publication date |
---|---|
CN110955407A (en) | 2020-04-03 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110955407B (en) | Random number taking method based on block chain | |
KR101389034B1 (en) | SHA Computing Method and SHA Computing Device | |
CN102857339B (en) | Secret distribution sharing and recovery recombining method based on sequences | |
CN116070206B (en) | Abnormal behavior detection method, system, electronic equipment and storage medium | |
CN107769923A (en) | A kind of true random-number generating method based on cpu clock and USB independent clocks | |
CN103455306A (en) | Double-line parallel high-speed random number generating device based on semiconductor ring laser | |
CN116071164B (en) | Digital asset tracing method based on blockchain management | |
CN106354475A (en) | High-performance random number generation method and generator | |
CN113938691A (en) | Reversible information hiding method for encrypted image | |
CN116346503B (en) | Encryption method and device for water carbon emission data based on full life cycle | |
Adewumi et al. | Inner for-loop for speeding up blockchain mining | |
CN111125193B (en) | Method, device, equipment and storage medium for identifying abnormal multimedia comments | |
CN1914847B (en) | Apparatus and method for generating random number using digital logic | |
CN110784315B (en) | Block chain-based number shaking method and device, computer equipment and storage medium | |
CN108319448B (en) | Method for realizing high-speed random extraction in random number generator | |
CN203480497U (en) | Two-way parallel high-speed random number generation device based on semiconductor ring laser | |
CN116149604A (en) | Source-independent quantum random number generation method | |
CN109951282B (en) | Pseudo-random sequence generation method based on segmented CUBIC chaotic mapping | |
CN104199635B (en) | The pseudorandom number generator of integrated CRC check circuit | |
CN109493045B (en) | Agricultural product tracing information storage method based on block chain | |
CN112613733A (en) | Intelligent management and control method and system for park energy | |
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 | |
CN112912838B (en) | Random number generation device and method | |
CN116243887B (en) | Software random number generation method and device |
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 |