- ๐ฒ Cryptographically secure password generation
- ๐ XChaCha20-Poly1305 encryption
- ๐ Multi-language BIP39 mnemonic support
- ๐ฑ QR code generation and reading
- ๐ Automatic clipboard integration
- ๐ค Pipe support for text input/output
go install github.com/0xEtherPunk/passgen@latest # Optional: Create alias echo 'alias pg="passgen"' >> ~/.bashrc # or zsh-l <number>- Set password length (default: random 24-28)-o <file>- Save output to PNG file-s <size>- Set QR code size in pixels (default: 256)
-e <text>- Encrypt text (requires -p)-p <password>- Password for encryption/decryption-d <file/text>- Decrypt from file or text
-b- Generate BIP39 mnemonic (24 words by default)-12- Generate 12-word mnemonic (use with -b)
-en- English wordlist (default)-ru- Russian wordlist ๐ท๐บ-jp- Japanese wordlist ๐ฏ๐ต-cn- Chinese wordlist ๐จ๐ณ-fr- French wordlist ๐ซ๐ท-it- Italian wordlist ๐ฎ๐น-ko- Korean wordlist ๐ฐ๐ท-es- Spanish wordlist ๐ช๐ธ
-c <text>- Create QR code from custom text
# Password generation pg -l 32 # 32-char password pg -l 16 -o pass.png # 16-char password with QR # Encryption pg -e secret -p pass # Encrypt text pg -d file.png -p pass # Decrypt from file # BIP39 pg -b # 24 words in English pg -b -12 -ru # 12 words in Russian pg -b -jp -o seed.png # Japanese with QR# Basic password (24-28 chars) pg pg -o pass.png # Save as QR pg -s 512 -o pass.png # Custom QR size # Custom length pg -l 32 pg -l 16 -o pass.png# Basic encryption pg -e secret text -p password123 pg -e secret text -p password123 -o secret.png # Multi-word text pg -e this is my secret text -p pass123 -o secret.png # Using generated password from clipboard pg -o pass.png # Generate and save password pg -e secret text -p "$(xclip)" -o secret.png # Pipe input echo "secret text" | pg -e -p "pass123" cat file.txt | pg -e -p "pass123" -o encrypted.png # Custom QR sizes pg -e "secret" -p "pass" -o large.png -s 512 pg -e "secret" -p "pass" -o huge.png -s 1024# From QR file pg -d secret.png -p "pass123" # From encrypted text pg -d "encrypted_base64_text" -p "pass123" # Save decrypted to file pg -d secret.png -p "pass123" > decrypted.txt# English (default) pg -b # 24 words pg -b -12 # 12 words pg -b -o mnemonic.png # Other languages pg -b -ru # ๐ท๐บ Russian pg -b -jp # ๐ฏ๐ต Japanese pg -b -cn # ๐จ๐ณ Chinese pg -b -fr # ๐ซ๐ท French pg -b -it # ๐ฎ๐น Italian pg -b -ko # ๐ฐ๐ท Korean pg -b -es # ๐ช๐ธ Spanish # Combined flags pg -b -12 -ru -o mnemonic.png # 12 Russian words with QR pg -b -jp -s 512 -o phrase.png # Japanese with large QR# Custom text to QR pg -c "any text" -o qr.png pg -c "large text" -s 512 -o qr.png # Read from QR pg -d qr.png# Generate BIP39 and encrypt with clipboard password pg -l 32 # Generate and copy password pg -b -12 -o seed.png | pg -e -p "$(xclip -o)" -o backup.png # Or using xsel pg -b -12 -o seed.png | pg -e -p "$(xsel -b)" -o backup.png # For macOS: pg -b -12 -o seed.png | pg -e -p "$(pbpaste)" -o backup.png ### ๐ Advanced Usage ```bash # Encrypt BIP39 phrase pg -b -12 -o seed.png | pg -e -p "pass123" -o backup.png # Create encrypted backup tar czf - documents/ | \ pg -e -p "pass123" -o backup.png -s 1024# Secure BIP39 backup with encryption pg -b -12 -o seed.png | pg -e -p "secret123" -o encrypted_seed.png -s 1000 # Multi-language secure backup pg -b -12 -ru -o seed_ru.png | pg -e -p "ะฟะฐัะพะปั123" -o backup_ru.png pg -b -12 -jp -o seed_jp.png | pg -e -p "ใในใฏใผใ" -o backup_jp.png # Create encrypted archive with seeds mkdir seeds/ pg -b -12 -o seeds/en.png pg -b -12 -ru -o seeds/ru.png pg -b -12 -jp -o seeds/jp.png tar czf - seeds/ | pg -e -p "archive123" -o seeds_backup.png -s 2000 # Secure password sharing pg -l 32 -o pass.png | pg -e -p "share123" -o shared_pass.png # Recipient can decrypt with: pg -d shared_pass.png -p "share123"- ๐ฏ Generated passwords are automatically copied to clipboard
- ๐ผ๏ธ QR codes are shown in terminal if no output file specified
- ๐ Encrypted text is copied to clipboard for easy sharing
- ๐ Pipe support works with any text-producing command
- ๐จ Custom QR sizes help with scanning distance/resolution
- Generate and encrypt in one command using pipes
- Use different QR sizes for different data lengths
- Combine BIP39 languages for extra entropy
- Store encryption keys as separate QR codes
- Use generated passwords for encryption
- Create multi-part backups for extra security
passGen/ โโโ cmd/ โ โโโ passgen/ โ โโโ main.go # ๐ฏ Entry point โโโ internal/ โ โโโ bip39/ # ๐ฒ BIP39 implementation โ โ โโโ wordlist/ # ๐ Language wordlists โ โ โโโ bip39.go โ โ โโโ wordlist.go โ โโโ crypto/ # ๐ Encryption โ โ โโโ xchacha.go # XChaCha20-Poly1305 โ โโโ clipboard/ # ๐ Clipboard operations โ โโโ generator/ # ๐ฏ Password generation โ โโโ qr/ # ๐ฑ QR code operations โโโ README.md - ๐ง Go 1.23.2 or higher
- ๐ง Unix-like system (for /dev/urandom)
- ๐ xclip/xsel for Linux clipboard support
- ๐ pbcopy/pbpaste for macOS clipboard support
- Uses /dev/urandom for cryptographic randomness
- Default length: 24-28 characters
- Character set includes:
- Lowercase letters (a-z)
- Uppercase letters (A-Z)
- Numbers (0-9)
- Special characters (!@#$%^&*()_+-=[]{}|;:,.<>?)
- Supports 8 languages: ๐บ๐ธ EN, ๐ท๐บ RU, ๐ฏ๐ต JP, ๐จ๐ณ CN, ๐ซ๐ท FR, ๐ฎ๐น IT, ๐ฐ๐ท KO, ๐ช๐ธ ES
- 12 or 24 word phrases
- Follows official BIP39 specification
- Entropy: 128 bits (12 words) or 256 bits (24 words)
- Algorithm: XChaCha20-Poly1305
- Unique salt for each encryption
- Default size: 256x256 pixels
- Custom sizes supported
- Supports both generation and reading
- ASCII art display in terminal

