Mac Developer Library Developer


This manual page is for Mac OS X version 10.9

If you are running a different version of Mac OS X, view the documentation locally:

  • In Terminal, using the man(1) command

Reading manual pages

Manual pages are intended as a quick reference for people who already understand a technology.

  • To learn how the manual is organized or to learn about command syntax, read the manual page for manpages(5).

  • For more information about this technology, look for other documentation in the Apple Developer Library.

  • For general information about writing shell scripts, read Shell Scripting Primer.

RAND(1)                                            OpenSSL                                           RAND(1)

       rand - generate pseudo-random bytes

       openssl rand [-out file] [-rand file(s)] [-base64] [-hex] num

       The rand command outputs num pseudo-random bytes after seeding the random number generator once.  As
       in other openssl command line tools, PRNG seeding uses the file $HOME/.rnd or .rnd in addition to the
       files given in the -rand option.  A new $HOME/.rnd or .rnd file will be written back if enough
       seeding was obtained from these sources.

       -out file
           Write to file instead of standard output.

       -rand file(s)
           Use specified file or files or EGD socket (see RAND_egd(3)) for seeding the random number
           generator.  Multiple files can be specified separated by a OS-dependent character.  The separator
           is ; for MS-Windows, , for OpenVMS, and : for all others.

           Perform base64 encoding on the output.

           Show the output as a hex string.


50                                               2013-03-05                                          RAND(1)

Reporting Problems

The way to report a problem with this manual page depends on the type of problem:

Content errors
Report errors in the content of this documentation to the OpenSSL project by sending email to
Bug reports
Report bugs in the functionality of the described tool or API to Apple through Bug Reporter and to the OpenSSL project by sending email to
Formatting problems
Report formatting mistakes in the online version of these pages with the feedback links below.