Saturday, April 2, 2022

[SOLVED] Why does /dev/urandom not block?

Issue

I know that /dev/random blocks to wait for more entropy comes in, but why does /dev/urandom not block?

id='dv3'>

Solution

Because its purpose is not to block. That's literally what distinguishes it from /dev/random. So you don't have to worry about blocking, but the bits you get from it may not be quite as random as those from /dev/random.

According to the man page:

If there is not sufficient entropy in the entropy pool, the returned values from /dev/urandom are theoretically vulnerable to a cryptographic attack on the algorithms used by the driver.

The man page adds:

Knowledge of how to do this is not available in the current unclassified literature, but it is theoretically possible that such an attack may exist.



Answered By - Willis Blackburn
Answer Checked By - Marilyn (WPSolving Volunteer)