2
\$\begingroup\$

I've been watching Minder DVDs and one of the extras from Series 6 is a Premium Bonds ad from 1986 which explains that their super-duper ERNIE 2 machine uses diodes (I think) that emit pulses at random intervals in order to generate random numbers for the prize draw. Unfortunately, I wasn't able to find the film on Youtube to link to! They were saying that the use of a physical randomising device makes predicting the results of the machine impossible but obviously it was an ad so they were selling a product! How good are these diodes in fact? How inexpensive would they (or similar hardware) be to add to a computer to generate random numbers instead of an algorithm? Would they produce "randomer" numbers than a time-seeded algorithm? I.e. would it be worth the cost of an extra component or are algorithms random enough for most uses?

\$\endgroup\$
  • \$\begingroup\$ For what it is worth, the average PC's PRNG is a bit more thoroughly thought of than just a "time-seeded algorithm". Nice article about Linux also discusses how the CSPRNG works. pthree.org/2014/07/21/the-linux-random-number-generator (CSPRNG = Cryptographically Secure Pseudo Random Number Generator). \$\endgroup\$ – jippie Mar 28 '15 at 8:47
2
\$\begingroup\$

There is a reasonably good article on Hardware random number generator at wikipedia.

Yes, you may want to add a 'True Random Number Generator' (TRNG) to a computer, and manufacturers do. In some applications, a TRNG is worth a premium price.

For example Sun Microsystems had a hardware random number generator board available as an extra cost option for some of their products, used for example in banking or e-commerce. It was worth paying the extra to generate a large number of truly random numbers at a high rate.

It is described at Sun Microsystems Sun Crypto Accelerator 6000

Software based random numbers use sources of entropy in the system to 'seed' their behaviour (say hard-disk head seek time). However those techniques require reasonable amounts of entropy to give them a good source of randomness. At very high rates of random number generation their isn't enough time to for the systems underlying sources of randomness to provide that. Hence the randomness may be inadequate.

Generating high quality random numbers isn't a problem restricted to web sites and the net. For example ST Micro implement a 'True Random Number Generator' on their STM32F2 and STM32F4 Cortex-M3 and Cortex-M4 Microcontrollers. Those devices are embedded devices, and so are intended to be used to implement cryptographically secure applications.

It is described in an application note called "AN4230 Application note: STM32F2xx, STM32F4xx random number generation validation using NIST statistical test suite"

It says

The True random number generator peripheral implemented on STM32 ..., and it is based on an analog circuit. This circuit generates a continuous analog noise that feed a Linear Feedback Shift Register (LFSR) in order to produce a 32-bit random number.

The analog circuit is made of several ring oscillators whose outputs are XORed."

\$\endgroup\$
0
\$\begingroup\$

You've asked several sub questions so I'll just address a couple. The whole topic of hardware random number generation is a huge multi disciplinary subject so'll I'll also further restrict this to diodes(*) and the concept of entropy.

Entropy is unpredictability, or surprisal. It comes from chaotic systems and quantum mechanics. You can think of it as rolling a die where the single spot is actually a piece of lead rather than paint. It will fall single spot down most of the time. But occasionally it will land otherwise. This is an entropy source with considerable bias as it mainly reads a "6". Most entropy sources in nature are either biased or have non uniform probability distributions. The entropy then gets converted to a uniformly distributed set of numbers via post processing and you have your true random number generator (TRNG). Like ERNIE.

The randomising diode is perfect for amateur and professional low rate random number generation. It's junction breaks down when reverse biased and creates totally unpredictable electrical noise. You can then process this entropy to extract random numbers. Maxim have a good application circuit based around a 1N759 Zener diode. Here's an extract:-

TRNG circuit

They've measured noise out to 100 MHz. If this were to be sampled at say 4 bits via a flash ADC, you might expect random numbers in the order of 100 Mbits /s. This is very much an upper limit as I've never seen a commercial diode based TRNG anywhere this speed. I'm quite chuffed to achieve 100 kbits /s.

ERNIE 1 used a similar diode like device called a thermionic valve typically used for voltage stabilisation.

You could make the point that a TRNG produces randomer random numbers than a pseudo random number generator (PRNG) but this is somewhat a semantic /philosophical argument. Some say that a TRNG is effectively the same as a PRNG as their respective outputs will be computationally indistinguishable from random. However, a PRNG is seeded with a start point and then manipulates this initial value algebraically to produce output. It you know the seed, you can totally predict the output. A TRNG has no seed. The seed is the physical diode itself and our current level of understanding means we cannot predict it's entropic output. John von Neumann famously said that "Any one who considers arithmetical methods of producing random digits is, of course, in a state of sin."

TRNGs sound sexy. The current ERNIE (5) is extremely slow yet is marketed as a wonderful truly unpredictable system drawing upon decades of nostalgia and anthropomorphism.

*Note: Some say that the emitter base junction in a transistor is a diode which can be used for similar randomness purposes. I would draw your attention to this question why you shouldn't.

\$\endgroup\$
  • 2
    \$\begingroup\$ Is this how one decouples a 100 MHz circuit, by sharing a capacitor? \$\endgroup\$ – Paul Uszak Mar 8 '17 at 23:30
  • \$\begingroup\$ Entropy is not randomness. It takes thousands of rolls to determine if a die is biased or not. If each spot of a die is actually a small piece of lead and the die is otherwise unbiased and with a density less than lead, the spot will cause it to land 6-side down (1-side up) more often than 1-side down (6-side up). The level of bias will be determined by the difference in densities between the die and the spots. \$\endgroup\$ – CJ Dennis Mar 9 '17 at 2:13
  • 1
    \$\begingroup\$ @CJDennis Some clarifications: Actually entropy is uncertainty aka randomness aka irreducible information. That's the accepted definition of information theory entropy. You've confusing entropy /randomness with uniformly distributed numbers. My dodgy die only has one lead spot on the Ace side so it will generally fall six side up. That's the bias. \$\endgroup\$ – Paul Uszak Mar 9 '17 at 3:19
-1
\$\begingroup\$

In history there have been some pretty mind blowing attempts to achieve a truly random result. I seem to recall one for an rpg website that claimed to be rolling diced based on intensity fluctuations of a laser (or something like that).

In general, no, you would not want to add a randomization circuit to a general purpose computer. The biggest reason is that if you come in a few pennies over the competition for a part, you tend to lose the largest parts of the market. Of course, this could become a feature of specialty devices, where it can be used to drive the price up - but in reality, software engineers can easily conjure up near true randomness on nearly any platform, so you likely won't find a need for this feature.

For instance, when I need a fairly random number, I simply recurse the seed function - get a random seed from the system time and then use that to draw an entirely new seed before I use the result.

\$\endgroup\$
  • \$\begingroup\$ The price competition argument only applies to commodity goods. A CPU (Intel or AMD) is nearer a luxury good which means that there is much less relationship between cost and price. I can flog CPUs for 25% extra by just calling them "Black". Free competition relies on total knowledge which is unavailable as there is no standard test for comparing CPU performance. So both Intel and AMD operate de facto monopolies in their respective sectors. \$\endgroup\$ – Paul Uszak Mar 8 '17 at 21:53
  • \$\begingroup\$ @PaulUszak, indeed. These observations were based on commodity pricing. Of course most industrial customers specify exactly whether or not they want this sort of thing. I suppose the better answer to the posted question is 'it really depends on what you need.' \$\endgroup\$ – Sean Boddy Mar 8 '17 at 22:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.