Password Generator
Generate secure passwords and passphrases locally. No network calls - everything is generated on your machine using cryptographically secure random functions.
When to Use
- - Generate strong passwords for accounts
- Create memorable passphrases
- Analyze existing password strength
- Build secure password policies
Quick Start
Generate Strong Password
CODEBLOCK0
Generate Passphrase
CODEBLOCK1
Analyze Password
CODEBLOCK2
Commands
generate [length] [options]
Generate a random password with specified options.
Options:
- -
--no-upper - Exclude uppercase letters - INLINECODE2 - Exclude lowercase letters
- INLINECODE3 - Exclude digits
- INLINECODE4 - Exclude symbols
- INLINECODE5 - Exclude ambiguous characters (0,O,l,I)
- INLINECODE6 - Exclude similar characters
Examples:
CODEBLOCK3
passphrase [word_count] [options]
Generate a memorable passphrase (series of words).
Options:
- -
--separator=char - Word separator (default: "-")
Examples:
CODEBLOCK4
analyze <password>
Analyze the strength and composition of a password.
Examples:
CODEBLOCK5
list
List available character sets and excluded characters.
CODEBLOCK6
Password Strength Levels
- - Weak - Short or missing character types
- Medium - Decent length with multiple character types
- Strong - Long with all character types
- Very Strong - Very long with diverse character set
Security Features
- - Uses
secrets module for cryptographically secure randomness - No network requests - all generation is local
- Configurable character sets
- Excludes ambiguous characters option
- Strength analysis and recommendations
Character Sets
- - Lowercase letters: a-z (or a-z without l,o if excluding ambiguous)
- Uppercase letters: A-Z (or A-Z without I,O if excluding ambiguous)
- Digits: 0-9 (or 2-9 if excluding ambiguous)
- Symbols: !@#$%^&*()_+-=[]{}|;:,.<>?~
## Examples
### Basic Usage
CODEBLOCK7
### For Different Use Cases
CODEBLOCK8
### Analysis Examples
CODEBLOCK9
## Tips
- Use at least 12-16 characters for good security
- Include all character types when possible
- Consider passphrases for better memorability
- Avoid using personal information
- Use different passwords for different accounts
- Consider using a password manager
## Troubleshooting
**"Password too weak" warnings:**
- Increase length
- Add more character types
- Use the --exclude-ambiguous option for clarity
**"Command not found":**
- Ensure Python 3 is installed
- Check script permissions: chmod +x scripts/password-gen.py`
Security Notes
- - Generated passwords are shown in plain text
- Copy passwords immediately after generation
- Don't save passwords in command history
- Use secure methods to store generated passwords
- Consider using a password manager for storage
密码生成器
在本地生成安全密码和密码短语。无需网络调用——所有操作均使用加密安全的随机函数在您的机器上完成。
使用场景
- - 为账户生成强密码
- 创建易记的密码短语
- 分析现有密码强度
- 构建安全密码策略
快速开始
生成强密码
bash
python3 scripts/password-gen.py generate
输出:🔐 密码已生成
密码:K:kx]h--Xo
长度:16
强度:强
生成密码短语
bash
python3 scripts/password-gen.py passphrase 6
输出:密码:lambda-window-yellow-nu-mu
分析密码
bash
python3 scripts/password-gen.py analyze MyPassword123!
命令
generate [长度] [选项]
生成指定选项的随机密码。
选项:
- - --no-upper - 排除大写字母
- --no-lower - 排除小写字母
- --no-digits - 排除数字
- --no-symbols - 排除符号
- --exclude-ambiguous - 排除易混淆字符(0,O,l,I)
- --exclude-similar - 排除相似字符
示例:
bash
默认16位密码
python3 scripts/password-gen.py generate
20位密码
python3 scripts/password-gen.py generate 20
仅字母(无符号)
python3 scripts/password-gen.py generate 12 --no-symbols
仅数字和字母
python3 scripts/password-gen.py generate 16 --no-symbols
排除易混淆字符
python3 scripts/password-gen.py generate 16 --exclude-ambiguous
自定义组合
python3 scripts/password-gen.py generate 12 --no-upper --no-symbols
passphrase [单词数] [选项]
生成易记的密码短语(单词序列)。
选项:
- - --separator=字符 - 单词分隔符(默认:-)
示例:
bash
默认4词密码短语
python3 scripts/password-gen.py passphrase
6词密码短语
python3 scripts/password-gen.py passphrase 6
自定义分隔符
python3 scripts/password-gen.py passphrase 5 --separator=_
analyze <密码>
分析密码的强度和组成。
示例:
bash
python3 scripts/password-gen.py analyze MyPassword123!
python3 scripts/password-gen.py analyze weakpass
list
列出可用字符集和排除字符。
bash
python3 scripts/password-gen.py list
密码强度等级
- - 弱 - 长度短或缺少字符类型
- 中 - 长度适中且包含多种字符类型
- 强 - 长度较长且包含所有字符类型
- 非常强 - 长度很长且字符集多样化
安全特性
- - 使用secrets模块实现加密安全的随机性
- 无网络请求——所有生成均在本地完成
- 可配置字符集
- 提供排除易混淆字符选项
- 强度分析与建议
字符集
- - 小写字母:a-z(排除易混淆字符时为a-z不含l,o)
- 大写字母:A-Z(排除易混淆字符时为A-Z不含I,O)
- 数字:0-9(排除易混淆字符时为2-9)
- 符号:!@#$%^&*()_+-=[]{}|;:,.<>?~
示例
基本用法
bash
生成强密码
python3 scripts/password-gen.py generate
生成24位密码
python3 scripts/password-gen.py generate 24
不同使用场景
bash
数据库密码(无易混淆字符)
python3 scripts/password-gen.py generate 20 --exclude-ambiguous
PIN码(仅数字)
python3 scripts/password-gen.py generate 6 --no-upper --no-lower --no-symbols
网站密码(字母和数字)
python3 scripts/password-gen.py generate 16 --no-symbols
易记密码(密码短语)
python3 scripts/password-gen.py passphrase 5
分析示例
bash
分析现有密码
python3 scripts/password-gen.py analyze MyPassword123!
检查密码是否弱
python3 scripts/password-gen.py analyze password123
提示
- - 使用至少12-16位字符以确保良好安全性
- 尽可能包含所有字符类型
- 考虑使用密码短语以提高记忆性
- 避免使用个人信息
- 不同账户使用不同密码
- 考虑使用密码管理器
故障排除
密码太弱警告:
- - 增加长度
- 添加更多字符类型
- 使用--exclude-ambiguous选项提高清晰度
命令未找到:
- - 确保已安装Python 3
- 检查脚本权限:chmod +x scripts/password-gen.py
安全说明
- - 生成的密码以明文显示
- 生成后立即复制密码
- 不要在命令历史中保存密码
- 使用安全方法存储生成的密码
- 考虑使用密码管理器进行存储