Generate cryptographically secure passwords, passphrases, and PINs from the command line. Analyze existing passwords for strength. Uses Python secrets module for CSPRNG — no external dependencies.
bash
# Generate a 16-character password
python3 scripts/password_gen.py
# Generate a 32-character password, 5 at a time
python3 scripts/password_gen.py -l 32 -n 5
# Passphrase (4 random words)
python3 scripts/password_gen.py --passphrase
# 6-word passphrase, capitalized, with number
python3 scripts/password_gen.py --passphrase -w 6 --capitalize --add-number
# PIN
python3 scripts/password_gen.py --pin
python3 scripts/password_gen.py --pin -l 8
# Analyze a password
python3 scripts/password_gen.py --analyze 'MyP@ssw0rd!'
# JSON output
python3 scripts/password_gen.py --json
FlagDescription-l, --length NPassword length (default: 16)-n, --count NGenerate N passwords--no-uppercaseExclude uppercase letters--no-lowercaseExclude lowercase letters--no-digitsExclude digits--no-symbolsExclude symbols--exclude CHARSExclude ambiguous chars like lI1O0``--must-include CHARSForce specific characters to appear--passphraseWord-based passphrase mode-w, --words NWords in passphrase (default: 4)--separator SEPPassphrase separator (default: -)--capitalizeCapitalize passphrase words--add-numberAppend random number to passphrase--pinNumeric PIN mode--analyze PWAnalyze existing password strength--jsonJSON output
BitsStrengthUse Case< 28Very WeakNever use28-35WeakThrowaway accounts only36-59ModerateGeneral accounts60-79StrongImportant accounts80-127Very StrongFinancial, admin128+ExcellentMaster passwords, encryption keys