A secure and feature-rich password generator CLI tool built in Rust, specifically designed for macOS.
- π Secure Password Generation: Uses cryptographically secure random number generation
- π Passphrase Generation: Generate memorable passphrases from word lists
- π Password Strength Analysis: Check password strength with detailed analysis
- π Clipboard Integration: Copy passwords directly to macOS clipboard
- π¨ Multiple Output Formats: Plain text, Base64, and Hex encoding
- βοΈ Customizable Options: Control character sets, length, and exclusions
- π Hash Generation: Generate SHA256, SHA512, and Base64 hashes
The easiest way to install on any platform:
curl -fsSL https://raw.githubusercontent.com/morshedulmunna/passgen/main/install-universal.sh | bash# Add the tap (if using custom tap)
brew tap morshedulmunna/tap
# Install the tool
brew install passgencargo install passgen-cli-
Clone or download this repository
-
Navigate to the project directory:
cd passgen -
Build the project:
cargo build --release
-
Install globally:
cargo install --path .
-
Download the latest release for your platform from GitHub Releases
-
Extract the archive
-
Move the binary to a directory in your PATH:
# For macOS/Linux sudo mv passgen /usr/local/bin/ # Or for user installation mkdir -p ~/.local/bin mv passgen ~/.local/bin/ echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc source ~/.zshrc
After installation, try these commands:
# Generate a secure password
passgen generate --length 16 --copy
# Generate a memorable passphrase
passgen passphrase --words 4
# Check password strength
passgen check "MyPassword123!"
# Generate a hash
passgen hash "my-secret-string" --algorithm sha256Generate a basic 16-character password:
passgen generateGenerate a 32-character password with specific character sets:
passgen generate --length 32 --uppercase --lowercase --numbers --specialGenerate a password and copy to clipboard:
passgen generate --length 20 --copyGenerate a password in Base64 format:
passgen generate --length 16 --format base64Exclude similar and ambiguous characters:
passgen generate --exclude-similar --exclude-ambiguousGenerate a 4-word passphrase:
passgen passphraseGenerate a 6-word passphrase with numbers and special characters:
passgen passphrase --words 6 --numbers --specialGenerate a passphrase with custom separator:
passgen passphrase --separator "-" --copyAnalyze a password:
passgen check "MyPassword123!"Generate SHA256 hash:
passgen hash "my-secret-string"Generate SHA512 hash:
passgen hash "my-secret-string" --algorithm sha512Generate Base64 encoding:
passgen hash "my-secret-string" --algorithm base64-l, --length <LENGTH>: Password length (default: 16)-u, --uppercase: Include uppercase letters-d, --lowercase: Include lowercase letters-n, --numbers: Include numbers-s, --special: Include special characters--exclude-similar: Exclude similar characters (l, 1, I, O, 0)--exclude-ambiguous: Exclude ambiguous characters-f, --format <FORMAT>: Output format (plain, base64, hex)-c, --copy: Copy to clipboard
-w, --words <WORDS>: Number of words (default: 4)--separator <SEPARATOR>: Word separator (default: space)-n, --numbers: Include numbers-s, --special: Include special characters-c, --copy: Copy to clipboard
password: Password to analyze
input: Input string to hash-a, --algorithm <ALGORITHM>: Hash algorithm (sha256, sha512, base64)
passgen generate --length 24 --uppercase --lowercase --numbers --special --exclude-similar --copypassgen passphrase --words 5 --numbers --special --copypassgen check "password123"passgen hash "my-api-key" --algorithm sha256- Cryptographically Secure: Uses
OsRngfor true randomness - Entropy Calculation: Measures password strength in bits
- Character Set Control: Fine-grained control over character types
- Pattern Detection: Identifies common weak patterns
- Exclusion Options: Avoid confusing or problematic characters
- Very Weak: < 20 bits entropy
- Weak: 20-30 bits entropy
- Medium: 30-40 bits entropy
- Strong: 40-50 bits entropy
- Very Strong: > 50 bits entropy
- β macOS (Intel & Apple Silicon)
- β Linux (x86_64 & ARM64)
- β Windows (x86_64)
If clipboard functionality doesn't work:
- Go to System Preferences > Security & Privacy > Privacy > Accessibility
- Click the lock icon to make changes
- Add your terminal application (Terminal, iTerm2, etc.)
- Restart your terminal
If you encounter installation problems:
- Ensure you have the latest version of Rust installed
- Try the universal installer:
curl -fsSL https://raw.githubusercontent.com/morshedulmunna/passgen/main/install-universal.sh | bash - Check the GitHub Issues for known problems
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
This tool is provided for educational and personal use. Always follow your organization's password policies and security guidelines. The authors are not responsible for any security issues arising from the use of this tool.