6 rand - generate pseudo-random bytes
21 This command generates I<num> random bytes using a cryptographically
22 secure pseudo random number generator (CSPRNG).
24 The random bytes are generated using the L<RAND_bytes(3)> function,
25 which provides a security level of 256 bits, provided it managed to
26 seed itself successfully from a trusted operating system entropy source.
27 Otherwise, the command will fail with a nonzero error code.
28 For more details, see L<RAND_bytes(3)>, L<RAND(7)>, and L<RAND_DRBG(7)>.
36 Print out a usage message.
40 Write to I<file> instead of standard output.
42 =item B<-rand file...>
44 A file or files containing random data used to seed the random number
46 Multiple files can be specified separated by an OS-dependent character.
47 The separator is B<;> for MS-Windows, B<,> for OpenVMS, and B<:> for
49 Explicitly specifying a seed file is in general not necessary, see the
50 L</NOTES> section for more information.
52 =item [B<-writerand file>]
54 Writes random data to the specified I<file> upon exit.
55 This can be used with a subsequent B<-rand> flag.
59 Perform base64 encoding on the output.
63 Show the output as a hex string.
69 Prior to OpenSSL 1.1.1, it was common for applications to store information
70 about the state of the random-number generator in a file that was loaded
71 at startup and rewritten upon exit. On modern operating systems, this is
72 generally no longer necessary as OpenSSL will seed itself from a trusted
73 entropy source provided by the operating system. The B<-rand> and
74 B<-writerand> flags are still supported for special platforms or
75 circumstances that might require them.
77 It is generally an error to use the same seed file more than once and
78 every use of B<-rand> should be paired with B<-writerand>.
88 Copyright 2000-2020 The OpenSSL Project Authors. All Rights Reserved.
90 Licensed under the OpenSSL license (the "License"). You may not use
91 this file except in compliance with the License. You can obtain a copy
92 in the file LICENSE in the source distribution or at
93 L<https://www.openssl.org/source/license.html>.