3 ms·
That blog post is old and inaccurate. It propagates myths about CSPRNGs that some have been trying to dispel, particularly Thomas Hühn [1] and djb [2]. /dev/ur
by rspeer 11y ago
That blog post is old and inaccurate. It propagates myths about CSPRNGs that some have been trying to dispel, particularly Thomas Hühn [1] and djb [2].
/dev/urandom is the same cryptographically secure PRNG as /dev/random, except that /dev/random will superstitiously block when it thinks entropy has been "consumed". (CSPRNGs do not meaningfully "consume" entropy.)
If you use /dev/random for the mythical warm fuzzies, you might also be misunderstanding other things. Don't be superstitious. Use /dev/urandom.
[1] http://www.2uo.de/myths-about-urandom/ http://www.2uo.de/myths-about-urandom/
[2] http://www.mail-archive.com/cryptography@randombit.net/msg04763.html http://www.mail-archive.com/cryptography@randombit.net/msg04...
- gizmo686 11y agoIf the system has not gathered any entropy, then /dev/random/ will output predictable numbers. You are consuming random numbers does not meaningfully consume entropy [0]. However, if you try to consume a random number before the system has generated entropy in the first place, then /dev/random will still happily give you non random numbers. Most desktop/servers will store entropy between boots, so this is mostly an issue for embeded to worry about, but still worth keeping in mind. [0] Technically, it is correct to say that we do consume entropy in an information theoretic sense. However, this is not particularly revelent, as the CSPRNG is still (believed to be) secure in a complexity theoretic sense. If it turns out that the CSPRNG is not secure in a complexity theoretic sense, then we have bigger issues to worry about then a broken RNG.
- rspeer 11y agoThis is a case that the pages I linked cover. Also, you mixed up random and urandom, but no matter. People should not code for the case where their distribution's boot sequence totally fucks up.
- Too 11y agoI've seen virtual machines having huge problems with entropy speed for random also, it's not just an issue for embedded.