
/dev/random
Sign in to saveAlso known as /dev/urandom
thumb|upright=1.5|256 byte hex dump of In Unix-like operating systems, ' and ' 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 and .
~10 min read
Article
10 sectionsContents
- Linux
- Original implementation
- Entropy injection
- Critique of entropy injection
- BSD systems
- macOS, iOS and other Apple OSes
- Other operating systems
- See also
- References
- External links
thumb|upright=1.5|256 byte hex dump of In Unix-like operating systems, ' and ' 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 and .
When entropy available is low, will block; on newer systems, this typically happens at program startup until entropy is sufficient, before permanently unblocking. The device typically was never a blocking device, even if the pseudorandom number generator seed was not fully initialized with entropy since boot.