#password #password-generator #random-password #security #secure-random #character-set #cli

bin+lib pwdg

A rudimentary command-line tool and Rust library for generating secure, random passwords

1 unstable release

0.1.0 Apr 7, 2024

#1155 in Cryptography

37 downloads per month
Used in pwdm

Apache-2.0

24KB
601 lines

pwdg

pwdg is a rudimentary command-line tool and Rust library for generating secure, random passwords.

Installation

Install pwdg using cargo:

cargo install pwdg

Usage

Command Line Interface

Generate a password with default settings:

pwdg

Generate a password with at least 1 uppercase letter, 1 lowercase letter, 1 digit, and 1 special character:

pwdg -s

Generate a 12-character password with at least 2 uppercase letters, 2 lowercase letters, 2 digits, and 2 special characters:

pwdg --length 12 --min-upper 2 --min-lower 2 --min-digit 2 --min-special 2

Generate a password with default settings, but excluding the characters A, B, C, D, and E from the overall character set used for password generation:

pwdg --exclude=ABCDE

Command Line Options

$ pwdg --help
A rudimentary command-line tool and Rust library for generating secure, random passwords.

Usage: pwdg [OPTIONS]

Options:
  -l, --length <LENGTH>            Sets the length of the password. Must be at least 8 [default: 8]
      --min-upper <MIN_UPPER>      Minimum number of uppercase characters (A to Z) [default: 0]
      --min-lower <MIN_LOWER>      Minimum number of lowercase characters (a to z) [default: 0]
      --min-digit <MIN_DIGIT>      Minimum number of digit characters (0 to 9) [default: 0]
      --min-special <MIN_SPECIAL>  Minimum number of special characters.
                                   Special characters: !@#$%^&*()_+-={}[]|:;"'<>,.?/~\` [default: 0]
  -e, --exclude <EXCLUDE>          Characters to exclude from the overall character set used for password generation
  -s, --strong                     Generates a password with at least 1 uppercase letter, 1 lowercase letter, 1 digit, and 1 special character. This option overrides --min-upper, --min-lower, --min-digit, and --min-special if they are also set
  -h, --help                       Print help
  -V, --version                    Print version

Characters

Passwords may be comprised of uppercase (A to Z), lowercase (a to z), digit (0 to 9), or special characters.

The set of special characters:

! @ # $ % ^ & * ( ) _ + - = { } [ ] | : ; " ' < > , . ? / ~ \ `

License

pwdg is licensed under the Apache License, Version 2.0.

Source

Clone the repository:

git clone git@github.com:OTheDev/pwdg.git
cd pwdg

Test

cargo test  # Optionally, --release

Install

cargo install --path .

Dependencies

~1.4–2MB
~39K SLoC