2000-03-01 15:57:25 +08:00
|
|
|
=pod
|
2019-10-31 11:35:08 +08:00
|
|
|
{- OpenSSL::safe::output_do_not_edit_headers(); -}
|
2019-10-13 05:45:56 +08:00
|
|
|
|
2000-03-01 15:57:25 +08:00
|
|
|
=head1 NAME
|
|
|
|
|
2019-08-22 07:04:41 +08:00
|
|
|
openssl-rand - generate pseudo-random bytes
|
2000-03-01 15:57:25 +08:00
|
|
|
|
|
|
|
=head1 SYNOPSIS
|
|
|
|
|
|
|
|
B<openssl rand>
|
2016-02-06 00:58:45 +08:00
|
|
|
[B<-help>]
|
2000-03-01 15:57:25 +08:00
|
|
|
[B<-out> I<file>]
|
|
|
|
[B<-base64>]
|
2009-02-02 08:01:28 +08:00
|
|
|
[B<-hex>]
|
2020-09-21 17:56:01 +08:00
|
|
|
{- $OpenSSL::safe::opt_engine_synopsis -}{- $OpenSSL::safe::opt_r_synopsis -}
|
2020-02-25 12:29:30 +08:00
|
|
|
{- $OpenSSL::safe::opt_provider_synopsis -}
|
2023-11-06 06:51:38 +08:00
|
|
|
I<num>[K|M|G|T]
|
2000-03-01 15:57:25 +08:00
|
|
|
|
|
|
|
=head1 DESCRIPTION
|
|
|
|
|
2020-03-02 07:25:29 +08:00
|
|
|
This command generates I<num> random bytes using a cryptographically
|
2023-11-06 06:51:38 +08:00
|
|
|
secure pseudo random number generator (CSPRNG). A suffix [K|M|G|T] may be
|
|
|
|
appended to the num value to indicate the requested value be scaled as a
|
|
|
|
multiple of KiB/MiB/GiB/TiB respectively. Note that suffixes are case
|
|
|
|
sensitive, and that the suffixes represent binary multiples
|
|
|
|
(K = 1024 bytes, M = 1024*1024 bytes, etc).
|
|
|
|
|
|
|
|
The string 'max' may be substituted for a numercial value in num, to request the
|
|
|
|
maximum number of bytes the CSPRNG can produce per instantiation. Currently,
|
|
|
|
this is restricted to 2^61 bytes as per NIST SP 800-90C.
|
2020-03-02 07:25:29 +08:00
|
|
|
|
|
|
|
The random bytes are generated using the L<RAND_bytes(3)> function,
|
|
|
|
which provides a security level of 256 bits, provided it managed to
|
|
|
|
seed itself successfully from a trusted operating system entropy source.
|
2020-03-03 22:34:53 +08:00
|
|
|
Otherwise, the command will fail with a nonzero error code.
|
2020-07-22 10:55:31 +08:00
|
|
|
For more details, see L<RAND_bytes(3)>, L<RAND(7)>, and L<EVP_RAND(7)>.
|
2000-03-01 15:57:25 +08:00
|
|
|
|
|
|
|
=head1 OPTIONS
|
|
|
|
|
|
|
|
=over 4
|
|
|
|
|
2016-02-06 00:58:45 +08:00
|
|
|
=item B<-help>
|
|
|
|
|
|
|
|
Print out a usage message.
|
|
|
|
|
2019-09-26 03:20:11 +08:00
|
|
|
=item B<-out> I<file>
|
2000-03-01 15:57:25 +08:00
|
|
|
|
|
|
|
Write to I<file> instead of standard output.
|
|
|
|
|
|
|
|
=item B<-base64>
|
|
|
|
|
|
|
|
Perform base64 encoding on the output.
|
|
|
|
|
2009-02-02 08:01:28 +08:00
|
|
|
=item B<-hex>
|
|
|
|
|
|
|
|
Show the output as a hex string.
|
|
|
|
|
Document most missing options
Add cmd-nits make target.
Listing options should stop when it hits the "parameters" separator.
Add missing .pod.in files to doc/man1/build.info
Tweak find-doc-nits to try openssl-XXX before XXX for POD files and
change an error messavge to be more useful.
Fix the following pages: ca, cms, crl, dgst, enc,
engine, errstr, gendsa, genrsa, list, ocsp, passwd, pkcs7, pkcs12, rand,
rehash, req, rsautil, s_server, speed, s_time,
sess_id, smime, srp, ts, x509.
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
(Merged from https://github.com/openssl/openssl/pull/10873)
2020-01-17 02:40:52 +08:00
|
|
|
{- $OpenSSL::safe::opt_engine_item -}
|
|
|
|
|
2019-10-13 05:45:56 +08:00
|
|
|
{- $OpenSSL::safe::opt_r_item -}
|
|
|
|
|
2020-02-25 12:29:30 +08:00
|
|
|
{- $OpenSSL::safe::opt_provider_item -}
|
|
|
|
|
2000-03-01 15:57:25 +08:00
|
|
|
=back
|
|
|
|
|
2000-03-01 19:45:53 +08:00
|
|
|
=head1 SEE ALSO
|
|
|
|
|
2019-08-22 07:04:41 +08:00
|
|
|
L<openssl(1)>,
|
2020-03-02 07:25:29 +08:00
|
|
|
L<RAND_bytes(3)>,
|
|
|
|
L<RAND(7)>,
|
2020-07-22 10:55:31 +08:00
|
|
|
L<EVP_RAND(7)>
|
2000-03-01 19:45:53 +08:00
|
|
|
|
2020-06-25 09:27:51 +08:00
|
|
|
=head1 HISTORY
|
|
|
|
|
|
|
|
The B<-engine> option was deprecated in OpenSSL 3.0.
|
|
|
|
|
2016-05-18 23:44:05 +08:00
|
|
|
=head1 COPYRIGHT
|
|
|
|
|
2021-05-20 21:22:33 +08:00
|
|
|
Copyright 2000-2021 The OpenSSL Project Authors. All Rights Reserved.
|
2016-05-18 23:44:05 +08:00
|
|
|
|
2018-12-06 21:04:11 +08:00
|
|
|
Licensed under the Apache License 2.0 (the "License"). You may not use
|
2016-05-18 23:44:05 +08:00
|
|
|
this file except in compliance with the License. You can obtain a copy
|
|
|
|
in the file LICENSE in the source distribution or at
|
|
|
|
L<https://www.openssl.org/source/license.html>.
|
|
|
|
|
|
|
|
=cut
|