.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "OPENSSL-RAND 1SSL" .TH OPENSSL-RAND 1SSL 2024-04-11 3.3.0 OpenSSL .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME openssl\-rand \- generate pseudo\-random bytes .SH SYNOPSIS .IX Header "SYNOPSIS" \&\fBopenssl rand\fR [\fB\-help\fR] [\fB\-out\fR \fIfile\fR] [\fB\-base64\fR] [\fB\-hex\fR] [\fB\-engine\fR \fIid\fR] [\fB\-rand\fR \fIfiles\fR] [\fB\-writerand\fR \fIfile\fR] [\fB\-provider\fR \fIname\fR] [\fB\-provider\-path\fR \fIpath\fR] [\fB\-propquery\fR \fIpropq\fR] \&\fInum\fR[K|M|G|T] .SH DESCRIPTION .IX Header "DESCRIPTION" This command generates \fInum\fR random bytes using a cryptographically 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). .PP The string 'max' may be substituted for a numerical 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. .PP The random bytes are generated using the \fBRAND_bytes\fR\|(3) function, which provides a security level of 256 bits, provided it managed to seed itself successfully from a trusted operating system entropy source. Otherwise, the command will fail with a nonzero error code. For more details, see \fBRAND_bytes\fR\|(3), \fBRAND\fR\|(7), and \fBEVP_RAND\fR\|(7). .SH OPTIONS .IX Header "OPTIONS" .IP \fB\-help\fR 4 .IX Item "-help" Print out a usage message. .IP "\fB\-out\fR \fIfile\fR" 4 .IX Item "-out file" Write to \fIfile\fR instead of standard output. .IP \fB\-base64\fR 4 .IX Item "-base64" Perform base64 encoding on the output. .IP \fB\-hex\fR 4 .IX Item "-hex" Show the output as a hex string. .IP "\fB\-engine\fR \fIid\fR" 4 .IX Item "-engine id" See "Engine Options" in \fBopenssl\fR\|(1). This option is deprecated. .IP "\fB\-rand\fR \fIfiles\fR, \fB\-writerand\fR \fIfile\fR" 4 .IX Item "-rand files, -writerand file" See "Random State Options" in \fBopenssl\fR\|(1) for details. .IP "\fB\-provider\fR \fIname\fR" 4 .IX Item "-provider name" .PD 0 .IP "\fB\-provider\-path\fR \fIpath\fR" 4 .IX Item "-provider-path path" .IP "\fB\-propquery\fR \fIpropq\fR" 4 .IX Item "-propquery propq" .PD See "Provider Options" in \fBopenssl\fR\|(1), \fBprovider\fR\|(7), and \fBproperty\fR\|(7). .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fBopenssl\fR\|(1), \&\fBRAND_bytes\fR\|(3), \&\fBRAND\fR\|(7), \&\fBEVP_RAND\fR\|(7) .SH HISTORY .IX Header "HISTORY" The \fB\-engine\fR option was deprecated in OpenSSL 3.0. .SH COPYRIGHT .IX Header "COPYRIGHT" Copyright 2000\-2021 The OpenSSL Project Authors. All Rights Reserved. .PP Licensed under the Apache License 2.0 (the "License"). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at .