home / skills / aidotnet / moyucode / password-generator

password-generator skill

/skills/tools/password-generator

This skill generates cryptographically secure passwords and passphrases with configurable length, character sets, and entropy calculations to enhance security.

npx playbooks add skill aidotnet/moyucode --skill password-generator

Review the files below or copy the command above to add this skill to your agents.

Files (2)
SKILL.md
1.1 KB
---
name: password-generator
description: 生成安全密码和密码短语,支持自定义长度、字符集和熵计算。
metadata:
  short-description: 生成安全密码
source:
  repository: https://github.com/python/cpython
  license: PSF
---

# Password Generator Tool

## Description
Generate cryptographically secure passwords with customizable options including length, character sets, and passphrase generation.

## Trigger
- `/password` command
- User needs to generate passwords
- User wants secure random strings

## Usage

```bash
# Generate random password
python scripts/password_generator.py --length 16

# Generate with specific character sets
python scripts/password_generator.py --length 20 --uppercase --lowercase --digits --symbols

# Generate passphrase
python scripts/password_generator.py --passphrase --words 4

# Generate multiple passwords
python scripts/password_generator.py --count 5 --length 12

# Generate PIN
python scripts/password_generator.py --pin --length 6
```

## Tags
`password`, `security`, `random`, `generator`, `crypto`

## Compatibility
- Codex: ✅
- Claude Code: ✅

Overview

This skill generates cryptographically secure passwords and passphrases with flexible options for length, character sets, and entropy calculation. It supports single or multiple outputs, PINs, and passphrases built from word lists. Use it to produce strong, unpredictable credentials for accounts, services, and testing.

How this skill works

The generator uses a secure random source to assemble characters from selected classes (uppercase, lowercase, digits, symbols) or to pick words for passphrases. You can request a specific length, a count of passwords, PINs, or multi-word passphrases and receive estimated entropy for each result. Options let you combine or restrict character sets and produce output formatted for copy/paste or automation.

When to use it

  • Creating strong passwords for new accounts or replacing weak ones
  • Generating multiple unique credentials for testing or provisioning
  • Producing memorable but secure passphrases for human use
  • Creating numeric PINs for devices or services
  • Automating credential generation in scripts or CI workflows

Best practices

  • Prefer longer passwords or more passphrase words to increase entropy
  • Include a mix of character classes for random strings, or use 4+ words for passphrases
  • Store generated secrets in a password manager, not in plain files or chat logs
  • Generate passwords on a trusted device and avoid reusing them across accounts
  • Validate entropy output and choose strength thresholds that match risk

Example use cases

  • Generate a single 16-character password with uppercase, lowercase, digits, and symbols for a new service
  • Create five 12-character passwords for test accounts during deployment
  • Produce a 4-word passphrase for a human-memorable recovery phrase
  • Make a 6-digit numeric PIN for device setup
  • Integrate password generation into a script to create credentials during provisioning

FAQ

How is entropy calculated?

Entropy is estimated from the selected character pool size and the password length or by log2 of the number of possible passphrase combinations for chosen word counts.

Can I generate multiple passwords at once?

Yes. You can request a count to produce multiple independent passwords in one command for batch use.