I’m using kubuntu with kernel 2.6.38-12-generic
I want to read 16 random numbers from /dev/random at the start of my program.
However, it blocks after a relatively short time.
How long does it take for the /dev/random buffer to fill? why is it taking so long to fill.
I’m using this as a uuid generator with other sources of randomness added to seed
my mersenne twister. It’s critical that I don’t get duplicates or a duplicate seed.
If I change to /dev/urandom it works ok. Any view on using /dev/random over /dev/urandom.
You really should never use
/dev/random. There are no known circumstances where the advantages of/dev/randomover/dev/urandommatter, and the disadvantages are pretty obvious.The difference is that
/dev/urandomprovides ‘merely’ cryptographically-secure random numbers while/dev/randomprovides truly random numbers (at least, that is what we believe). But there is no known situation where this difference matters and no known test that can distinguish “true” randomness from merely cryptographically-secure randomness.I usually joke that
/dev/urandomprovides water and/dev/randomprovides holy water.