rngd man page

rngd — Check and feed random data from hardware device to kernel random device

Synopsis

rngd [-b, --background] [-f, --foreground] [-d, --debug] [-l, --list] [-x, --exclude] [-n, --include] [-O, --option] [-i, --ignorefail] [-o, --random-device=file] [-p, --pid-file=file] [-r, --rng-device=file] [-s, --random-step=nnn] [-t, --test] [-W, --fill-watermark=nnn] [-q, --quiet] [-?, --help] [-V, --version]

Description

This daemon feeds data from a random number generator to the kernel's random number entropy pool, after first checking the data to ensure that it is properly random.

The -f or --foreground options can be used to tell rngd to avoid forking on startup.  This is typically used for debugging.  The -b or --background options, which fork and put rngd into the background automatically, are the default.

The -r or --rng-device options can be used to select an alternate source of input, besides the default /dev/hwrng. The -o or --random-device options can be used to select an alternate entropy output device, besides the default /dev/random. Note that this device must support the Linux kernel /dev/random  ioctl API.

Options

-b, --background

Become a daemon (default)

-f, --foreground

Do not fork and become a daemon

-d, --debug

Enable debug messages

-l, --list

List the indexes and names of available entropy sources. Exit code when listing sources is 0 if at least 1 entropy source was found and initialized, 1 otherwise.

-x, --exclude

Disable entropy sources based on index or (shortname) reported from --list option

-n, --include

Enable entropy sources based on index or (shortname) reported from --list option

-O, --option

Provide specific config options to individual entropy sources, in the format --option [index|shortname]:key:value.  See Entropy Sources section below for indicies and source specific options.  Note that specifying -O [<index>|<shortname>] will print the available options for that index to the console

-p file, --pid-file=file

File used for recording daemon PID, and multiple exclusion (default: /var/run/rngd.pid)

-i, --ignorefail

Ignore repeated fips failures

-o file, --random-device=file

Kernel device used for random number output (default: /dev/random)

-r file, --rng-device=file

Kernel device used for random number input (default: /dev/hwrng)

-s nnn, --random-step=nnn

Number of bytes written to random-device at a time (default: 64)

-t, --test

Enter test mode.  In this mode (which implies -f), all generated entropy is discarded and rngd reports the amount of entropy generated every second

-e nnn, --entropy-count=nnn

Number of bits to consider random when adding entropy. 1<=e<=8 (default: 8)

-W n, --fill-watermark=nnn

Once we start doing it, feed entropy to random-device until at least fill-watermark bits of entropy are available in its entropy pool. By default, this value is set to 75% of the entropy pool size or 2048 bits if the entropy pool size couldn't be determined. Setting this too high will cause rngd to dominate the contents of the entropy pool.  Low values will hurt system performance during entropy  starves.  Do not set fill-watermark above the size of the entropy pool (usually 4096 bits).  A value of 0 to this option will cause no watermark to be set.

-q, --quiet

Suppress all messages

-?, --help

Give a short summary of all program options.

-V, --version

Print program version

Entropy Sources

Hardware RNG (hwrng) [Index 0]

The Hardware RNG is a generic entropy source that draws entropy from a hardware rng attached by default to /dev/hwrng

TPM (tpm) [Index 1]

Entropy drawn from on board TPM device.  Note this entropy source is deprecated and will be removed soon, as newer tpm devices export entropy via /dev/hwrng, which is collected by the hwrng source above

RDRAND/RDSEED (rdrand) [Index 2]

Entropy drawn from the RDRAND and RDSEED instructions (x86 only)

Options

use_aes - select if rdrand is used to seed a cprng to produce entropy, or if all entropy is drawn directly from rdrand instruction (default 0)

DARN (darn) [Index 3]

Entropy drawn from the DARN instruction (ppc64 only)

Options

use_aes - select if the power darn instruction is used to directly fill the entropy poll, or if it is used as a periodic seed to an aes based cprng (default 1)

NIST Entropy Beacon (nist) [Index 4]

Entropy gathered from the NIST network entropy beacon.  Note that this entropy source is disabled by default as it should never be used for cryptographic purposes, or any use case in which random data should be known only by a single entity.

JITTER (jitter) [Index 5]

Entropy gathered by measuring timing variance of operations on the local cpu

Options

thread_count - Set the number of threads that the jitter entropy source will spawn

buffer_size - Set the size of the buffer cache that each thread maintains

refill_thresh - Set the low watermark for the cache that triggers its corresponding thread to start refill operations

retry_count - If all entropy buffers are empty, retry this many times before giving up.  Note that jitterentropy can take several seconds to refill a buffer, and so retries after a delay may be preferable to repeatedly spining on an empty buffer (default 1)

retry_delay - between each retry for retry_count above, sleep for this many seconds. May also be the special value -1, representing adaptive sleep, where each retry delay will be half the recorded execution time of the last entropy gathering round (default -1)

PKCS11 (pkcs11) [Index 6]

Entropy gathered via the opensc openssl engine, which can extract entropy from various smart card readers

Options

engine_path - Set the patch for the pkcs11 engine DSO to load

chunk_size - Some pkcs11 engines have restrictions on how much data can be requested at a time, this option allows for the request to be subdivided into smaller chunks to be satisfied

Authors

Philipp Rumpf
Jeff Garzik - jgarzik@pobox.com
Matt Sottek
Brad Hill
Neil Horman - nhorman@tuxdriver.com

Referenced By

ipsec_rsasigkey(8), rngd_selinux(8), rngtest(1).

March 2001 rng-tools 6.9