|RANDOM(4)||Device Drivers Manual||RANDOM(4)|
urandomdevice produces high quality pseudo-random output data without ever blocking, even immediately after booting. Entropy data is collected from system activity (such as disk, network, and clock device interrupts), and then used to key a stream cipher to generate the output.
urandom device is intended to be used
in scripts. In C programs, use the
arc4random(3) family of functions
instead, which can be called in almost all coding environments, including
pledge(2), and which avoids accessing a
device every time.
Never use /dev/random. On OpenBSD, it does the same as /dev/urandom, but on many other systems, it misbehaves. For example, it may block, directly return entropy instead of using a stream cipher, or only return data from hardware random generators.
randomdevice first appeared in Linux in 1994. The
urandomdevices have been available since OpenBSD 2.0.
|November 10, 2017||OpenBSD-current|