Generate random bytes with openssl

Published on Author admin

Generate 32 bytes, hex encode:

openssl rand -hex 32

Generate 32 bytes, base64 encode:

openssl rand -base64 32

Generate 32 bytes, save output to file:

openssl rand -out file.txt 32