This Password Checker is a simple Go program designed to evaluate the strength of a given password based on its length and character composition. It estimates the time required to brute-force the password, providing a detailed breakdown in terms of years, months, weeks, days, hours, minutes, and seconds.
- Checks if the password contains lowercase letters, uppercase letters, numbers, and special characters.
- Calculates the character set size based on the types of characters used.
- Estimates the time to brute-force the password using a specified hash rate.
- Ensure you have Go installed on your machine.
- Clone this repository:
- Copy code
git clone https://github.com/MartinDeBeer/passCheck
- Navigate to the project directory:
cd password-checker
- Build the program:
go build -o password-checker
- Run the program:
./password-checker
- Enter your password when prompted:
Enter password:
- The program will then display the character set size, the number of possibilities, and the estimated time to crack the password.
Enter password:
P@ssw0rd123
94 5.062982072492058e+21
Time to crack: 58 seconds, 0 minutes, 4 hours, 4 days, 1 weeks, 8 months, 145659 years to crack!
The password checker performs the following steps:
- Read the Password: Prompts the user to enter a password and trims any whitespace.
- Pattern Matching: Uses regular expressions to check for the presence of lowercase letters, uppercase letters, numbers, and special characters.
- Character Set Size: Calculates the total character set size based on the character types found in the password.
- Number of Possibilities: Computes the total number of possible combinations based on the character set size and password length.
- Time to Crack: Estimates the time to brute-force the password based on a hash rate of 1,102,200,000 hashes per second.
- Duration Conversion: Converts the estimated time in seconds to a more human-readable format.
This project is licensed under the MIT License
Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.
Special thanks to the Go community for their support and resources.