2 ms·
You're right, that was too short and thus too harsh. Please accept my apologies. So a short roundup: /dev/random and /dev/urandom used to be exactly the same
by Tomte 9y ago
You're right, that was too short and thus too harsh. Please accept my apologies.
So a short roundup:
/dev/random and /dev/urandom used to be exactly the same (on Linux), except that /dev/random did some voodoo "entropy estimation" that the Linux kernel guys are totally in love with, but everyone else doesn't trust anyway. Even if there was a plausible model how to estimate entropy, which there isn't.
In the meantime things have changed quite a bit. But the main thing to know is the same: /dev/urandom is the device you want to use for cryptographic randomness. /dev/random is an oddity that will be there forever because Linux takes backwards compatibility (for user space) extremely seriously.
(On other Unixoid platforms you also want /dev/urandom)
If you can use syscalls and don't need a device, use getrandom(2) over /dev/urandom. It's better.
Oh, and please note that the Linux man pages have been updated! They now state clearly that /dev/urandom is suitable for cryptographic use. Of course, lots of old man pages floating around on the web.