random number generation
{{Short description|Producing a sequence that cannot be predicted better than by random chance}}
{{Use American English|date=March 2024}}
File:Two red dice 01.svg are an example of a hardware random number generator. When a cubical die is rolled, a random number from 1 to 6 is obtained.|alt=]]
Random number generation is a process by which, often by means of a random number generator (RNG), a sequence of numbers or symbols is generated that cannot be reasonably predicted better than by random chance. This means that the particular outcome sequence will contain some patterns detectable in hindsight but impossible to foresee. True random number generators can be hardware random-number generators (HRNGs), wherein each generation is a function of the current value of a physical environment's attribute that is constantly changing in a manner that is practically impossible to model. This would be in contrast to so-called "random number generations" done by pseudorandom number generators (PRNGs), which generate numbers that only look random but are in fact predetermined—these generations can be reproduced simply by knowing the state of the PRNG.{{Citation |last=Lugrin |first=Thomas |title=Random Number Generator |date=2023 |work=Trends in Data Protection and Encryption Technologies |pages=31–34 |editor-last=Mulder |editor-first=Valentin |place=Cham |publisher=Springer Nature Switzerland |language=en |doi=10.1007/978-3-031-33386-6_7 |isbn=978-3-031-33386-6 |editor2-last=Mermoud |editor2-first=Alain |editor3-last=Lenders |editor3-first=Vincent |editor4-last=Tellenbach |editor4-first=Bernhard|doi-access=free }}
Various applications of randomness have led to the development of different methods for generating random data. Some of these have existed since ancient times, including well-known examples like the rolling of dice, coin flipping, the shuffling of playing cards, the use of yarrow stalks (for divination) in the I Ching, as well as countless other techniques. Because of the mechanical nature of these techniques, generating large quantities of sufficiently random numbers (important in statistics) required much work and time. Thus, results would sometimes be collected and distributed as random number tables.
Several computational methods for pseudorandom number generation exist. All fall short of the goal of true randomness, although they may meet, with varying success, some of the statistical tests for randomness intended to measure how unpredictable their results are (that is, to what degree their patterns are discernible). This generally makes them unusable for applications such as cryptography. However, carefully designed cryptographically secure pseudorandom number generators (CSPRNGS) also exist, with special features specifically designed for use in cryptography.
Practical applications and uses
{{Main|Applications of randomness}}
Random number generators have applications in gambling, statistical sampling, computer simulation, cryptography, completely randomized design, and other areas where producing an unpredictable result is desirable. Generally, in applications having unpredictability as the paramount feature, such as in security applications, hardware generators are generally preferred over pseudorandom algorithms, where feasible.
Pseudorandom number generators are very useful in developing Monte Carlo-method simulations, as debugging is facilitated by the ability to run the same sequence of random numbers again by starting from the same random seed. They are also used in cryptography – so long as the seed is secret. The sender and receiver can generate the same set of numbers automatically to use as keys.
The generation of pseudorandom numbers is an important and common task in computer programming. While cryptography and certain numerical algorithms require a very high degree of apparent randomness, many other operations only need a modest amount of unpredictability. Some simple examples might be presenting a user with a "random quote of the day", or determining which way a computer-controlled adversary might move in a computer game. Weaker forms of randomness are used in hash algorithms and in creating amortized searching and sorting algorithms.
Some applications that appear at first sight to be suitable for randomization are in fact not quite so simple. For instance, a system that "randomly" selects music tracks for a background music system must only appear random, and may even have ways to control the selection of music: a truly random system would have no restriction on the same item appearing two or three times in succession.
True vs. pseudo-random numbers
{{Main|Pseudorandom number generator|Hardware random number generator}}
{{See also|Cryptographically secure pseudorandom number generator}}
There are two principal methods used to generate random numbers. The first method measures some physical phenomenon that is expected to be random and then compensates for possible biases in the measurement process. Example sources include measuring atmospheric noise, thermal noise, and other external electromagnetic and quantum phenomena. For example, cosmic background radiation or radioactive decay as measured over short timescales represent sources of natural entropy (as a measure of unpredictability or surprise of the number generation process).
The speed at which entropy can be obtained from natural sources is dependent on the underlying physical phenomena being measured. Thus, sources of naturally occurring true entropy are said to be blocking{{snd}} they are rate-limited until enough entropy is harvested to meet the demand. On some Unix-like systems, including most Linux distributions, the pseudo device file {{Mono|/dev/random}} will block until sufficient entropy is harvested from the environment.{{man|4|random|Linux}} Due to this blocking behavior, large bulk reads from {{Mono|/dev/random}}, such as filling a hard disk drive with random bits, can often be slow on systems that use this type of entropy source.
The second method uses computational algorithms that can produce long sequences of apparently random results, which are in fact completely determined by a shorter initial value, known as a seed value or key. As a result, the entire seemingly random sequence can be reproduced if the seed value is known. This type of random number generator is often called a pseudorandom number generator. This type of generator typically does not rely on sources of naturally occurring entropy, though it may be periodically seeded by natural sources. This generator type is non-blocking, so they are not rate-limited by an external event, making large bulk reads a possibility.
Some systems take a hybrid approach, providing randomness harvested from natural sources when available, and falling back to periodically re-seeded software-based cryptographically secure pseudorandom number generators (CSPRNGs). The fallback occurs when the desired read rate of randomness exceeds the ability of the natural harvesting approach to keep up with the demand. This approach avoids the rate-limited blocking behavior of random number generators based on slower and purely environmental methods.
While a pseudorandom number generator based solely on deterministic logic can never be regarded as a true random number source in the purest sense of the word, in practice they are generally sufficient even for demanding security-critical applications. Carefully designed and implemented pseudorandom number generators can be certified for security-critical cryptographic purposes, as is the case with the yarrow algorithm and fortuna. The former is the basis of the {{Mono|/dev/random}} source of entropy on FreeBSD, AIX, macOS, NetBSD, and others. OpenBSD uses a pseudorandom number algorithm known as arc4random.{{dubious|date=August 2023}}{{man|3|arc4random|OpenBSD}}
Generation methods
= Physical methods =
{{Main|Hardware random number generator}}
The earliest methods for generating random numbers, such as dice, coin flipping and roulette wheels, are still used today, mainly in games and gambling as they tend to be too slow for most applications in statistics and cryptography.
A hardware random number generator can be based on an essentially random atomic or subatomic physical phenomenon whose unpredictability can be traced to the laws of quantum mechanics.{{cite journal |last1=Herrero-Collantes |first1=Miguel |last2=Garcia-Escartin |first2=Juan Carlos |title=Quantum random number generators |journal=Reviews of Modern Physics |date=2016 |volume=89 |page=015004 |doi=10.1103/RevModPhys.89.015004 |arxiv=1604.03304|s2cid=118592321 }}{{cite journal |last1=Jacak |first1=Marcin M. |last2=Jóźwiak |first2=Piotr |last3=Niemczuk |first3=Jakub |last4=Jacak |first4=Janusz E. |title=Quantum generators of random numbers |journal=Scientific Reports |date=2021 |volume=11 |issue=1 |page=16108 |doi=10.1038/s41598-021-95388-7 |pmid=34373502 |pmc=8352985 |doi-access=free}} Sources of entropy include radioactive decay, thermal noise, shot noise, avalanche noise in Zener diodes, clock drift, the timing of actual movements of a hard disk read-write head, and radio noise. However, physical phenomena and tools used to measure them generally feature asymmetries and systematic biases that make their outcomes not uniformly random. A randomness extractor, such as a cryptographic hash function, can be used to approach a uniform distribution of bits from a non-uniformly random source, though at a lower bit rate.
The appearance of wideband photonic entropy sources, such as optical chaos and amplified spontaneous emission noise, greatly aid the development of the physical random number generator. Among them, optical chaos{{Cite journal|last1=Li|first1=Pu|last2=Wang|first2=Yun-Cai|last3=Zhang|first3=Jian-Zhong|date=2010-09-13|title=All-optical fast random number generator|journal=Optics Express|volume=18|issue=19|pages=20360–20369|doi=10.1364/OE.18.020360|pmid=20940928|bibcode=2010OExpr..1820360L|issn=1094-4087|doi-access=free}}{{Cite journal|last1=Li|first1=Pu|last2=Sun|first2=Yuanyuan|last3=Liu|first3=Xianglian|last4=Yi|first4=Xiaogang|last5=Zhang|first5=Jianguo|last6=Guo|first6=Xiaomin|last7=Guo|first7=Yanqiang|last8=Wang|first8=Yuncai|date=2016-07-15|title=Fully photonics-based physical random bit generator|journal=Optics Letters|volume=41|issue=14|pages=3347–3350|doi=10.1364/OL.41.003347|pmid=27420532|bibcode=2016OptL...41.3347L| s2cid=2909061 |issn=1539-4794}} has a high potential to physically produce high-speed random numbers due to its high bandwidth and large amplitude. A prototype of a high-speed, real-time physical random bit generator based on a chaotic laser was built in 2013.{{Cite journal|last1=Wang|first1=Anbang|last2=Li|first2=Pu|last3=Zhang|first3=Jianguo|last4=Zhang|first4=Jianzhong|last5=Li|first5=Lei|last6=Wang|first6=Yuncai|date=2013-08-26|title=4.5 Gbps high-speed real-time physical random bit generator|journal=Optics Express|volume=21|issue=17|pages=20452–20462|doi=10.1364/OE.21.020452|pmid=24105589|bibcode=2013OExpr..2120452W|s2cid=10397141|issn=1094-4087|doi-access=free}}
Various imaginative ways of collecting this entropic information have been devised. One technique is to run a hash function against a frame of a video stream from an unpredictable source. Lavarand used this technique with images of a number of lava lamps. [http://www.fourmilab.ch/hotbits/ HotBits] measured radioactive decay with Geiger–Muller tubes,{{cite web
| last = Walker
| first = John
| title = HotBits: Genuine Random Numbers
| url = http://www.fourmilab.ch/hotbits/
| access-date = 2009-06-27 }} while Random.org uses variations in the amplitude of atmospheric noise recorded with a normal radio.
Another common entropy source is the behavior of human users of the system. While people are not considered good randomness generators upon request, they generate random behavior quite well in the context of playing mixed strategy games.{{cite web
| author = Halprin, Ran
| author2 = Naor, Moni
| author-link2 = Moni Naor
| title = Games for Extracting Randomness
|website=Weizmann Institute of Science
| url = http://www.wisdom.weizmann.ac.il/~neko/games4rand.pdf
|archive-url=https://web.archive.org/web/20110807193128/http://www.wisdom.weizmann.ac.il/~neko/games4rand.pdf |archive-date=2011-08-07
| access-date = 2009-06-27
}} Some security-related computer software requires the user to make a lengthy series of mouse movements or keyboard inputs to create sufficient entropy needed to generate random keys or to initialize pseudorandom number generators.{{cite web
| last = TrueCrypt Foundation
| title = TrueCrypt Beginner's Tutorial, Part 3
| url = http://www.truecrypt.org/docs/?s=tutorial3
| access-date = 2009-06-27 }}
= Computational methods =
{{main|Pseudorandom number generation}}
Most computer-generated random numbers use PRNGs which are algorithms that can automatically create long runs of numbers with good random properties but eventually the sequence repeats (or the memory usage grows without bound). These random numbers are fine in many situations but are not as random as numbers generated from electromagnetic atmospheric noise used as a source of entropy.{{Cite web|title = RANDOM.ORG – True Random Number Service|url = https://www.random.org/|website = www.random.org|access-date = 2016-01-14}} The series of values generated by such algorithms is generally determined by a fixed number called a seed. One of the most common PRNG is the linear congruential generator, which uses the recurrence
:
to generate numbers, where {{mvar|a}}, {{mvar|b}} and {{mvar|m}} are large integers, and is the next in {{mvar|X}} as a series of pseudorandom numbers. The maximum number of numbers the formula can produce is the modulus, {{mvar|m}}. The recurrence relation can be extended to matrices to have much longer periods and better statistical properties
| title = High Dimensionality Pseudo Random Number Generators
| url = http://www.ianschumacher.ca/prng/article.html
| access-date = 2018-11-21 }}
To avoid certain non-random properties of a single linear congruential generator, several such random number generators with slightly different values of the multiplier coefficient, {{mvar|a}}, can be used in parallel, with a master random number generator that selects from among the several different generators.
A simple pen-and-paper method for generating random numbers is the so-called middle-square method suggested by John von Neumann. While simple to implement, its output is of poor quality. It has a very short period and severe weaknesses, such as the output sequence almost always converging to zero. A recent innovation is to combine the middle square with a Weyl sequence. This method produces high-quality output through a long period.{{cite arXiv |last1=Widynski |first1=Bernard |title=Middle-Square Weyl Sequence RNG |eprint=1704.00358 |date=19 May 2020|class=cs.CR }}
Most computer programming languages include functions or library routines that provide random number generators. They are often designed to provide a random byte or word, or a floating point number uniformly distributed between 0 and 1.
The quality i.e. randomness of such library functions varies widely from completely predictable output, to cryptographically secure. The default random number generator in many languages, including Python, Ruby, R, IDL and PHP is based on the Mersenne Twister algorithm and is not sufficient for cryptography purposes, as is explicitly stated in the language documentation. Such library functions often have poor statistical properties, and some will repeat patterns after only tens of thousands of trials. They are often initialized using a computer's real-time clock as the seed, since such a clock is 64 bit and measures in nanoseconds, far beyond the person's precision. These functions may provide enough randomness for certain tasks (for example video games) but are unsuitable where high-quality randomness is required, such as in cryptography applications, or statistics.{{Cite journal|last1=Matsumoto|first1=M.|last2=Nishimura|first2=T.|date=1998|title=MersenneTwister: A 623-dimensionally Equidistributed Uniform Pseudo-Random Number Generator|journal=ACM Transactions on Modeling and Computer Simulation|volume=8|issue=1|pages=3–30|doi=10.1145/272991.272995|citeseerx=10.1.1.215.1141|s2cid=3332028 }}
Much higher quality random number sources are available on most operating systems; for example /dev/random on various BSD flavors, Linux, Mac OS X, IRIX, and Solaris, or CryptGenRandom for Microsoft Windows. Most programming languages, including those mentioned above, provide a means to access these higher-quality sources.
= By humans =
Random number generation may also be performed by humans, in the form of collecting various inputs from end users and using them as a randomization source. However, most studies find that human subjects have some degree of non-randomness when attempting to produce a random sequence of e.g. digits or letters. They may alternate too much between choices when compared to a good random generator;{{Cite journal
| author = W. A. Wagenaar
| title = Generation of random sequences by human subjects: a critical survey of the literature
| journal = Psychological Bulletin
| year = 1972
| volume = 77
| issue = 1
| pages = 65–72
| doi = 10.1037/h0032060
| citeseerx = 10.1.1.211.9085
}} thus, this approach is not widely used. However, for the very reason that humans perform poorly in this task, human random number generation can be used as a tool to gain insights into brain functions otherwise not accessible.{{Cite journal
| author = W. A. Wagenaar
| title = Generation of random sequences by human subjects: a critical survey of the literature
| journal = Psychological Bulletin
| year = 1972
| volume = 77
| issue = 1
| pages = 65–72
| doi = 10.1037/h0032060
| citeseerx = 10.1.1.211.9085
}}
Post-processing and statistical checks
{{See also|Randomness tests|Statistical randomness|List of random number generators}}
Even given a source of plausible random numbers (perhaps from a quantum mechanically based hardware generator), obtaining numbers which are completely unbiased takes care. In addition, behavior of these generators often changes with temperature, power supply voltage, the age of the device, or other outside interference.
Generated random numbers are sometimes subjected to statistical tests before use to ensure that the underlying source is still working, and then post-processed to improve their statistical properties. An example would be the TRNG9803{{cite web|last=Dömstedt|first=B.|title=TRNG9803 True Random Number Generator|url=http://www.trng98.se/serial_trng_9803.html|publisher=www.TRNG98.se|location=Manufacturer|year=2009}} hardware random number generator, which uses an entropy measurement as a hardware test, and then post-processes the random sequence with a shift register stream cipher. It is generally hard to use statistical tests to validate the generated random numbers. Wang and Nicol{{cite book|last=Wang|first=Yongge|publisher=Springer LNCS|location=Heidelberg|year=2014|doi=10.1007/978-3-319-11203-9_26|title=Computer Security - ESORICS 2014|volume=8712|pages=454–471|series=Lecture Notes in Computer Science|isbn=978-3-319-11202-2|chapter=Statistical Properties of Pseudo Random Sequences and Experiments with PHP and Debian OpenSSL}} proposed a distance-based statistical testing technique that is used to identify the weaknesses of several random generators. Li and Wang{{Cite journal|last1=Li|first1=Pu|last2=Yi|first2=Xiaogang|last3=Liu|first3=Xianglian|last4=Wang|first4=Yuncai|last5=Wang|first5=Yongge|date=2016-07-11|title=Brownian motion properties of optoelectronic random bit generators based on laser chaos|journal=Optics Express|volume=24|issue=14|pages=15822–15833|doi=10.1364/OE.24.015822|pmid=27410852|bibcode=2016OExpr..2415822L|issn=1094-4087|doi-access=free}} proposed a method of testing random numbers based on laser chaotic entropy sources using Brownian motion properties.
Statistical tests are also used to give confidence that the post-processed final output from a random number generator is truly unbiased, with numerous randomness test suites being developed.
Other considerations
= Reshaping the distribution =
== Uniform distributions ==
Most random number generators natively work with integers or individual bits, so an extra step is required to arrive at the canonical uniform distribution between 0 and 1. The implementation is not as trivial as dividing the integer by its maximum possible value. Specifically:{{cite conference |last1=Goualard |first1=F. |title=Computational Science – ICCS 2020 |chapter=Generating Random Floating-Point Numbers by Dividing Integers: A Case Study |series=Lecture Notes in Computer Science |conference=ICCS |date=2020 |volume=12138 |pages=15–28 |doi=10.1007/978-3-030-50417-5_2 |isbn=978-3-030-50416-8 |s2cid=219889587|doi-access=free }}{{cite web |last1=Campbell |first1=Taylor R. |title=Uniform random floats: How to generate a double-precision floating-point number in [0, 1] uniformly at random given a uniform random source of bits |url=http://mumble.net/~campbell/2014/04/28/uniform-random-float |access-date=4 September 2021 |date=2014}}
- The integer used in the transformation must provide enough bits for the intended precision.
- The nature of floating-point math itself means there exists more precision the closer the number is to zero. This extra precision is usually not used due to the sheer number of bits required.
- Rounding error in division may bias the result. At worst, a supposedly excluded bound may be drawn contrary to expectations based on real-number math.
The mainstream algorithm, used by OpenJDK, Rust, and NumPy, is described in a proposal for C++'s STL. It does not use the extra precision and suffers from bias only in the last bit due to round-to-even.{{cite web |title=A new specification for std::generate_canonical |url=http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0952r0.html |website=www.open-std.org}} Other numeric concerns are warranted when shifting this canonical uniform distribution to a different range.{{cite web |last1=Goualard |first1=Frédéric |title=Drawing random floating-point numbers from an interval |url=https://hal.archives-ouvertes.fr/hal-03282794 |website=HAL |access-date=4 September 2021 |date=July 2021}} A proposed method for the Swift programming language claims to use the full precision everywhere.{{cite web |last1=NevinBR |title=[stdlib] Floating-point random-number improvements by NevinBR · Pull Request #33560 · apple/swift |url=https://github.com/apple/swift/pull/33560 |website=GitHub |language=en}}
Uniformly distributed integers are commonly used in algorithms such as the Fisher–Yates shuffle. Again, a naive implementation may induce a modulo bias into the result, so more involved algorithms must be used. A method that nearly never performs division was described in 2018 by Daniel Lemire,{{cite journal |last1=Lemire |first1=Daniel |title=Fast Random Integer Generation in an Interval |journal=ACM Transactions on Modeling and Computer Simulation |date=23 February 2019 |volume=29 |issue=1 |pages=1–12 |doi=10.1145/3230636 |arxiv=1805.10941|s2cid=44061046 }} with the current state-of-the-art being the arithmetic encoding-inspired 2021 "optimal algorithm" by Stephen Canon of Apple Inc.{{cite web |title=An optimal algorithm for bounded random integers by stephentyrone · Pull Request #39143 · apple/swift |url=https://github.com/apple/swift/pull/39143 |website=GitHub |language=en}}
Most 0 to 1 RNGs include 0 but exclude 1, while others include or exclude both.
== Other distributions ==
{{main|Pseudo-random number sampling}}
{{see also|cumulative distribution function|quantile function}}
Given a source of uniform random numbers, there are a couple of methods to create a new random source that corresponds to a probability density function. One method called the inversion method, involves integrating up to an area greater than or equal to the random number (which should be generated between 0 and 1 for proper distributions). A second method called the acceptance-rejection method, involves choosing an x and y value and testing whether the function of x is greater than the y value. If it is, the x value is accepted. Otherwise, the x value is rejected and the algorithm tries again.{{cite web | last = The MathWorks | title = Common generation methods | url = https://www.mathworks.com/help/stats/generating-random-data.html#br5k9hi-1 | access-date = 2024-09-08 }}{{ cite web | last = The Numerical Algorithms Group | title = G05 – Random Number Generators | work = NAG Library Manual, Mark 23 | url = http://www.nag.co.uk/numeric/fl/nagdoc_fl23/pdf/G05/g05intro.pdf | access-date = 2012-02-09 }}
As an example for rejection sampling, to generate a pair of statistically independent standard normally distributed random numbers (x, y), one may first generate the polar coordinates (r, θ), where r2~χ22 and θ~UNIFORM(0,2π) (see Box–Muller transform).
= Whitening =
The outputs of multiple independent RNGs can be combined (for example, using a bit-wise XOR operation) to provide a combined RNG at least as good as the best RNG used. This is referred to as software whitening.
Computational and hardware random number generators are sometimes combined to reflect the benefits of both kinds. Computational random number generators can typically generate pseudorandom numbers much faster than physical generators, while physical generators can generate true randomness.
Low-discrepancy sequences as an alternative
Some computations making use of a random number generator can be summarized as the computation of a total or average value, such as the computation of integrals by the Monte Carlo method. For such problems, it may be possible to find a more accurate solution by the use of so-called low-discrepancy sequences, also called quasirandom numbers. Such sequences have a definite pattern that fills in gaps evenly, qualitatively speaking; a truly random sequence may, and usually does, leave larger gaps.
Activities and demonstrations
The following sites make available random number samples:
- The SOCR resource pages contain a number of hands-on interactive activities and demonstrations of random number generation using Java applets.
- The Quantum Optics Group at the ANU generates random numbers sourced from quantum vacuum. Samples of random numbers are available at their quantum random number generator research page.
- Random.org makes available random numbers that are sourced from the randomness of atmospheric noise.
- The Quantum Random Bit Generator Service at the Ruđer Bošković Institute harvests randomness from the quantum process of photonic emission in semiconductors. They supply a variety of ways of fetching the data, including libraries for several programming languages.
- The Group at the Taiyuan University of Technology generates random numbers sourced from a chaotic laser. Samples of random numbers are available at their physical random number generator service.
Backdoors
{{Main|Random number generator attack}}
{{Further |Backdoor (computing)}}
Since much cryptography depends on a cryptographically secure random number generator for key and cryptographic nonce generation, if a random number generator can be made predictable, it can be used as backdoor by an attacker to break the encryption.
The NSA is reported to have inserted a backdoor into the NIST certified cryptographically secure pseudorandom number generator Dual EC DRBG. If for example an SSL connection is created using this random number generator, then according to Matthew Green it would allow NSA to determine the state of the random number generator, and thereby eventually be able to read all data sent over the SSL connection.{{cite web|url=http://blog.cryptographyengineering.com/2013/09/the-many-flaws-of-dualecdrbg.html|title=The Many Flaws of Dual_EC_DRBG|author=matthew Green|date=2013-09-18}} Even though it was apparent that Dual_EC_DRBG was a very poor and possibly backdoored pseudorandom number generator long before the NSA backdoor was confirmed in 2013, it had seen significant usage in practice until 2013, for example by the prominent security company RSA Security.{{cite web|url=http://blog.cryptographyengineering.com/2013/09/rsa-warns-developers-against-its-own.html|title=RSA warns developers not to use RSA products|author=Matthew Green|date=2013-09-20}} There have subsequently been accusations that RSA Security knowingly inserted a NSA backdoor into its products, possibly as part of the Bullrun program. RSA has denied knowingly inserting a backdoor into its products.{{cite web|url=https://arstechnica.com/security/2013/09/we-dont-enable-backdoors-in-our-crypto-products-rsa-tells-customers/|title=We don't enable backdoors in our crypto products, RSA tells customers|website=Ars Technica|date=2013-09-20}}
It has also been theorized that hardware RNGs could be secretly modified to have less entropy than stated, which would make encryption using the hardware RNG susceptible to attack. One such method that has been published works by modifying the dopant mask of the chip, which would be undetectable to optical reverse-engineering.{{cite web|url=https://arstechnica.com/security/2013/09/researchers-can-slip-an-undetectable-trojan-into-intels-ivy-bridge-cpus/|title=Researchers can slip an undetectable trojan into Intel's Ivy Bridge CPUs|website=Ars Technica|date=2013-09-18}} For example, for random number generation in Linux, it is seen as unacceptable to use Intel's RDRAND hardware RNG without mixing in the RDRAND output with other sources of entropy to counteract any backdoors in the hardware RNG, especially after the revelation of the NSA Bullrun program.{{cite web|url=https://plus.google.com/117091380454742934025/posts/SDcoemc9V3J|title=I am so glad I resisted pressure from Intel engineers to let /dev/random rely only on the RDRAND instruction. |publisher=Google Plus|author=Theodore Ts'o}}{{cite web|url=https://lwn.net/Articles/567077/|title=Re: [PATCH] /dev/random: Insufficient of entropy on many architectures|publisher=LWN|author=Theodore Ts'o}}
In 2010, a U.S. lottery draw was rigged by the information security director of the Multi-State Lottery Association (MUSL), who surreptitiously installed backdoor malware on the MUSL's secure RNG computer during routine maintenance.{{cite news|last1=Nestel|first1=M.L.|title=Inside the Biggest Lottery Scam Ever|url=http://www.thedailybeast.com/articles/2015/07/07/inside-the-biggest-lottery-scam-ever.html|access-date=July 10, 2015|newspaper=The Daily Beast|date=July 7, 2015}} During the hacks the man won a total amount of $16,500,000 over multiple years.
See also
{{Div col|colwidth=22em}}
- Flipism
- League of entropy
- List of random number generators
- PP (complexity)
- Procedural generation
- Randomized algorithm
- Random password generator
- Random variable, contains a chance-dependent value
{{Div col end}}
References
{{Reflist|30em}}
Further reading
- {{cite book
| title = The Art of Computer Programming
| author = Donald Knuth
| author-link = Donald Knuth
| volume = 2: Seminumerical algorithms
| chapter = Chapter 3 – Random Numbers
| year = 1997
| edition = 3
| title-link = The Art of Computer Programming
}}
- {{cite conference
| title = History of Uniform Random Number Generation
| last = L'Ecuyer
| first = Pierre
| author-link = Pierre L'Ecuyer
| book-title = Proceedings of the 2017 Winter Simulation Conference
| pages = 202–230
| year = 2017
| publisher = IEEE Press
| url = https://www.informs-sim.org/wsc17papers/includes/files/016.pdf
}}
- {{cite encyclopedia
| chapter = Random Number Generation
| last = L'Ecuyer
| first = Pierre
| author-link = Pierre L'Ecuyer
| encyclopedia = Handbook of Computational Statistics
|editor1= J. E. Gentle |editor2=W. Haerdle |editor3=Y. Mori
| edition = second
| pages = 35–71
| year = 2012
| publisher = Springer-Verlag
| doi = 10.1007/978-3-642-21551-3_3
| isbn = 978-3-642-21550-6
| title = Handbook of Computational Statistics: Concepts and Methods
| hdl = 10419/22195
| chapter-url= https://www.econstor.eu/bitstream/10419/22195/1/21_pl.pdf
| hdl-access= free
}}
- {{Cite book
|title=Handbook of Monte Carlo Methods | chapter = Chapter 1 – Uniform Random Number Generation|last=Kroese |first=D. P. |author-link1=Dirk Kroese |author2=Taimre, T. |author3=Botev, Z.I. |year=2011
|publisher= John Wiley & Sons |location=New York |isbn=978-0-470-17793-8 |page=772 |chapter-url=http://www.montecarlohandbook.org }}
- {{Cite book | last1=Press | first1=WH | last2=Teukolsky | first2=SA | last3=Vetterling | first3=WT | last4=Flannery | first4=BP | year=2007 | title=Numerical Recipes: The Art of Scientific Computing | edition=3rd | publisher=Cambridge University Press | location=New York | isbn=978-0-521-88068-8 | chapter=Chapter 7. Random Numbers | chapter-url=http://apps.nrbook.com/empanel/index.html#pg=340 }}
- [http://csrc.nist.gov/publications/PubsSPs.html NIST SP800-90A, B, C series on random number generation]
- {{cite journal|author1=M. Tomassini |author2=M. Sipper |author3=M. Perrenoud |title=On the generation of high-quality random numbers by two-dimensional cellular automata |journal=IEEE Transactions on Computers |volume=49 |number=10 |pages=1146–1151 |date=October 2000|doi=10.1109/12.888056 |s2cid=10139169 }}
External links
- [https://random.org RANDOM.ORG] True Random Number Service
- [https://qrng.anu.edu.au Quantum random number generator] at ANU
- {{In Our Time|Random and Pseudorandom|b00x9xjb}}
- [https://sites.google.com/site/simulationarchitecture/jrand jRand] a Java-based framework for the generation of simulation sequences, including pseudorandom sequences of numbers
- [http://www.nag.co.uk/numeric/fl/nagdoc_fl24/html/G05/g05conts.html Random number generators in NAG Fortran Library]
- [https://www.nist.gov/itl/csd/ct/nist_beacon.cfm Randomness Beacon] at NIST, broadcasting full entropy bit-strings in blocks of 512 bits every 60 seconds. Designed to provide unpredictability, autonomy, and consistency.
- [https://lwn.net/Articles/606141/ A system call for random numbers: getrandom()], a LWN.net article describing a dedicated Linux system call
- [https://link.springer.com/chapter/10.1007%2F978-3-319-11203-9_26 Statistical Properties of Pseudo Random Sequences and Experiments with PHP and Debian OpenSSL]
- [http://holdenc.altervista.org/avalanche/ Random Sequence Generator based on Avalanche Noise]
- [https://www.rnggenerator.com/ Cryptographically Enhanced PRNG]
{{Authority control}}