| 1 |
.\" Copyright (c) 2017 - 2022 by Stephan Mueller ([email protected]) |
| 2 |
.\" |
| 3 |
.\" Permission is granted to make and distribute verbatim copies of this |
| 4 |
.\" manual provided the copyright notice and this permission notice are |
| 5 |
.\" preserved on all copies. |
| 6 |
.\" |
| 7 |
.\" Permission is granted to copy and distribute modified versions of this |
| 8 |
.\" manual under the conditions for verbatim copying, provided that the |
| 9 |
.\" entire resulting derived work is distributed under the terms of a |
| 10 |
.\" permission notice identical to this one. |
| 11 |
.\" |
| 12 |
.\" Formatted or processed versions of this manual, if unaccompanied by |
| 13 |
.\" the source, must acknowledge the copyright and authors of this work. |
| 14 |
.\" License. |
| 15 |
.TH KCAPI-RNG 1 2017-08-14 |
| 16 |
.SH NAME |
| 17 |
kcapi-rng \- Kernel Crypto API Random Number Gatherer |
| 18 |
.SH SYNOPSIS |
| 19 |
.B kcapi-rng |
| 20 |
[\fI\,OPTION\/\fR] |
| 21 |
.SH DESCRIPTION |
| 22 |
The |
| 23 |
.I kcapi-rng |
| 24 |
application provides tool to obtain random numbers from the Linux |
| 25 |
kernel crypto API via the command line. The tool is similar to reading |
| 26 |
.IR /dev/hwrand |
| 27 |
with the difference that the used random number generators are fully |
| 28 |
deterministic - i.e. they are DRNGs. |
| 29 |
.PP |
| 30 |
Any potential seed data can be provided via STDIN. Some of the DRNGs |
| 31 |
require seeding as they do not seed themselves. The |
| 32 |
.IR kcapi-rng |
| 33 |
tool ensures that the DRNGs are seeded by pulling the seed data from |
| 34 |
the |
| 35 |
.IR getrandom |
| 36 |
system call (or |
| 37 |
.IR /dev/urandom |
| 38 |
if |
| 39 |
.IR getrandom |
| 40 |
is not available). The amount of seed data is defined by the DRNG itself |
| 41 |
and can be reviewed by assessing |
| 42 |
.IR /proc/crypto . |
| 43 |
The seed provided via STDIN will be added to the internally-generated seed. |
| 44 |
The generated random numbers are written to STDOUT. |
| 45 |
.LP |
| 46 |
The following options are supported when invoking |
| 47 |
.IR kcapi-rng : |
| 48 |
.TP |
| 49 |
\fB-b\fR, \fB\-\-bytes \fI\,BYTES\/\fR |
| 50 |
Generate |
| 51 |
.IR BYTES |
| 52 |
number of random bytes. |
| 53 |
.TP |
| 54 |
\fB-n\fR, \fB\-\-name \fI\,NAME\/\fR |
| 55 |
The |
| 56 |
.IR NAME |
| 57 |
argument specifies the random number generator implementation |
| 58 |
to be used. The allowed random number generators are defined by the Linux |
| 59 |
kernel. Currently registered ciphers can be reviewed at |
| 60 |
.IR /proc/crypto . |
| 61 |
The content of this file, however, can change when new ciphers |
| 62 |
are registered. The |
| 63 |
.IR NAME |
| 64 |
argument is given directly to the Linux kernel crypto API. The |
| 65 |
chosen cipher must be of type |
| 66 |
.IR rng |
| 67 |
as marked in |
| 68 |
.IR /proc/crypto . |
| 69 |
If this option is not used, the cipher |
| 70 |
.IR stdrng |
| 71 |
is used as default. |
| 72 |
.TP |
| 73 |
\fB\-\-hex\fR |
| 74 |
The generated random numbers are print out in hexadecimal notation instead |
| 75 |
of as binary string. |
| 76 |
.TP |
| 77 |
\fB\-v\fR, \fB\-\-verbose\fR |
| 78 |
Enable a verbose operation of |
| 79 |
.IR kcapi-rng . |
| 80 |
Using this option multiple times increases the verbosity. |
| 81 |
.TP |
| 82 |
\fB\-q\fR, \fB\-\-quiet\fR |
| 83 |
Prevent the generation of any log output. |
| 84 |
.TP |
| 85 |
\fB\-h\fR, \fB\-\-help\fR |
| 86 |
Display the help text. |
| 87 |
.TP |
| 88 |
\fB\-\-version\fR |
| 89 |
Display the version number of the |
| 90 |
.IR kcapi-rng |
| 91 |
application. |
| 92 |
.PP |
| 93 |
.SH SEE ALSO |
| 94 |
\fBkcapi-enc\fR(1) \fBkcapi-dgst\fR(1) |