doc: document that 'openssl rand' is cryptographically secure
[openssl.git] / doc / man1 / openssl-rand.pod.in
1 =pod
2 {- OpenSSL::safe::output_do_not_edit_headers(); -}
3
4 =head1 NAME
5
6 openssl-rand - generate pseudo-random bytes
7
8 =head1 SYNOPSIS
9
10 B<openssl rand>
11 [B<-help>]
12 [B<-out> I<file>]
13 [B<-base64>]
14 [B<-hex>]
15 {- $OpenSSL::safe::opt_engine_synopsis -}
16 {- $OpenSSL::safe::opt_r_synopsis -}
17 I<num>
18
19 =for openssl ifdef engine
20
21 =head1 DESCRIPTION
22
23 This command generates I<num> random bytes using a cryptographically
24 secure pseudo random number generator (CSPRNG).
25
26 The random bytes are generated using the L<RAND_bytes(3)> function,
27 which provides a security level of 256 bits, provided it managed to
28 seed itself successfully from a trusted operating system entropy source.
29 Otherwise, the command will fail with a non-zero error code.
30 For more details, see L<RAND_bytes(3)>, L<RAND(7)>, and L<RAND_DRBG(7)>.
31
32 =head1 OPTIONS
33
34 =over 4
35
36 =item B<-help>
37
38 Print out a usage message.
39
40 =item B<-out> I<file>
41
42 Write to I<file> instead of standard output.
43
44 =item B<-base64>
45
46 Perform base64 encoding on the output.
47
48 =item B<-hex>
49
50 Show the output as a hex string.
51
52 {- $OpenSSL::safe::opt_engine_item -}
53
54 {- $OpenSSL::safe::opt_r_item -}
55
56 =back
57
58 =head1 SEE ALSO
59
60 L<openssl(1)>,
61 L<RAND_bytes(3)>,
62 L<RAND(7)>,
63 L<RAND_DRBG(7)>
64
65 =head1 COPYRIGHT
66
67 Copyright 2000-2019 The OpenSSL Project Authors. All Rights Reserved.
68
69 Licensed under the Apache License 2.0 (the "License").  You may not use
70 this file except in compliance with the License.  You can obtain a copy
71 in the file LICENSE in the source distribution or at
72 L<https://www.openssl.org/source/license.html>.
73
74 =cut