RANDOM(4) BSD Programmer's Manual RANDOM(4)
random, srandom, urandom, prandom, wrandom, arandom - random data source
devices
#include <sys/types.h>
#include <dev/rndvar.h>
#include <dev/rndioctl.h>
The various random devices produce random output data with different ran-
dom qualities. Entropy data is collected from system activity (like disk
and network device interrupts and such), and then run through various
hash or message digest functions to generate the output.
/dev/random This device is reserved for future support of hardware
random generators.
/dev/srandom Strong random data. This device returns reliable random
data. If sufficient entropy is not currently available
(i.e., the entropy pool quality starts to run low), the
driver pauses while more of such data is collected. The
entropy pool data is converted into output data using MD5.
/dev/urandom Same as above, but does not guarantee the data to be
strong. The entropy pool data is converted into output
data using MD5. When the entropy pool quality runs low,
the driver will continue to output data.
/dev/prandom Simple pseudo-random generator.
/dev/wrandom This device is actually the same as /dev/prandom, but can
be written to by regular users, even if this interface is
simulated using pipes or other means on other operating
systems where /dev/prandom can only be read from.
/dev/arandom As required, entropy pool data re-seeds an ARC4 generator,
which then generates high-quality pseudo-random output
data.
The arc4random(3) function in userland libraries seeds it-
self from this device, providing a second level of ARC4
hashed data.
The arc4random_push(3) and arc4random_pushb(3) functions, writes to the
KERN_ARND sysctl(3) and writes to /dev/wrandom feed data back to the ker-
nel into a buffer of 32 32-bit integers. This interface can be disabled
if desired by setting the KERN_PUSHRAND sysctl(3).
/dev/random
/dev/srandom
/dev/urandom
/dev/prandom
/dev/arandom
arc4random(3), md5(3), random(3), amdpm(4), pchb(4), md5(9), random(9)
A random device first appeared in Linux operating system. This is a
cloned interface.
ARC4 routines added by David Mazieres.
No randomness testing suite provided.
MirOS BSD #10-current September 28, 2007 1
Generated on 2008-12-26 21:13:42 by $MirOS: src/scripts/roff2htm,v 1.57 2008/12/09 22:04:51 tg Exp $
These manual pages are copyrighted
by their respective writers; their source is available at our CVSweb, AnonCVS, and other mirrors.
The rest is Copyright © 2002-2008 The
MirOS Project, Germany.
This product includes material provided by Thorsten Glaser.
This manual page’s HTML representation is supposed to be valid XHTML/1.1; if not, please send a bug report – diffs preferred.