360 Secure SkillHub
360 安全技能中心

Openssl

该 Skill 提供基于 openssl rand 的命令片段,用于生成强密码、API 密钥、会话令牌等加密安全随机数据,并给出 base64、hex 和字符过滤的常见用法与长度建议。不涉及网络或外部服务。

asleep123
asleep123
热度 97.05
最近更新 2026-05-11 15:48:53
分类:安全依赖:代码执行应用场景:自动化脚本 / 工作流

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add openssl
Metadata
name
openssl
description
Generate secure random strings, passwords, and cryptographic tokens using OpenSSL. Use when creating passwords, API keys, secrets, or any secure random data.

OpenSSL Secure Generation

Generate cryptographically secure random data using openssl rand.

Password/Secret Generation

# 32 random bytes as base64 (43 chars, URL-safe with tr)
openssl rand -base64 32 | tr '+/' '-_' | tr -d '='

# 24 random bytes as hex (48 chars)
openssl rand -hex 24

# alphanumeric password (32 chars)
openssl rand -base64 48 | tr -dc 'a-zA-Z0-9' | head -c 32

Common Lengths

Use Case Command
Password (strong) openssl rand -base64 24
API key openssl rand -hex 32
Session token openssl rand -base64 48
Short PIN (8 digits) `openssl rand -hex 4

Notes

  • -base64 outputs ~1.33x the byte count in characters
  • -hex outputs 2x the byte count in characters
  • Pipe through tr -dc to filter character sets
  • Always use at least 16 bytes (128 bits) for secrets