TL;DR
This guide shows you how to benchmark password cracking tools like Hashcat and John the Ripper to understand their performance on your hardware. We’ll cover setting up a test environment, generating sample hashes, running benchmarks, and interpreting the results.
Setting Up Your Test Environment
- Choose a Linux Distribution: Kali Linux is popular for cyber security tasks but any distribution will work (Ubuntu, Debian, etc.). Ensure you have sufficient disk space.
- Install Cracking Tools: Install Hashcat and John the Ripper using your distribution’s package manager.
sudo apt update && sudo apt install hashcat john - Hardware Considerations: GPU performance is crucial for Hashcat. A powerful CPU helps John the Ripper. Note your hardware specs (CPU, GPU, RAM) as you’ll need this information when comparing results.
Generating Sample Hashes
- Create Test Passwords: Generate a list of passwords to crack. Use a password generator or create your own.
pwgen -1 8 100 > passwords.txtThis creates 100 random passwords, each 8 characters long.
- Hash the Passwords: Use a hashing tool to generate hashes for your test passwords.
mkpasswd -m sha256 < passwords.txt > hashes.txtThis creates SHA256 hashes of the passwords in passwords.txt and saves them to hashes.txt. You can use other hash types (MD5, bcrypt) as needed.
Benchmarking with Hashcat
- Basic Benchmark: Run a simple benchmark to test Hashcat’s performance.
hashcat -m 0 hashes.txt ?a?a?a?a?a?a?a?aThis attempts to crack SHA256 hashes using a brute-force attack with 8-character passwords (using ‘a’ as the character set). ‘-m 0’ specifies SHA256.
- Advanced Benchmark: Use a rule-based attack for more realistic cracking.
hashcat -m 0 hashes.txt rockyou.txtThis attempts to crack the hashes using the ‘rockyou.txt’ wordlist (download this separately).
- Monitor Performance: Hashcat displays real-time statistics like hash rate (hashes/second) and estimated cracking time.
Benchmarking with John the Ripper
- Basic Benchmark: Run a simple benchmark to test John the Ripper’s performance.
john hashes.txtThis attempts to crack the hashes using its default rules and wordlist.
- Specify Wordlist: Use a specific wordlist for more control.
john --wordlist=rockyou.txt hashes.txtThis uses ‘rockyou.txt’ as the wordlist.
- Rule-Based Attack: Apply rules to generate variations of passwords.
john --rules=best64 hashes.txtThis applies the ‘best64’ rule set.
- Monitor Performance: John displays statistics like hash rate and cracking progress.
Interpreting Results
- Hash Rate: Higher hash rates indicate faster cracking speeds. Compare the hash rates of different tools on your hardware.
- Cracking Time: Note the time it takes to crack a set of passwords with each tool.
- Hardware Impact: Consider how CPU and GPU usage affect performance. Hashcat benefits more from GPUs, while John the Ripper can be faster on CPUs for certain attacks.
- Wordlist Effectiveness: Different wordlists will yield varying results. Test multiple wordlists to find the most effective one for your target passwords.

