2 releases
| 0.1.1 | Sep 25, 2024 |
|---|---|
| 0.1.0 | Sep 24, 2024 |
#1593 in Authentication
67KB
684 lines
PassForge: CLI Password Generator
PassForge is a robust and flexible command-line interface (CLI) password generation tool built with Rust. It allows users to create secure passwords and passphrases with various customization options.
Features
- Generate passwords with customizable length and character sets
- Create passphrases using a word list
- Evaluate password strength using the zxcvbn algorithm
- Multiple output options (single or multiple passwords/passphrases)
- Preset configurations for quick generation
- Extendable through
GeneratorandStrengthEvaluatortraits
Installation
To install PassForge, you need to have Rust and Cargo installed on your system. If you don't have them installed, you can get them from rustup.rs.
Once you have Rust and Cargo installed, you can build and install PassForge using the following commands:
git clone https://github.com/RakaPKS/passforge.git
cd passforge
cargo install --path .
This will install the passforge binary in your Cargo bin directory.
Usage
Here are some examples of how to use PassForge:
-
Generate a single password with default settings:
passforge -
Generate a password with a specific length:
passforge --length 20 -
Generate a password without symbols:
passforge --no-symbols -
Generate multiple passwords:
passforge --count 5 -
Generate a passphrase:
passforge --passphrase -
Generate a passphrase with custom word count and separator:
passforge --passphrase --words 5 --separator "_" -
Use a preset configuration:
passforge --preset strong -
Evaluate the strength of generated passwords:
passforge --evaluate-strength
For a full list of options, run:
passforge --help
Configuration
PassForge allows for extensive configuration through command-line arguments. Here are the main configuration options:
--lengthor-l: Set the password length (default: 18)--max-length: Set the maximum password length (for range-based generation)--countor-c: Number of passwords to generate (default: 1)--no-capitals: Exclude uppercase letters--no-numbers: Exclude numbers--no-symbols: Exclude symbols--passphraseor-p: Generate a passphrase instead of a password--wordsor-w: Number of words in the passphrase (default: 4)--separator: Separator for words in the passphrase (default: "-")--word-list: Path to a custom word list file for passphrase generation--evaluate-strengthor-e: Show password strength evaluation--preset: Use a preset configuration (choices: Weak, Average, Strong)
Development
PassForge is built with a modular architecture, making it easy to extend and maintain. The main components are:
Generatortrait: Defines the interface for password and passphrase generationStrengthEvaluatortrait: Defines the interface for password strength evaluationPasswordGeneratorandPassphraseGenerator: Implement theGeneratortraitZxcvbnAnalysis: Implements theStrengthEvaluatortrait using the zxcvbn algorithm
To run the tests:
cargo test
To run the benchmarks:
cargo bench
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
- zxcvbn-rs for password strength evaluation
- EFF's Large Wordlist for passphrase generation
Dependencies
~6–9MB
~152K SLoC