10 releases
0.2.3 | Jul 9, 2024 |
---|---|
0.2.2 | Jul 1, 2024 |
0.2.1 | Jun 21, 2024 |
0.1.6 | Jun 7, 2024 |
0.1.5 | Apr 14, 2024 |
#39 in Authentication
621 downloads per month
24KB
430 lines
npwg - Secure Password Generator
npwg is a secure password generator written in Rust. With npwg, you can easily generate strong and random passwords or passphrases to protect your online accounts.
Features
- Generate passwords with custom length
- Support various predefined character sets
- Generate multiple passwords at once
- Generate diceware passphrases
- Avoid repeating characters in passwords
- Display statistics about the generated passwords
Installation
Using Cargo
If you have Rust and Cargo installed, you can install npwg using the following command:
cargo install npwg
This will download and compile the latest version of npwg and install it in your Cargo binary directory.
Manual Installation
- Make sure you have Rust installed on your system. If not, you can download it from the official Rust website: https://www.rust-lang.org/tools/install
- Clone this repository:
git clone https://github.com/vschwaberow/npwg.git
- Navigate to the project directory:
cd npwg
- Build the project:
cargo build --release
- The executable can be found at
target/release/npwg
.
Usage
npwg [OPTIONS]
Options
-l, --length <LENGTH>
: Sets the length of the password (or number of words for passphrases) [default: 16]-c, --count <COUNT>
: Sets the number of passwords to generate [default: 1]--avoid-repeating
: Avoid repeating characters in the password--stats
: Show statistics about the generated passwords-a, --allowed <CHARS>
: Sets the allowed characters (comma-separated list of predefined sets) [default: allprint]--use-words
: Use words instead of characters (generate diceware passphrases)-h, --help
: Print help-V, --version
: Print version
Predefined Character Sets
symbol1
,symbol2
,symbol3
: Different sets of symbolsdigit
: Numeric digitslowerletter
: Lowercase lettersupperletter
: Uppercase lettersshell
: Shell-safe charactershomoglyph1
tohomoglyph8
: Various homoglyph setsslashes
,brackets
,punctuation
: Specific character typesall
,allprint
,allprintnoquote
, etc.: Various combinations of character types
Examples
Generate a password with the default length (16 characters):
npwg
Generate a password with a specific length:
npwg -l 12
Generate multiple passwords:
npwg -c 5
Generate a password using only uppercase and lowercase letters:
npwg -a upperletter,lowerletter
Generate a diceware passphrase:
npwg --use-words -l 6
Generate a password and display statistics:
npwg --stats
Generate a password using the Diceware method. If no diceware wordlist is in ~/.npwg, it will be automatically downloaded from the EFF website:
npwg -d
Generate a password using the Diceware method with a custom number of words. The default number of words is 6. The wordlist will be downloaded if it is not found in ~/.npwg:
npwg -d -w 8
Contributing
Contributions are welcome! If you find a bug or have a suggestion for improvement, please open an issue or submit a pull request.
License
This project is licensed under the MIT License.
Dependencies
~11–25MB
~361K SLoC