360 Secure SkillHub
360 安全技能中心

Openssl

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

分类:安全
asleep123
asleep123
热度 53.72
最近更新 2026-05-11 15:48:53

安装

发给 Agent
帮我安装这个技能:npx secure-skills-cli add asleep123/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