xref: /netbsd-src/sbin/rndctl/rndctl.8 (revision bdc22b2e01993381dcefeff2bc9b56ca75a4235c)
1.\"	$NetBSD: rndctl.8,v 1.22 2014/08/10 17:13:02 wiz Exp $
2.\"
3.\" Copyright (c) 1997 Michael Graff
4.\" All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright
10.\"    notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\"    notice, this list of conditions and the following disclaimer in the
13.\"    documentation and/or other materials provided with the distribution.
14.\" 3. The name of the author may not be used to endorse or promote products
15.\"    derived from this software without specific prior written permission.
16.\"
17.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
22.\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
24.\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
25.\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27.\" SUCH DAMAGE.
28.\"
29.Dd August 10, 2014
30.Dt RNDCTL 8
31.Os
32.Sh NAME
33.Nm rndctl
34.Nd in-kernel random number generator management tool
35.Sh SYNOPSIS
36.Nm
37.Op Fl CcEe
38.Op Fl d Ar devname | Fl t Ar devtype
39.Nm
40.Op Fl lsv
41.Op Fl d Ar devname | Fl t Ar devtype
42.Nm
43.Fl L Ar save-file
44.Nm
45.Fl S Ar save-file
46.Sh DESCRIPTION
47The
48.Nm
49program displays statistics on the current state of the
50.Xr rnd 4
51pseudo-driver, and allows the administrator to control which sources
52are allowed to contribute to the randomness pool maintained by
53.Xr rnd 4 ,
54as well as whether a given source counts as strongly random.
55.Pp
56The following options are available:
57.Bl -tag -width 123456
58.It Fl C
59Disable collection of timing information for the given
60device name or device type.
61.It Fl c
62Enable collection of timing information for the given
63device name or device type.
64.It Fl d
65Only the device named
66.Ar devname
67is altered or displayed.
68This is mutually exclusive with
69.Fl t .
70.It Fl E
71Disable entropy estimation from the collected timing information for
72the given device name or device type.
73If collection is still enabled, timing information is still
74collected and mixed into the internal entropy pool,
75but no entropy is assumed to be present.
76.It Fl e
77Enable entropy estimation using the collected timing information
78for the given device name or device type.
79.It Fl L
80Load saved entropy from file
81.Ar save-file ,
82which will be overwritten and deleted before the entropy is loaded into
83the kernel.
84.It Fl l
85List all sources, or, if the
86.Fl t
87or
88.Fl d
89flags are specified, only those specified by the
90.Ar devtype
91or
92.Ar devname
93specified.
94.It Fl S
95Save entropy pool to file
96.Ar save-file .
97The file format is specific to
98.Nm
99and includes an estimate of the amount of saved entropy and a checksum.
100.It Fl s
101Display statistics on the current state of the random collection pool.
102.It Fl t
103All devices of type
104.Ar devtype
105are altered or displayed.
106This is mutually exclusive with
107.Fl d .
108.Pp
109The available types are:
110.Bl -tag -width "diskx"
111.It Ic disk
112Physical hard drives.
113.It Ic net
114Network interfaces.
115.It Ic tape
116Tape devices.
117.It Ic tty
118Terminal, mouse, or other user input devices.
119.It Ic rng
120Random number generators.
121.El
122.It Fl v
123Verbose output: show entropy estimation statistics for each source.
124.El
125.Sh FILES
126.Bl -tag -width /dev/urandomx -compact
127.It Pa /dev/random
128Returns
129.Dq good
130values only.
131.It Pa /dev/urandom
132Always returns data, degenerates to a pseudo-random generator.
133.El
134.Sh SEE ALSO
135.Xr rnd 4 ,
136.Xr rnd 9
137.Sh HISTORY
138The
139.Nm
140program was first made available in
141.Nx 1.3 .
142.Sh AUTHORS
143The
144.Nm
145program was written by
146.An Michael Graff
147.Aq explorer@flame.org .
148.Sh BUGS
149Turning on entropy estimation from unsafe or predictable sources will
150weaken system security, while turning on entropy collection from such
151sources may weaken system security.
152.Pp
153Care should be taken when using this command.
154