Generate cryptographically secure random passwords using Python's secrets module. No API keys, no external services, completely offline.
secrets module (not random)bash
# Generate a 16-character password (default)
python3 scripts/password_generator.py
# Generate a 20-character password
python3 scripts/password_generator.py 20
# Generate 10 passwords of 24 characters
python3 scripts/password_generator.py 24 10
# Exclude similar characters (0O1lI)
python3 scripts/password_generator.py 16 --exclude-similar
# Password without special symbols
python3 scripts/password_generator.py 16 --no-special
text
Generate a strong 20-character password
Generate 5 passwords of 16 characters each
Generate a password without special symbols for a website that doesn't allow them
OptionDescriptionLENGTHPassword length (default: 16)COUNTNumber of passwords to generate (default: 1)--no-upperExclude uppercase letters--no-lowerExclude lowercase letters--no-digitsExclude digits--no-specialExclude special symbols--exclude-similarExclude 0, O, 1, l, I
secrets.choice() for cryptographically secure randomness安全的随机密码生成器,使用Python标准库secrets模块,无需API Key。