home / skills / dkyazzentwatwa / chatgpt-skills / password-generator

password-generator skill

/password-generator

This skill generates cryptographically secure passwords and memorable passphrases with customizable rules, strength checks, and bulk options for teams.

npx playbooks add skill dkyazzentwatwa/chatgpt-skills --skill password-generator

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

Files (3)
SKILL.md
5.2 KB
---
name: password-generator
description: Generate secure passwords and passphrases with customizable rules. Check password strength, generate bulk passwords, and create memorable passphrases.
---

# Password Generator

Generate cryptographically secure passwords and memorable passphrases. Customize character sets, length, and rules. Includes strength checking and bulk generation.

## Quick Start

```python
from scripts.password_gen import PasswordGenerator

# Generate password
gen = PasswordGenerator()
password = gen.generate(length=16)
print(password)  # "K#9mPx$vL2nQ@8wR"

# Generate passphrase
passphrase = gen.passphrase(words=4)
print(passphrase)  # "correct-horse-battery-staple"
```

## Features

- **Secure Generation**: Uses cryptographically secure random
- **Custom Rules**: Character sets, required types, exclusions
- **Passphrases**: Word-based memorable passwords
- **Strength Check**: Evaluate password strength
- **Bulk Generation**: Generate multiple passwords
- **Pronounceable**: Generate easier-to-type passwords

## API Reference

### Basic Generation

```python
gen = PasswordGenerator()

# Default (16 chars, mixed)
password = gen.generate()

# Custom length
password = gen.generate(length=24)
```

### Character Options

```python
# Include/exclude character types
password = gen.generate(
    length=16,
    uppercase=True,
    lowercase=True,
    digits=True,
    symbols=True
)

# Exclude ambiguous characters (0, O, l, 1, etc.)
password = gen.generate(length=16, exclude_ambiguous=True)

# Custom character set
password = gen.generate(length=16, charset="abc123!@#")

# Exclude specific characters
password = gen.generate(length=16, exclude="{}[]")
```

### Requirements

```python
# Require at least N of each type
password = gen.generate(
    length=16,
    min_uppercase=2,
    min_lowercase=2,
    min_digits=2,
    min_symbols=2
)
```

### Passphrases

```python
# Word-based passphrase
passphrase = gen.passphrase(words=4)
# "correct-horse-battery-staple"

# Custom separator
passphrase = gen.passphrase(words=4, separator="_")
# "correct_horse_battery_staple"

# With number
passphrase = gen.passphrase(words=3, include_number=True)
# "correct-horse-42-battery"

# Capitalize words
passphrase = gen.passphrase(words=4, capitalize=True)
# "Correct-Horse-Battery-Staple"
```

### Strength Check

```python
strength = gen.check_strength("MyP@ssw0rd!")
# {
#     'score': 3,           # 0-4 scale
#     'label': 'Strong',    # Weak, Fair, Good, Strong, Very Strong
#     'entropy': 65.2,      # Bits of entropy
#     'feedback': ['Good length', 'Has symbols']
# }
```

### Bulk Generation

```python
# Generate multiple passwords
passwords = gen.generate_bulk(count=10, length=16)

# To CSV
gen.generate_to_csv("passwords.csv", count=100, length=20)
```

## CLI Usage

```bash
# Generate single password
python password_gen.py --length 16

# Generate passphrase
python password_gen.py --passphrase --words 4

# Custom options
python password_gen.py --length 20 --no-symbols --exclude-ambiguous

# Bulk generate
python password_gen.py --count 10 --length 16

# Check strength
python password_gen.py --check "MyPassword123!"

# Generate to file
python password_gen.py --count 100 --output passwords.txt
```

### CLI Arguments

| Argument | Description | Default |
|----------|-------------|---------|
| `--length` | Password length | 16 |
| `--count` | Number to generate | 1 |
| `--passphrase` | Generate passphrase | False |
| `--words` | Words in passphrase | 4 |
| `--no-uppercase` | Exclude uppercase | False |
| `--no-lowercase` | Exclude lowercase | False |
| `--no-digits` | Exclude digits | False |
| `--no-symbols` | Exclude symbols | False |
| `--exclude-ambiguous` | Exclude 0, O, l, 1 | False |
| `--check` | Check password strength | - |
| `--output` | Output file | - |

## Examples

### Strong Random Password

```python
gen = PasswordGenerator()
password = gen.generate(
    length=20,
    min_uppercase=2,
    min_lowercase=2,
    min_digits=2,
    min_symbols=2
)
print(f"Password: {password}")
print(f"Strength: {gen.check_strength(password)['label']}")
```

### Memorable Passphrase

```python
gen = PasswordGenerator()
passphrase = gen.passphrase(
    words=4,
    capitalize=True,
    include_number=True,
    separator="-"
)
print(passphrase)
# "Tiger-Mountain-42-Sunset-Lake"
```

### PIN Generation

```python
gen = PasswordGenerator()
pin = gen.generate(
    length=6,
    uppercase=False,
    lowercase=False,
    digits=True,
    symbols=False
)
print(f"PIN: {pin}")  # "847291"
```

### Batch for Team

```python
gen = PasswordGenerator()

# Generate passwords for new team members
team = ["alice", "bob", "charlie"]
for member in team:
    password = gen.generate(length=16)
    print(f"{member}: {password}")
```

## Strength Scoring

| Score | Label | Description |
|-------|-------|-------------|
| 0 | Very Weak | < 28 bits entropy |
| 1 | Weak | 28-35 bits |
| 2 | Fair | 36-59 bits |
| 3 | Strong | 60-127 bits |
| 4 | Very Strong | 128+ bits |

## Dependencies

```
(No external dependencies - uses Python standard library)
```

## Security Notes

- Uses `secrets` module for cryptographic randomness
- Never logs or stores generated passwords
- Passphrase wordlist is embedded (no external calls)
- Strength check is local (no external API)

Overview

This skill generates cryptographically secure passwords and memorable passphrases with flexible, customizable rules. It supports single and bulk generation, pronounceable options, and a local strength checker that reports entropy and a human-readable label. Use it from Python or via a lightweight CLI for quick workflows.

How this skill works

The generator uses Python's secrets module for cryptographic randomness and an embedded wordlist for offline passphrases. You can configure length, character sets, exclusions, and minimum counts for character types, or supply a custom charset. A strength check computes bits of entropy and maps it to a 0–4 score with feedback. Bulk output and file/CSV export are available in the CLI and API.

When to use it

  • Create strong random passwords for accounts, services, or devices
  • Generate memorable passphrases for backups or recovery keys
  • Produce bulk passwords for provisioning teams or testing
  • Create PINs or constrained passwords for systems with limited character sets
  • Evaluate existing passwords with an offline strength check

Best practices

  • Prefer passphrases (4+ words) for memorability when human entry is required
  • Enforce minimum counts for character types when policy requires complexity
  • Avoid storing generated secrets in plaintext; export directly to secure vaults when possible
  • Exclude ambiguous characters when sharing visually (0, O, l, 1) to reduce transcription errors
  • Use bulk generation only for provisioning and rotate those credentials on first use

Example use cases

  • Generate a 20-character password with at least two symbols and two digits for a service account
  • Create a 4-word passphrase with a number and capitalized words for a human-friendly recovery phrase
  • Produce 100 unique passwords and save them to CSV for onboarding new team members
  • Generate a 6-digit PIN using digits-only mode for device pairing
  • Run a local strength check on a candidate password to get entropy and actionable feedback

FAQ

Does this skill make external network calls?

No. All generation and strength checks are performed locally using the Python standard library and an embedded wordlist.

Can I require at least N of each character type?

Yes. You can set minimum counts for uppercase, lowercase, digits, and symbols in generation options.