Topic summary
/dev/random

In Unix-likeoperating systems, /dev/random and /dev/urandom are special files that provide random numbers from a cryptographically secure pseudorandom number generator (CSPRNG). The CSPRNG is seeded with entropy (a value that provides randomness) from environmental noise, collected from device drivers and other sources. Users can obtain random numbers from the CSPRNG simply by reading the file. Not all operating systems implement the same methods for /dev/random and /dev/urandom.
When entropy available is low, /dev/random will block; on newer systems, this typically happens at program startup until entropy is sufficient, before permanently unblocking. The /dev/urandom device typically was never a blocking device, even if the pseudorandom number generator seed was not fully initialized with entropy since boot.
This special file originated in Linux in 1994. It was quickly adopted by other Unix-like operating systems.