Jump to content

/dev/random

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by PhilipMW (talk | contribs) at 21:00, 3 July 2004 (First draft). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

In Unix-like operating systems, /dev/random is a virtual device that serves as a random number generator which

gathers environmental noise from device drivers and other sources into an entropy pool. The generator also keeps an estimate of the number of bits of noise in the entropy pool. From this entropy pool random numbers are created. When read, the /dev/random device will only return random bytes within the estimated number of bits of noise in the entropy pool. /dev/random should be suitable for uses that need very high quality randomness such as one-time pad or key generation. When the entropy pool is empty, reads from /dev/random will block until additional environmental noise is gathered. (Source: Linux Programmer's Manual, section 4)

It is typically used for providing a character stream for encryption, incompressible data, or securely overwriting files.

A counterpart to /dev/random is /dev/urandom which provides as much data as requested at the expense of guaranteed entropy.

See also