A C++ utility that generates human-readable, memorable passwords while avoiding dictionary words. Creates secure passwords using pronounceable syllables with configurable complexity options.
- Generates pronounceable password bases (alternating consonants/vowels)
- Configurable password length
- Batch generation — produce N passwords in one call (
-count) - Optional 2-digit number injection (
-digits) - Optional uppercase letter injection (
-upper) - Optional special character injection (
-special) - Customizable special character set (
-chars) - Exclude visually ambiguous characters (
-no-ambiguous) - Entropy estimate and strength label (
-strength) - Cryptographically seeded PRNG throughout (no
rand()/srand())
- C++20 compatible compiler (GCC, Clang, MSVC)
- CMake 3.8+
mkdir build && cd build
cmake ..
cmake --build . --config ReleaseOr using presets (recommended):
cmake --preset linux-release # Linux / macOS
cmake --preset windows-release # Windows
cmake --build --preset linux-release./passgen -length 10Example output: zexovakipo
./passgen -length 12 -digits -specialExample output: vupa41@jelowi
./passgen -length 12 -digits -upper -specialExample output: vuPa41@jelowi
./passgen -length 14 -digits -special -count 5Example output:
zupakire93!bevo
nomifatu!47reba
...
./passgen -length 14 -digits -upper -special -strengthExample output: zupA93!kirebavo [82.4 bits, Strong]
./passgen -length 12 -digits -no-ambiguousRemoves 0, O, l, 1, I from all character sets.
./passgen -length 14 -special -chars "£€$"Example output: jaxu£pokiter
./passgen -help
./passgen -version| Flag | Value | Description |
|---|---|---|
-length N |
Yes | Total password length (required) |
-count N |
Yes | Number of passwords to generate (default: 1) |
-digits |
No | Inject 2 random digits |
-upper |
No | Inject 1 uppercase letter |
-special |
No | Inject 1 special character |
-chars CHARS |
Yes | Custom special character set (default: !@#$%^&*) |
-no-ambiguous |
No | Exclude visually ambiguous chars: 0 O l 1 I |
-strength |
No | Print entropy estimate and strength label |
-version |
No | Print version and exit |
-help |
No | Print this help and exit |
- Computes base length: total length minus slots reserved for injected groups
- Builds a pronounceable base using alternating consonants/vowels
- Generates each injected group (digits, uppercase, special) independently
- Shuffles insertion order, then splices each group at a random position
- All randomness from a single
mt19937seeded bystd::random_device— norand()
entropy = length × log₂(alphabet_size)
where alphabet size accumulates: 26 lowercase + 26 uppercase (if -upper) + 10 digits (if -digits) + special set size (if -special), minus ambiguous chars (if -no-ambiguous).
| Bits | Label |
|---|---|
| < 40 | Weak |
| 40–59 | Fair |
| 60–79 | Good |
| ≥ 80 | Strong |
MIT License - see LICENSE