RANDOM(4)                 OpenBSD Programmer's Manual                RANDOM(4)

NAME
     random, srandom, urandom, arandom - random data source devices

SYNOPSIS
     #include <sys/types.h>
     #include <dev/rndvar.h>
     #include <dev/rndioctl.h>

DESCRIPTION
     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/arandom   As required, entropy pool data re-seeds an ARC4 generator,
                    which then generates high-quality pseudo-random output da-
                    ta.

                    The arc4random(3) function in userland libraries seeds it-
                    self from this device, providing a second level of ARC4
                    hashed data.

FILES
     /dev/random
     /dev/srandom
     /dev/urandom
     /dev/arandom

SEE ALSO
     arc4random(3), md5(3), random(3), amdpm(4), glxsb(4), pchb(4), md5(9),
     random(9)

HISTORY
     A random device first appeared in the Linux operating system.  This is a
     cloned interface.

     ARC4 routines added by David Mazieres.

BUGS
     No randomness testing suite provided.

OpenBSD 4.7                    October 10, 2008                              1
