OpenSSL命令---rand

用途:

用来产生伪随机字节。随机数字产生器需要一个seed,先已经说过了,在没有/dev/srandom系统下的解决方法是自己做一个~/.rnd文件。如果该程序能让随机数字产生器很满意的被seeded。程序写回一些怪怪的东西回该文件。

用法:

openssl rand [-out file] [-rand  file(s)] [-base64] [-hex] num


选项说明:

-out file:结果输出到file中。

-rand  file(s):指定随机数种子文件,多个文件间用分隔符分开,windows用“;”,OpenVMS用“,“,其他系统用“:”。

-base64:输出结果为BASE64编码数据。

-hex:输出结果为16进制数据。

num:随机数长度。   

实例:

openssl rand –base64 100
openssl rand –base64 –out myr.dat 100

posted on 2013-11-19 09:53  love so much  阅读(854)  评论(0编辑  收藏  举报

导航