83 points · by jgrahamc · 13y ago · 26 comments
Another useful thing to know: there is lately a push towards crypto constructions that minimize dependencies on randomness. For example, there's "deterministic" DSA that replaces the nonce with a uncorrelated (psuedorandom) bits from digest functions. If you see people talking about cryptosystems being bad or good based on CSPRNG dependencies, that's the idea they're talking about.
This was a good post. For the record, we've been repeatedly trying and failing to hire Daniel Franke ever since that HN hack.
What's not to like about it?! The potential for multiple processes to share PRNG state after fork()s (unless the processes explicitly reseed)? The tri-state return value from the RAND_bytes() function (success, failure, more failure)?
You don't like them because the application might end believing it has more entropy than it really has or are there other reasons?
That notice has been there for a very long time, not sure what this period is...
(maybe they have run out of randomness!)
1) You need to generate keys that nobody can guess.
2) Much of modern crypto is built based on probabilistic encryption [1].
The kernel developers just don't think it's a good idea to blindly trust unauditable hardware random number generators. Using it in conjunction with other sources of entropy is one thing; just using it on its own is putting a bit too much faith in it, especially because the code that uses it uses a generic wrapper for any hardware random number generation instruction, so if AMD or ARM or MIPS chips later come with random number generators, the kernel will be able to take advantage of their entropy without putting itself at risk if one of them is backdoored.
There's a difference between fearing that something is backdoored, and thinking that it's not a good policy not to blindly trust something.
This means it might take more time to generate the required number of random bits. So not trusting RDRAND means a process might block waiting for random data.
Then again, hardware generators may be affected by external forces - other than the NSA. For example, CPU temperature.
On a related note, I noticed recently that the BCM2835 SoC in my Raspberry Pi has an RNG as well. I've been considering using it (off-line) to generate private keys for SSL certificates issued by our private CA.
/* the initial numbers generated are "less random" so will be discarded */
#define RNG_WARMUP_COUNT 0x40000
How was this magic value derived? Why are the initial (quarter million?) values "less random"? Where's a datasheet that describes this thing's operation?Of course the other images mostly make sense, but it would have been informative to have captions on some of them, such as the the second image, which has alt-text of "the three".
(von neumann is on the left, i think?)
I liked that photo because there's von Neumann who I referenced, Ulam because of the Monte Carlo method (https://en.wikipedia.org/wiki/Stanislaw_Ulam#Monte_Carlo_met...) and Feynman because, well, Feynman's cool.
EDIT: I knew Feynman. I did a Google image search which suggested Ulam, and also linked to here which has the image and a caption. (http://www.lanl.gov/science/1663/december2009/)