xref: /netbsd-src/share/man/man4/rnd.4 (revision 181254a7b1bdde6873432bffef2d2decc4b5c22f)
1.\"	$NetBSD: rnd.4,v 1.35 2020/05/06 18:38:20 riastradh Exp $
2.\"
3.\" Copyright (c) 2014-2020 The NetBSD Foundation, Inc.
4.\" All rights reserved.
5.\"
6.\" This code is derived from software contributed to The NetBSD Foundation
7.\" by Taylor R. Campbell.
8.\"
9.\" Redistribution and use in source and binary forms, with or without
10.\" modification, are permitted provided that the following conditions
11.\" are met:
12.\" 1. Redistributions of source code must retain the above copyright
13.\"    notice, this list of conditions and the following disclaimer.
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\"    notice, this list of conditions and the following disclaimer in the
16.\"    documentation and/or other materials provided with the distribution.
17.\"
18.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
19.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
20.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
22.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28.\" POSSIBILITY OF SUCH DAMAGE.
29.\"
30.Dd May 1, 2020
31.Dt RND 4
32.Os
33.\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
34.Sh NAME
35.Nm rnd
36.Nd random number generator
37.\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
38.Sh DESCRIPTION
39The
40.Pa /dev/random
41and
42.Pa /dev/urandom
43devices generate bytes randomly with uniform distribution.
44Every read from them is independent.
45.Bl -tag -width /dev/urandom
46.It Pa /dev/urandom
47Never blocks.
48.It Pa /dev/random
49Sometimes blocks.
50Will block early at boot if the system's state is known to be
51predictable.
52.El
53.Pp
54Applications should read from
55.Pa /dev/urandom ,
56or the
57.Xr sysctl 7
58variable
59.Li kern.arandom ,
60when they need randomly generated data, e.g. key material for
61cryptography or seeds for simulations.
62(The
63.Xr sysctl 7
64variable
65.Li kern.arandom
66is limited to 256 bytes per read, but is otherwise equivalent to
67reading from
68.Pa /dev/urandom
69and always works even in a
70.Xr chroot 8
71environment without requiring a populated
72.Pa /dev
73tree and without opening a file descriptor, so
74.Li kern.arandom
75may be preferable to use in libraries.)
76.Pp
77Systems should be engineered to judiciously read at least once from
78.Pa /dev/random
79at boot before running any services that talk to the internet or
80otherwise require cryptography, in order to avoid generating keys
81predictably.
82.Pa /dev/random
83may block at any time, so programs that read from it must be prepared
84to handle blocking.
85Interactive programs that block due to reads from
86.Pa /dev/random
87can be especially frustrating.
88.Pp
89If interrupted by a signal, reads from either
90.Pa /dev/random
91or
92.Pa /dev/urandom
93may return short, so programs that handle signals must be prepared to
94retry reads.
95.Pp
96Writing to either
97.Pa /dev/random
98or
99.Pa /dev/urandom
100influences subsequent output of both devices, guaranteed to take
101effect at next open.
102If you have a coin in your pocket, you can flip it 256 times and feed
103the outputs to
104.Pa /dev/random
105to guarantee your system is in a state that nobody but you and the
106bored security guard watching the surveillance camera in your office
107can guess:
108.Bd -literal -offset abcd
109% echo tthhhhhthhhththtthhhhthtththttth... > /dev/random
110.Ed
111.Pp
112(Sequence generated from a genuine US quarter dollar, guaranteed
113random.)
114.\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
115.Sh SECURITY MODEL
116The
117.Nm
118subsystem provides the following security properties against two
119different classes of attackers, provided that there is enough entropy
120from entropy sources not seen by attackers:
121.Bl -bullet -offset abcd
122.It
123An attacker who has seen some outputs and can supply some entropy
124sources' inputs to the operating system cannot predict past or future
125unseen outputs.
126.It
127An attacker who has seen the entire state of the machine cannot predict
128past outputs.
129.El
130.Pp
131One
132.Sq output
133means a single read, no matter how short it is.
134.Pp
135.Sq Cannot predict
136means it is conjectured of the cryptography in
137.Fa /dev/random
138that any computationally bounded attacker who tries to distinguish
139outputs from uniform random cannot do more than negligibly better than
140uniform random guessing.
141.\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
142.Sh ENTROPY
143The operating system continuously makes observations of hardware
144devices, such as network packet timings, disk seek delays, and
145keystrokes.
146The observations are combined into a seed for a cryptographic
147pseudorandom number generator (PRNG) which is used to generate the
148outputs of both
149.Pa /dev/random
150and
151.Pa /dev/urandom .
152.Pp
153An attacker may be able to guess with nonnegligible chance of success
154what your last keystroke was, but guessing every observation the
155operating system may have made is more difficult.
156The difficulty of the best strategy at guessing a random variable is
157analyzed as the -log_2 of the highest probability of any outcome,
158measured in bits, and called its
159.Em min-entropy ,
160or
161.Em entropy
162for short in cryptography.
163For example:
164.Bl -bullet -offset abcd -compact
165.It
166A fair coin toss has one bit of entropy.
167.It
168A fair (six-sided) die roll has a little over 2.5 bits of entropy.
169.It
170A string of two independent fair coin tosses has two bits of entropy.
171.It
172The toss of a pair of fair coins that are glued together has one bit of
173entropy.
174.It
175A uniform random distribution with
176.Fa n
177possibilities has log_2
178.Fa n
179bits of entropy.
180.It
181An utterance from an accounting troll who always says
182.Sq nine
183has zero bits of entropy.
184.El
185.Pp
186Note that entropy is a property of an observable physical process, like
187a coin toss, or of a state of knowledge about that physical process; it
188is not a property of a specific sample obtained by observing it, like
189the string
190.Sq tthhhhht .
191There are also kinds of entropy in information theory other than
192min-entropy, including the more well-known Shannon entropy, but they
193are not relevant here.
194.Pp
195Hardware devices that the operating system monitors for observations
196are called
197.Em "entropy sources" ,
198and the observations are combined into an
199.Em "entropy pool" .
200The
201.Xr rndctl 8
202command queries information about entropy sources and the entropy pool,
203and can control which entropy sources the operating system uses or
204ignores.
205.Pp
206256 bits of entropy is typically considered intractable to guess with
207classical computers and with current models of the capabilities of
208quantum computers.
209.Pp
210Systems with nonvolatile storage should store a secret from
211.Pa /dev/urandom
212on disk during installation or shutdown, and feed it back during boot,
213so that the work the operating system has done to gather entropy \(em
214including the work its operator may have done to flip a coin! \(em can be
215saved from one boot to the next, and so that newly installed systems
216are not vulnerable to generating cryptographic keys predictably.
217.Pp
218The boot loaders in some
219.Nx
220ports support a command to load a seed from disk before the
221kernel has started.
222For those that don't, the
223.Xr rndctl 8
224command can do it once userland has started, for example by setting
225.Dq Li random_seed=YES
226in
227.Pa /etc/rc.conf ,
228which is enabled by default; see
229.Xr rc.conf 5 .
230.\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
231.Sh LIMITATIONS
232Some people worry about recovery from state compromise \(em that is,
233ensuring that even if an attacker sees the entire state of the
234operating system, then the attacker will be unable to predict any new
235future outputs as long as the operating system gathers fresh entropy
236quickly enough.
237.Pp
238But if an attacker has seen the entire state of your machine,
239refreshing entropy is probably the least of your worries, so we do not
240address that threat model here.
241.Pp
242The
243.Nm
244subsystem does
245.Em not
246automatically defend against hardware colluding with an attacker to
247influence entropy sources based on the state of the operating system.
248.Pp
249For example, a PCI device or CPU instruction for random number
250generation which has no side channel to an attacker other than the
251.Pa /dev/urandom
252device could be bugged to observe all other entropy sources, and to
253carefully craft
254.Sq observations
255that cause a certain number of bits of
256.Pa /dev/urandom
257output to be ciphertext that either is predictable to an attacker or
258conveys a message to an attacker.
259.Pp
260No amount of scrutiny by the system's operator could detect this.
261The only way to prevent this attack would be for the operator to
262disable all entropy sources that may be colluding with an attacker.
263If you're not sure which ones are not, you can always disable all of
264them and fall back to the coin in your pocket.
265.\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
266.Sh IOCTLS
267The
268.Pa /dev/random
269and
270.Pa /dev/urandom
271devices support a number of ioctls, defined in the
272.In sys/rndio.h
273header file, for querying and controlling the entropy pool.
274.Pp
275Since timing between hardware events contributes to the entropy pool,
276statistics about the entropy pool over time may serve as a side channel
277for the state of the pool, so access to such statistics is restricted
278to the super-user and should be used with caution.
279.Pp
280Several ioctls are concerned with particular entropy sources, described
281by the following structure:
282.Bd -literal
283typedef struct {
284	char		name[16];	/* symbolic name */
285	uint32_t	total;		/* estimate of entropy provided */
286	uint32_t	type;		/* RND_TYPE_* value */
287	uint32_t	flags;		/* RND_FLAG_* mask */
288} rndsource_t;
289
290#define	RND_TYPE_UNKNOWN
291#define	RND_TYPE_DISK		/* disk device */
292#define	RND_TYPE_ENV		/* environment sensor (temp, fan, &c.) */
293#define	RND_TYPE_NET		/* network device */
294#define	RND_TYPE_POWER		/* power events */
295#define	RND_TYPE_RNG		/* hardware RNG */
296#define	RND_TYPE_SKEW		/* clock skew */
297#define	RND_TYPE_TAPE		/* tape drive */
298#define	RND_TYPE_TTY		/* tty device */
299#define	RND_TYPE_VM		/* virtual memory faults */
300
301#define	RND_TYPE_MAX		/* value of highest-numbered type */
302
303#define	RND_FLAG_COLLECT_TIME		/* use timings of samples */
304#define	RND_FLAG_COLLECT_VALUE		/* use values of samples */
305#define	RND_FLAG_ESTIMATE_TIME		/* estimate entropy of timings */
306#define	RND_FLAG_ESTIMATE_VALUE		/* estimate entropy of values */
307#define	RND_FLAG_NO_COLLECT		/* ignore samples from this */
308#define	RND_FLAG_NO_ESTIMATE		/* do not estimate entropy */
309.Ed
310.Pp
311The following ioctls are supported:
312.Bl -tag -width abcd
313.It Dv RNDGETENTCNT Pq Vt uint32_t
314Return the number of bits of entropy the system is estimated to have.
315.It Dv RNDGETSRCNUM Pq Vt rndstat_t
316.Bd -literal
317typedef struct {
318	uint32_t	start;
319	uint32_t	count;
320	rndsource_t	source[RND_MAXSTATCOUNT];
321} rndstat_t;
322.Ed
323.Pp
324Fill the
325.Fa sources
326array with information about up to
327.Fa count
328entropy sources, starting at
329.Fa start .
330The actual number of sources described is returned in
331.Fa count .
332At most
333.Dv RND_MAXSTATCOUNT
334sources may be requested at once.
335.It Dv RNDGETSRCNAME Pq Vt rndstat_name_t
336.Bd -literal
337typedef struct {
338	char		name[16];
339	rndsource_t	source;
340} rndstat_name_t;
341.Ed
342.Pp
343Fill
344.Fa source
345with information about the entropy source named
346.Fa name ,
347or fail with
348.Dv ENOENT
349if there is none.
350.It Dv RNDCTL Pq Vt rndctl_t
351.Bd -literal
352typedef struct {
353	char		name[16];
354	uint32_t	type;
355	uint32_t	flags;
356	uint32_t	mask;
357} rndctl_t;
358.Ed
359.Pp
360For each entropy source of the type
361.Fa type ,
362or if
363.Fa type
364is
365.Li 0xff
366then for the entropy source named
367.Fa name ,
368replace the flags in
369.Fa mask
370by
371.Fa flags .
372.It Dv RNDADDDATA Pq Vt rnddata_t
373.Bd -literal
374typedef struct {
375	uint32_t	len;
376	uint32_t	entropy;
377	unsigned char	data[RND_SAVEWORDS * sizeof(uint32_t)];
378} rnddata_t;
379.Ed
380.Pp
381Feed
382.Fa len
383bytes of data to the entropy pool.
384The sample is expected to have been drawn with at least
385.Fa entropy
386bits of entropy.
387.Pp
388This ioctl can be used only once per boot.
389It is intended for a system that saves entropy to disk on shutdown and
390restores it on boot, so that the system can immediately be
391unpredictable without having to wait to gather entropy.
392.Pp
393This ioctl is the only way for userland to directly change the system's
394entropy estimate.
395.It Dv RNDGETPOOLSTAT Pq Vt rndpoolstat_t
396.Bd -literal
397typedef struct {
398	uint32_t poolsize;	/* size of each LFSR in pool */
399	uint32_t threshold;	/* no. bytes of pool hash returned */
400	uint32_t maxentropy;	/* total size of pool in bits */
401	uint32_t added;		/* no. bits of entropy ever added */
402	uint32_t curentropy;	/* current entropy `balance' */
403	uint32_t discarded;	/* no. bits dropped when pool full */
404	uint32_t generated;	/* no. bits yielded by pool while
405				   curentropy is zero */
406} rndpoolstat_t;
407.Ed
408.Pp
409Return various statistics about entropy.
410.El
411.\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
412.Sh SYSCTLS
413The following
414.Xr sysctl 8
415variables provided by
416.Nm
417can be set by privileged users:
418.Bl -tag -width abcd
419.It Dv kern.entropy.collection Pq Vt bool
420(Default on.)
421Enables entering data into the entropy pool.
422If disabled, no new data can be entered into the entropy pool, whether
423by device drivers, by writes to
424.Pa /dev/random
425or
426.Pa /dev/urandom ,
427or by the
428.Dv RNDADDDATA
429ioctl.
430.It Dv kern.entropy.depletion Pq Vt bool
431(Default off.)
432Enables
433.Sq entropy depletion ,
434meaning that even after attaining full entropy, the kernel subtracts
435the number of bits read out of the entropy pool from its estimate of
436the system entropy.
437This is not justified by modern cryptography \(em an adversary will
438never guess the 256-bit secret in a Keccak sponge no matter how much
439output from the sponge they see \(em but may be useful for testing.
440.It Dv kern.entropy.consolidate Pq Vt int
441Trigger for entropy consolidation: executing
442.Dl # sysctl -w kern.entropy.consolidate=1
443causes the system to consolidate pending entropy from per-CPU pools
444into the global pool, and waits until done.
445.El
446.Pp
447The following read-only
448.Xr sysctl 8
449variables provide information to privileged users about the state of
450the entropy pool:
451.Bl -tag -width abcd
452.It Dv kern.entropy.needed Pq Vt unsigned int
453Number of bits of entropy the system is waiting for in the global pool
454before reads from
455.Pa /dev/random
456will return without blocking.
457When zero, the system is considered to have full entropy.
458.It Dv kern.entropy.pending Pq Vt unsigned int
459Number of bits of entropy pending in per-CPU pools.
460This is the amount of entropy that will be contributed to the global
461pool at the next consolidation, such as from triggering
462.Dv kern.entropy.consolidate .
463.It Dv kern.entropy.epoch Pq Vt unsigned int
464Number of times system has reached full entropy, or entropy has been
465consolidated with
466.Dv kern.entropy.consolidate ,
467as an unsigned 32-bit integer.
468Consulted inside the kernel by subsystems such as
469.Xr cprng 9
470to decide whether to reseed.
471Initially set to 2^32 \- 1
472.Pq i.e., Li "(unsigned)\-1"
473meaning the system has never reached full entropy and the entropy has
474never been consolidated; never again set to 2^32 \- 1.
475Never zero, so applications can initialize a cache of the epoch to zero
476to ensure they reseed the next time they check whether it is different
477from the stored epoch.
478.El
479.\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
480.Sh IMPLEMENTATION NOTES
481(This section describes the current implementation of the
482.Nm
483subsystem at the time of writing.
484It may be out-of-date by the time you read it, and nothing in here
485should be construed as a guarantee about the behaviour of the
486.Pa /dev/random
487and
488.Pa /dev/urandom
489devices.)
490.Pp
491Device drivers gather samples from entropy sources and absorb them into
492a collection of per-CPU Keccak sponges called
493.Sq entropy pools
494using the
495.Xr rnd 9
496kernel API.
497The device driver furnishes an estimate for the entropy of the sampling
498process, under the assumption that each sample is independent.
499When the estimate of entropy pending among the per-CPU entropy pools
500reaches a threshold of 256 bits, the entropy is drawn from the per-CPU
501pools and consolidated into a global pool.
502Keys for
503.Pa /dev/random ,
504.Pa /dev/urandom ,
505.Li kern.arandom ,
506and the in-kernel
507.Xr cprng 9
508subsystem are extracted from the global pool.
509.Pp
510Early after boot, before CPUs have been detected, device drivers
511instead enter directly into the global pool.
512If anything in the system extracts data from the pool before the
513threshold has been reached at least once, the system will print a
514warning to the console and reset the entropy estimate to zero.
515The reason for resetting the entropy estimate to zero in this case is
516that an adversary who can witness output from the pool with partial
517entropy \(em say, 32 bits \(em can undergo a feasible brute force
518search to ascertain the complete state of the pool; as such, the
519entropy of the adversary's state of knowledge about the pool is zero.
520.Pp
521If the operator is confident that the drivers' estimates of the entropy
522of the sampling processes are too conservative, the operator can issue
523.Dl # sysctl -w kern.entropy.consolidate=1
524to force consolidation into the ready pool.
525The operator can also fool the system into thinking it has more entropy
526than it does by feeding data from
527.Pa /dev/urandom
528into
529.Pa /dev/random ,
530but this voids the security model and should be limited to testing
531purposes.
532.Pp
533.Em Short
534reads from
535.Pa /dev/urandom
536are served by a persistent per-CPU Hash_DRBG instance that is
537reseeded from the entropy pool after any entropy consolidation.
538Reads from
539.Pa /dev/random
540and
541.Em long
542reads from
543.Pa /dev/urandom
544are served by a temporary Hash_DRBG seeded from the entropy pool on
545each read.
546.Pp
547When
548.Sq entropy depletion
549is enabled by
550setting the sysctl variable
551.Dv kern.entropy.depletion Ns Li \&=1 ,
552every read from
553.Pa /dev/random
554is limited to 256 bits, since reading more than that would nearly
555always block again.
556.\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
557.Sh FILES
558.Bl -tag -width /dev/urandom -compact
559.It Pa /dev/random
560Uniform random byte source.
561May block.
562.It Pa /dev/urandom
563Uniform random byte source.
564Never blocks.
565.El
566.\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
567.Sh DIAGNOSTICS
568The
569.Nm
570subsystem may print the following warnings to the console likely
571indicating security issues:
572.Bl -diag -offset indent
573.It entropy: WARNING: extracting entropy too early
574Something requested extraction of entropy from the pool before it
575has ever reached full entropy in the system's estimation.
576.Pp
577The entropy may be low enough that an adversary who sees the output
578could guess the state of the pool by brute force, so in this event the
579system resets its estimate of entropy to none.
580.Pp
581This message is rate-limited to happen no more often than once per
582minute, so if you want to make sure it is gone you should consult
583.Dv kern.entropy.needed
584to confirm it is zero.
585.It entropy: WARNING: consolidating less than full entropy
586The operator triggered consolidation of entropy pending in per-CPU
587pools into the global pool when the system's estimate of the amount of
588entropy was still below the 256-bit threshold.
589.Pp
590This message can be safely ignored if the operator knows something the
591system doesn't, e.g. if the operator has flipped a coin 256 times and
592written the outcomes to
593.Pa /dev/random .
594.Pp
595This message is rate-limited to happen no more often than once per
596minute.
597.El
598.Pp
599The
600.Nm
601subsystem may print any of various messages about obtaining an entropy
602seed from the bootloader to diagnose saving and loading seeds on disk:
603.Bl -diag -offset indent
604.It entropy: entering seed from bootloader with N bits of entropy
605The bootloader provided an entropy seed to the kernel, which recorded
606an estimate of N bits of entropy in the process that generated it.
607.It entropy: no seed from bootloader
608The bootloader did not provide an entropy seed to the kernel before
609starting the kernel.
610This does not necessarily indicate a problem; not all bootloaders
611support the option, and the
612.Xr rc.conf 5
613setting
614.Li random_seed=YES
615can serve instead.
616.It entropy: invalid seed length N, expected sizeof(rndsave_t) = M
617The bootloader provided an entropy seed of the wrong size to the
618kernel.
619This may indicate a bug in
620.Xr rndctl 8 .
621The seed will be ignored.
622.It entropy: invalid seed checksum
623The entropy seed provided by the bootloader was malformed.
624The seed will be entered into the entropy pool, but it will be
625considered to contribute no entropy.
626.It entropy: double-seeded by bootloader
627A buggy bootloader tried to provide an entropy seed more than once to
628the kernel.
629Subsequent seeds will be entered into the entropy pool, but they will
630be considered to contribute no entropy.
631.It entropy: ready
632The system has full entropy for the first time.
633.El
634.\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
635.Sh SEE ALSO
636.Xr arc4random 3 ,
637.Xr rndctl 8 ,
638.Xr cprng 9 ,
639.Xr rnd 9
640.Rs
641.%A Elaine Barker
642.%A John Kelsey
643.%T Recommendation for Random Number Generation Using Deterministic Random Bit Generators
644.%D June 2015
645.%Q United States Department of Commerce
646.%I National Institute of Standards and Technology
647.%O NIST Special Publication 800-90A, Revision 1
648.%U https://csrc.nist.gov/publications/detail/sp/800-90a/rev-1/final
649.Re
650.Rs
651.%A Meltem S\(:onmez Turan
652.%A Elaine Barker
653.%A John Kelsey
654.%A Kerry A. McKay
655.%A Mary L. Baish
656.%A Mike Boyle
657.%T Recommendations for the Entropy Sources Used for Random Bit Generation
658.%D January 2018
659.%Q United States Department of Commerce
660.%I National Institute of Standards and Technology
661.%O NIST Special Publication 800-90B
662.%U https://csrc.nist.gov/publications/detail/sp/800-90b/final
663.Re
664.Rs
665.%A Daniel J. Bernstein
666.%T Entropy Attacks!
667.%D 2014-02-05
668.%U http://blog.cr.yp.to/20140205-entropy.html
669.Re
670.Rs
671.%A Nadia Heninger
672.%A Zakir Durumeric
673.%A Eric Wustrow
674.%A J. Alex Halderman
675.%T Mining Your Ps and Qs: Detection of Widespread Weak Keys in Network Devices
676.%B Proceedings of the 21st USENIX Security Symposium
677.%I USENIX
678.%D August 2012
679.%P 205-220
680.%U https://www.usenix.org/conference/usenixsecurity12/technical-sessions/presentation/heninger
681.%U https://factorable.net/
682.Re
683.Rs
684.%A Edwin T. Jaynes
685.%B Probability Theory: The Logic of Science
686.%I Cambridge University Press
687.%D 2003
688.%U https://bayes.wustl.edu/
689.Re
690.\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
691.Sh HISTORY
692The
693.Pa /dev/random
694and
695.Pa /dev/urandom
696devices first appeared in
697.Nx 1.3 .
698.\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
699.Sh AUTHORS
700The
701.Nm
702subsystem was first implemented by
703.An Michael Graff Aq Mt explorer@flame.org ,
704was then largely rewritten by
705.An Thor Lancelot Simon Aq Mt tls@NetBSD.org ,
706and was most recently largely rewritten by
707.An Taylor R. Campbell Aq Mt riastradh@NetBSD.org .
708.\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
709.Sh BUGS
710Many people are confused about what
711.Pa /dev/random
712and
713.Pa /dev/urandom
714mean.
715Unfortunately, no amount of software engineering can fix that.
716