True Random Number Generator for a True Hacker (2015)
hackaday.com
hackaday.com
Heat-entropy is of course one of the best and truest sources of random number generation. But a temperature sensor is far more complicated than what you actually need.
All resistors vary their resistance by temperature. This is called Johnson Nyquist noise (https://en.wikipedia.org/wiki/Johnson%E2%80%93Nyquist_noise). Effectively, every resistor you have on the board is generating white noise.
The question is how to cleanly separate the white noise out, amplify it to measurable levels, and then how to feed that into a computer. Various "white noise generators" trace their true entropy to heat noise (ex: Intel's RDRAND assembly instruction has an oscillator which likely varies due to circuit-level heat noise).
I bet that the voltage across any 10 MOhm resistor would be very noisy, and that could probably be a source of noise for any hardware generator design. The issue with MOhm level resistors is that you start to vary the resistance with physical interaction (a human is in the single-digit MOhm region: so if a human touches the circuit board, the circuit may drop its resistance down to 5MOhms or less, which could affect your circuit design very severely).
On Linux you can just feed /dev/random with whatever data you want, and it will be part of your seed.
Mildly related and fun: https://electronics.stackexchange.com/questions/274606/whats...
(if you spend a bajillion dollars to set up a 32-bit ADC with everything needed, and have a 100C range, you get increments of 100/2^32 = 2.33e-8, now that's precise! This probably would be a bad way to get randomness for about 20 other reasons, though)
I've been looking at ways to get cryptographically secure random bytes on low power micros, and that's the approach I'm taking. The standard for CSPRNGs is AES-GCM, which is a bit heavy, though. Anyone know if Fortuna still acceptable to use?
The ChaosKey is a standard back-to-back transistor-amplifier, likely using Shot-noise or maybe Avalanche Noise as its source of randomness. Nonetheless, I find it to be not too useful, because any modern chip has RDRAND or RDSEED assembly instructions (which the Intel and AMD CPUs use a simple RNG to generate true randomness to those instructions).
So the only reason you'd be building a hardware RNG is because... you're building a hardware design to begin with. The cool thing about this post is that it requires ONLY the microcontroller (no need for the ADC or back-to-back transistors that ChaosKey's design has).
ChaosKey looks like a standard white-noise generator hooked up to a USB Stick. Learning of other methodologies (like what is discussed in Hackaday) is kind of more interesting.
More fun
That device ran for literally ages, mostly to produce massive input files for DIEHARDER to attempt to prove its worth as a RNG. I am sure it did that more often than it was used to seed the Linux /dev/random.
The project was also fun because of the "every last cycle" optimization of AVR assembler code to achieve the 2Mb/s generation rate of whitened bits.
BTW, Do you have an up to date software. I remember I run into trouble the last time I tried to use it.
Great project. Thanks a lot.
The idea is cool: like how to get a random flips out of a biased coin, as long as each flip is independent. You flip the coin twice, repeatedly for as long as you obtain two equal results. Upon your first encounter of two different results, you map (tails,head) to tails and (head,tails) to head. That way you obtain an unbiased toss.
Yeah, its a lot easier to make an RNG if someone already made one for you. How did you create the white-noise signal itself??
----------------
The question is: where did the white-noise come from? And is there any physical way we can "prove" that the white-noise makes a good generator?
The simplest design (IMO anyway) is to start with the Shot Noise (https://en.wikipedia.org/wiki/Shot_noise) that has been well documented in the NP-junction (NPN Transistors, Diodes, etc. etc). The simplest NP-junction is your standard diode... and then just measure the current that goes through that diode (especially if its backwards)
You can measure that current through a series of amplifiers: BJT Transistors to hone in on the noise and amplify it to measurable levels. Then use a microcontroller to read that.
----------------
I'm no expert on hardware RNGs / white noise generators, but that's the kind of thinking you'd need to make one. You have to start with a principle source of noise, and then build a design to amplify that noise as cleanly as possible.
------------------
The hypothesis of this "hackaday" post is that the bootup of uninitialized RAM is a true source of randomness. I'm inclined to believe it (at least, the experimental results show it is at least somewhat reliable), but I'm not 100% sure why.
Feeding in white noise though requires something to generate that white noise. When extra hardware is available you absolutely generate that noise and getting a higher quality and more reliable source of randomness.
POTUS Thomas Jefferson invented a really amazing encryption machine in 18th century using a quasi-pseudo-random arrangement which utilized the ancient encryption art of Steganography. (See: Jefferson Wheel Cypher). It helped us beat the Brits here in USA and abroad. :P
But random numbers are also used to generate public/private key combinations, which can be used for live communication after a handshake.