]>
Commit | Line | Data |
---|---|---|
55f7d65d BM |
1 | =pod |
2 | ||
3 | =head1 NAME | |
4 | ||
b6b66573 | 5 | openssl-rand - generate pseudo-random bytes |
55f7d65d BM |
6 | |
7 | =head1 SYNOPSIS | |
8 | ||
9 | B<openssl rand> | |
169394d4 | 10 | [B<-help>] |
55f7d65d | 11 | [B<-out> I<file>] |
e8769719 RS |
12 | [B<-rand> I<file...>] |
13 | [B<-writerand> I<file>] | |
55f7d65d | 14 | [B<-base64>] |
7ca1cfba | 15 | [B<-hex>] |
55f7d65d BM |
16 | I<num> |
17 | ||
1738c0ce RS |
18 | =for comment ifdef engine |
19 | ||
55f7d65d BM |
20 | =head1 DESCRIPTION |
21 | ||
22 | The B<rand> command outputs I<num> pseudo-random bytes after seeding | |
3b80e3aa | 23 | the random number generator once. As in other B<openssl> command |
55f7d65d BM |
24 | line tools, PRNG seeding uses the file I<$HOME/>B<.rnd> or B<.rnd> |
25 | in addition to the files given in the B<-rand> option. A new | |
26 | I<$HOME>/B<.rnd> or B<.rnd> file will be written back if enough | |
27 | seeding was obtained from these sources. | |
28 | ||
29 | =head1 OPTIONS | |
30 | ||
31 | =over 4 | |
32 | ||
169394d4 MR |
33 | =item B<-help> |
34 | ||
35 | Print out a usage message. | |
36 | ||
e8769719 | 37 | =item B<-out> I<file> |
55f7d65d BM |
38 | |
39 | Write to I<file> instead of standard output. | |
40 | ||
e8769719 | 41 | =item B<-rand> I<file...> |
55f7d65d | 42 | |
3ee1eac2 RS |
43 | A file or files containing random data used to seed the random number |
44 | generator. | |
35ed393e | 45 | Multiple files can be specified separated by an OS-dependent character. |
b87ef946 | 46 | The separator is B<;> for MS-Windows, B<,> for OpenVMS, and B<:> for |
55f7d65d BM |
47 | all others. |
48 | ||
e8769719 | 49 | =item B<-writerand> I<file> |
3ee1eac2 RS |
50 | |
51 | Writes random data to the specified I<file> upon exit. | |
52 | This can be used with a subsequent B<-rand> flag. | |
53 | ||
55f7d65d BM |
54 | =item B<-base64> |
55 | ||
56 | Perform base64 encoding on the output. | |
57 | ||
7ca1cfba BM |
58 | =item B<-hex> |
59 | ||
60 | Show the output as a hex string. | |
61 | ||
55f7d65d BM |
62 | =back |
63 | ||
afbd0746 BM |
64 | =head1 SEE ALSO |
65 | ||
b6b66573 | 66 | L<openssl(1)>, |
9b86974e | 67 | L<RAND_bytes(3)> |
afbd0746 | 68 | |
e2f92610 RS |
69 | =head1 COPYRIGHT |
70 | ||
b6b66573 | 71 | Copyright 2000-2019 The OpenSSL Project Authors. All Rights Reserved. |
e2f92610 | 72 | |
449040b4 | 73 | Licensed under the Apache License 2.0 (the "License"). You may not use |
e2f92610 RS |
74 | this file except in compliance with the License. You can obtain a copy |
75 | in the file LICENSE in the source distribution or at | |
76 | L<https://www.openssl.org/source/license.html>. | |
77 | ||
78 | =cut |