Why is reading / dev / random almost always blocked?

I am using kubuntu with a kernel 2.6.38-12-generic

I want to read 16 random numbers from / dev / random at the beginning of my program. However, it blocks after a relatively short time.

How long does it take to populate / dev / random buffer? why it takes so long to fill.

I use this as an uuid generator with other sources of randomness added to the seed of my mersenne twister. It is very important that I do not receive duplicate or duplicate seeds.

If I switch to / dev / urandom, it works fine. Any kind of use of / dev / random over / dev / urandom.

+5
source share
3 answers

/dev/random. , /dev/random over /dev/urandom , .

, /dev/urandom "" , /dev/random ( , , ). , , , "" .

, /dev/urandom , /dev/random .

+13

man 4 random :

/dev/random . /dev/random , , . , /dev/random .

, , ! , .

, , ( ), , , , Ethernet .. (, RDRAND ), USB- (. this) .. , /dev/random ( ). (, ) , , PRNG. , /dev/random (, ) ( ). , , .

Thomas Hühn /dev/urandom

+5

/dev/random , , , - . , .

/dev/urandom, , PRNG .

+4

All Articles