360 Secure SkillHub
360 安全技能中心

Secure Password Generator

基于 Python secrets 模块在本地生成密码、口令短语、API 密钥、PIN、hex 与 base64 字符串;可配置长度、词数、生成数量和是否排除符号或数字,支持显示熵值,并可调用系统剪贴板命令复制结果。

hostilespider
hostilespider
热度 42.14
最近更新 2026-05-11 17:38:03
分类:安全依赖:代码执行应用场景:自动化脚本

安装技能

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

执行命令安装此 skill: npx secure-skills-cli add secure-passgen
Metadata
name
secure-passgen
description
Generate cryptographically secure passwords, passphrases, and API keys. Supports multiple formats and entropy calculation.
metadata
{"openclaw":{"emoji":"🔑","requires":{"bins":["python3"]}}}

Secure Password Generator

Generate cryptographically secure passwords, passphrases, and API keys. Uses secrets module (CSPRNG) — not random.

Quick Start

# Generate a 20-char password
python3 {baseDir}/scripts/passgen.py

# Generate a passphrase
python3 {baseDir}/scripts/passgen.py --type passphrase --words 5

# Generate an API key
python3 {baseDir}/scripts/passgen.py --type apikey

# Generate 10 passwords at once
python3 {baseDir}/scripts/passgen.py --count 10

Types

Type Example Entropy
password kX9#mP2$vL@nQ7!wR4 ~128 bits
passphrase correct-horse-battery-staple ~77 bits (5 words)
apikey sk_a1b2c3d4e5f6... ~256 bits
pin 847291 ~20 bits (6 digits)
hex a3f7b2c1d9e8... ~256 bits (32 bytes)
base64 YWJjZGVmZ2hpams... ~256 bits

Options

  • --type TYPE — Output type (default: password)
  • --length N — Password length (default: 20)
  • --words N — Passphrase word count (default: 5)
  • --count N — How many to generate (default: 1)
  • --no-symbols — Exclude symbols from passwords
  • --no-numbers — Exclude numbers
  • --separator CHAR — Passphrase separator (default: -)
  • --entropy — Show entropy calculation
  • --clipboard — Copy to clipboard (requires xclip/pbcopy)