passgen
A secure, customizable password generator CLI tool written in Go with clean architecture.
____ ____ _______________ ____ ____
/ __ \/ __ `/ ___/ ___/ __ `/ _ \/ __ \
/ /_/ / /_/ (__ |__ ) /_/ / __/ / / /
/ .___/\__,_/____/____/\__, /\___/_/ /_/
/_/ /____/
passgen v1.1.0
Cryptographically secure password generation
Features
- π Secure Random Generation β Uses
crypto/rand for cryptographically secure randomness
- π¨ Customizable Character Sets β Lowercase, uppercase, numbers, symbols (toggle individually)
- π No-Repeat Mode β
--no-repeat flag guarantees no duplicate characters with full type coverage
- π― Word-Based Passwords β Transform memorable words into secure passwords (6 strategies, 3 complexity levels)
- π Password Strength Checker β Analyze strength and get improvement suggestions
- π Preset Configurations β Quick presets: secure, simple, pin, alphanumeric
- π¦ Batch Generation β Generate multiple unique passwords at once
- π Cross-Platform β Linux, macOS, Windows
Installation
Quick Install (Recommended)
curl -sSL https://raw.githubusercontent.com/kumarasakti/passgen/main/install.sh | bash
Go Install
go install github.com/kumarasakti/passgen@latest
After go install, add Go's bin to PATH: export PATH=$PATH:$(go env GOPATH)/bin
PowerShell
irm https://raw.githubusercontent.com/kumarasakti/passgen/main/install.ps1 | iex
Build from Source
git clone https://github.com/kumarasakti/passgen.git
cd passgen
make build
sudo mv build/passgen /usr/local/bin/
Pre-built Binaries
Download from the releases page.
Verify
passgen --version
passgen --help
Usage
Basic Generation
passgen # Default 14-char password (lower, upper, symbols)
passgen -l 16 -n # 16 chars with numbers
passgen --secure # All character types enabled
passgen -c 5 # Generate 5 passwords
Advanced Options
passgen --no-repeat -l 20 --secure # No duplicate characters
passgen --exclude-similar # Exclude i, l, 1, L, o, 0, O
passgen --exclude "aeiou" # Exclude specific characters
passgen --lower=false --upper=false -n -l 6 # PIN (numbers only)
passgen --alphanumeric -l 12 # Letters and numbers only
Word-Based Passwords
passgen word "security" # Default hybrid transformation
passgen word "sunshine" --strategy leetspeak # s3cur1ty style
passgen word "secret" --complexity high # Maximum complexity
passgen word "team" --count 3 # 3 variations
Strategies: leetspeak Β· mixedcase Β· suffix Β· prefix Β· insert Β· hybrid (default)
Complexity: low Β· medium (default) Β· high
Presets
passgen preset secure # 16 chars, all types
passgen preset simple # 12 chars, letters + numbers
passgen preset pin # 6 digits
passgen preset alphanumeric # 12 chars, letters + numbers
Strength Checker
passgen check "mypassword123"
Command Line Options
Standard Generation
| Flag |
Short |
Description |
Default |
--length |
-l |
Password length |
14 |
--count |
-c |
Number of passwords to generate |
1 |
--lower |
|
Include lowercase letters |
true |
--upper |
|
Include uppercase letters |
true |
--numbers |
-n |
Include numbers |
false |
--symbols |
-s |
Include symbols |
true |
--no-repeat |
|
Avoid duplicate characters (guaranteed type coverage) |
false |
--exclude-similar |
|
Exclude similar characters (il1Lo0O) |
false |
--exclude |
|
Characters to exclude |
"" |
--secure |
-S |
Enable all character types |
false |
--simple |
-m |
Letters + numbers only |
false |
--alphanumeric |
-a |
Alphanumeric only |
false |
--help |
-h |
Show help |
|
--version |
-v |
Show version |
|
Word-Based Generation
passgen word <word> [flags]
| Flag |
Short |
Description |
Default |
Options |
--strategy |
-s |
Transformation strategy |
hybrid |
leetspeak, mixedcase, suffix, prefix, insert, hybrid |
--complexity |
-x |
Complexity level |
medium |
low, medium, high |
--count |
-c |
Number of variations |
1 |
|
Examples
$ passgen
π― Your Password:
ββββββββββββββββββ
β U$DD$fico*Q,.Y β
ββββββββββββββββββ
π Length: 14 | Character types: Lowercase, Uppercase, Symbols | Strength: Very Strong πͺ
π Security info: 88.0 bits entropy, cracks in 4892016 years
π¬ Someone's taking this security thing seriously! π
$ passgen --secure -l 20 --no-repeat
π― Your Password:
ββββββββββββββββββββββββ
β dP$<c1Xk6.q9!jLv7bRz β
ββββββββββββββββββββββββ
π Length: 20 | Character types: Lowercase, Uppercase, Numbers, Symbols | Strength: Extremely Strong π₯
π Security info: 101.3 bits entropy, cracks in 5.4e+19 years
π¬ Brr, that's ice cold security! Even hackers are shivering! π₯Ά
Development
make deps # Install dependencies
make build # Build for current platform
make build-all # Build for all platforms
make test # Run all tests
make dev # Format, lint, test, build
make release # Create release archives
Security
This tool uses Go's crypto/rand package for cryptographically secure random number generation. Generated passwords are suitable for production use.
Contributing
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature)
- Commit your changes (
git commit -m 'Add some amazing feature')
- Push to the branch (
git push origin feature/amazing-feature)
- Open a Pull Request
License
MIT License β see LICENSE for details.
Changelog
v1.1.0
- Word-Based Password Generation β 6 transformation strategies, 3 complexity levels
- No-Repeat Mode β
--no-repeat flag for no-duplicate passwords with guaranteed type coverage
- Batch Uniqueness β
GenerateMultiplePasswords retries on collisions
- BuildCategories β Per-category charset support for guaranteed character type coverage
- Fisher-Yates Shuffle β Cryptographically secure shuffle for no-repeat mode
- Clean Architecture β Domain-Driven Design with domain/application/infrastructure layers
- Comprehensive Testing β 30+ test cases across all architectural layers
- Fully backward compatible
v1.0.0
- Initial release
- Basic password generation with customizable options
- Password strength checker
- Preset configurations
- Cross-platform support