码迷,mamicode.com
首页 > 其他好文 > 详细

Openssl rand命令

时间:2015-07-25 12:00:02      阅读:185      评论:0      收藏:0      [点我收藏+]

标签:

一、简介

rand命令用来产生伪随机字节,随机数字产生器需要一个seed,在没有/dev/srandom系统下的解决方法是自己做一个~/.rnd文件

 

二、语法

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

选项

-out file             - write to file
-engine e             - use engine e, possibly a hardware device.
-rand file:file:... - seed PRNG from files
-base64               - base64 encode output
-hex                  - hex encode output

 

三、实例

1、产生base64编码的100位随机数

openssl rand -base64 100
技术分享

 

Openssl rand命令

标签:

原文地址:http://www.cnblogs.com/274914765qq/p/4675489.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!