| 十六进制 | openssl rand -hex 32(输出 64 个字符) |
|---|---|
| Base64 | openssl rand -base64 24 |
| 写文件 | openssl rand -out file.bin 48 |
| 用途 | 票据密钥、盐值、测试用 IV 与 token |
生成与校验长度
生成与校验长度
openssl rand -hex 16
openssl rand -out ticket.key 48 && stat -c %s ticket.key
openssl rand -base64 32 | head -1密钥材料长度按目标算法要求取值(例如 nginx 票据密钥为 48 字节),不要随意更改。