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