Tuesday, 20 October 2026

openssl rand

openssl rand is an OpenSSL command that generates cryptographically secure random bytes using the library's CSPRNG (cyptographically secure pseudorandom number generator) with options for raw, hex or Base64 output.

Example usage:

openssl rand -hex 16
openssl rand -base64 16

The number at the end states the number of bytes to generate. 

The GitHub location for OpenSSL can be found here. This also has extensive documentation in Markdown.

Learn more about OpenSSL here from the OSSL Guide. An interesting application of OpenSSL's capabilities is implementing systems using QUIC (a modern transport layer protocol built on UDP).

No comments: