openssl rand
Generate random bytes using a cryptographically secure PRNG. More information: https://docs.openssl.org/master/man1/openssl-rand/.
- Generate an 8-byte (16 characters) hex string and write it to
stdout:
openssl rand -hex 8
- 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
- Generate 1 KiB/MiB/GiB/TiB random bytes encoded in hex/base64:
openssl rand - 1
来源:tldr-pages contributors · 作者与贡献记录 · CC BY 4.0。离线整理了版式、链接和媒体显示。
