This project is a Python-based password cracker that demonstrates the effectiveness of brute-force and dictionary attacks against hashed passwords. It includes a command-line interface (CLI) as well as a graphical user interface (GUI) built with tkinter
.
- Supports
sha224
,sha256
, andmd5
hashing algorithms. - Two cracking methods:
- Brute-force Attack: Tries all possible combinations of characters.
- Dictionary Attack: Uses a precompiled wordlist, such as
rockyou.txt
.
- GUI interface for easy interaction.
- Command-line interface for advanced usage.
-
Clone the repository:
git clone https://github.com/yourusername/password-cracker.git cd password-cracker
-
Create a virtual environment (optional but recommended): bash Copy code python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install the required Python packages: bash Copy code pip install -r requirements.txt
-
Download the rockyou.txt wordlist (if you don't have it already):
You can run the password cracker directly from the command line using main.py :
python main.py <hashed_password> --method --wordlist <path_to_wordlist>
• <hashed_password>: The hashed password you want to crack.
• : The hashing algorithm (sha224, sha256, md5).
• --method: The cracking method, either brute-force or dictionary.
• --wordlist: Path to the wordlist file (required for dictionary attack).
Example:
python main.py 5f4dcc3b5aa765d61d8327deb882cf99 md5 --method dictionary --wordlist wordlists/rockyou.txt
The project also includes a tkinter-based GUI for easier interaction. python password_cracker_gui.py
- Enter the hashed password.
- Select the hash algorithm.
- Choose the attack type (brute-force or dictionary).
- For dictionary attacks, specify the path to the wordlist.
- Click "Crack Password" to begin.
Unit tests are provided in the tests/ directory. You can run these tests using the unittest framework.
python -m unittest discover tests
This project is licensed under the MIT License. See the LICENSE file for more details.