commands.sh

openssl rand

all

Generate random bytes using a cryptographically secure PRNG.

More info →

Examples (4)

Generate an 8-byte (16 characters) hex string and write it to `stdout`

Generate 20 random bytes encoded in base64

openssl rand -base64 20

Generate random bytes and write them to a file (without encoding)

openssl rand -out path/to/file length

Generate 1 KiB/MiB/GiB/TiB random bytes encoded in hex/base64

openssl rand -hex|base64 1K|M|G|T
made by @shridhargupta | data from tldr-pages