Basic C++ project for enhanced password management with passwdhk.
- Integrates with passwdhk to encourage stronger passwords.
- Lets you define wordlists where each word carries a value.
- Exits with a status code indicating whether the password is strong enough.
The word list file should be a .txt or .csv file with each line containing a word and its associated value, separated by a comma. For example:
password,1
123456,1
qwerty,1I've also tested storing the wordlist on a UNC-path, which works fine. Which means you can store the wordlist in your NETLOGON share, and use it from there.
Prerequisites:
- CMake
- A C++ compiler (e.g., GCC, Clang, MSVC)
Steps to build:
- Clone the repository
- Run
cmake -B buildin the root directory - Run
cmake --build buildto build the project
For Windows, you need to run cmake --build build --config Release to build the project in release mode.
PasswordRater.exe <path to wordList> <username> <password>Based on the documentation of passwdhk, you specify the registry keys preChangeProg and preChangeProgArgs
In the preChangeProg you configure the path to the executable, and in the preChangeProgArgs you configure the path to the wordlist. The username and password is provided automatically.
The application uses a config.ini file for settings. The config file is copied to the build directory automatically during the build process. You can change the values as you please.
Example config.ini:
[PasswordSettings]
# The minimum score a password must reach to be considered valid.
# Increase this value to require stronger passwords.
#
# Default is 10.
MinimumScore=10
# Whether the provided username is allowed to appear in the password.
# Set to 'true' to permit the username as part of the password, or 'false' to forbid it.
#
# Default is false.
AllowUsernameAsPassword=false
# The maximum allowed repeat count for any single character in the password.
# If a character repeats more than this number consecutively, only half of the extra characters will count toward the score.
# For example, with MaxRepeatingCharacters=3, the run 'aaaaa' (5 a's) is scored as 2.
#
# Default is 3. Set to 0 to disable.
MaxRepeatingCharacters=3
# The maximum allowed repeat count for consecutive digits in the password.
# If a digit sequence is longer than this value, only half of the extra digits will count toward the score (integer division).
# Example: With MaxConsecutiveDigits=2, the run '12345' (5 digits) is scored as 2.
#
# Default is 2. Set to 0 to disable.
MaxConsecutiveDigits=2
The project will run without a config file.
Contributions are welcome! Please open an issue or submit a pull request.
This project is licensed under the MIT License.