How to generate random hex string using OpenSSL
The following command will generate a 32-bytes long random hex string
how-to-generate-random-hex-string-using-openssl.sh
openssl rand -hex 16Example:
openssl_rand_example.txt
$ openssl rand -hex 16
122166dd9e2d617246da9af9d7d3cd6fThe command lists 16, not 32 because OpenSSL will generate 16 random binary bytes and then convert these 16 bytes into 32 hex characters.
Check out similar posts by category:
Linux
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow