Openssl rand命令

一、简介

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

image

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