<openssl rand> <fym0121@163.com>
介绍
openssl rand 用于产生指定长度个bytes的随机字符。
语法
openssl rand[-out file] [-randfile(s)] [-base64] [-hex]num
- E:\OpenSSL\foo>openssl rand 10
- 騆oading 'screen' into random state - done
- t嬍鴢vA
可以看见,这10个字节的随机数显示为乱码,可以用 -out 将随机字符放到一个文件中-base64 / -hex 对随机字符串进行base64编码或用hex格式显示
- E:\OpenSSL\foo>openssl rand -hex 10
- Loading 'screen' into random state - done
- 325567f39cb3dbf15a32
- E:\OpenSSL\foo>openssl rand -base64 20
- Loading 'screen' into random state - done
- aA58hKadrquIX1Jfr4COCm9m/NE=
来自 https://blog.csdn.net/fym0121/article/details/7988071