/dev/random vs /dev/urandom
This cluster discusses the differences, myths, and best practices for using /dev/random versus /dev/urandom as entropy sources in Unix-like systems, with many comments recommending /dev/urandom and linking to articles debunking outdated concerns about its security.
Activity Over Time
Top Contributors
Keywords
Sample Comments
Whatβs wrong with just using /dev/urandom for the entropy pool?
It's manpage also says the same.It is a cryptographically secure PRNG, but during a small time in system start up, it may not be correctly seeded.If you need long term keys, it may be better to get some 256 bits from /dev/random before using /dev/urandom.
You're completely wrong. According to the OpenBSD devs, on modern BSDs and Linux, /dev/urandom is as good a source of entropy as anything. It's commonly implemented by a good cryptographically secure pseudo-random generator. This code only gets called in cases where /dev/urandom is not available (for example in a chroot jail or when the file descriptor limit is reached).
Use /dev/urandom instead of /dev/randomhttp://www.2uo.de/myths-about-urandom/
No, that difference (between /dev/random and /dev/urandom) does not exist, has never existed and will never exist. Please don't spread those myths.
I think the Linux /dev/random already do this to some extent.
You probably want to use urandom instead of random. /dev/random will block if the entropy pool runs out whereas /dev/urandom will not.
Quite a long read, but I think it explains the situation quite well: https://www.2uo.de/myths-about-urandom/
And why /dev/urandom instead of /dev/random?
Since /dev/urandom and /dev/random draw from the same pool, it should be enough to simply read and throw away some bytes from /dev/random.