Implementation of a rainbow table–based password cracking system for SHA-512 hashes.
This project was developed as part of a Security coursework on hash-cracking techniques, exploring practical attacks against hashed passwords.
The repository demonstrates how precomputed hash chains (rainbow tables) can significantly reduce the time required to crack password hashes compared to brute-force or dictionary attacks.
Password hashing is widely used to protect user credentials. However, poorly protected hashes can still be attacked using techniques such as:
- Brute-force attacks
- Dictionary attacks
- Rainbow table attacks
This project focuses on the rainbow table approach, which trades memory for computation time by precomputing chains of hashes and reductions.
Rainbow tables allow attackers to crack hashes faster than brute force by using precomputed lookup tables instead of recomputing hashes repeatedly.
The system targets hashes generated with:
hashlib.sha512()
as specified in the coursework requirements.
Coursework reference: cs4028-coursework-2024-25
A rainbow table consists of chains of alternating hash and reduction functions.
Example chain:
password → hash → reduction → hash → reduction → ... → final value
Instead of storing every hash, the table stores only:
start_password → end_value
During cracking:
- The target hash is reduced repeatedly.
- Possible chains are reconstructed.
- The correct password is recovered when the chain matches.
This significantly reduces the search space compared to brute-force attacks.
- SHA-512 password hashing
- Rainbow table generation
- Hash lookup using rainbow tables
- Chain reduction functions
- Configurable chain length and table size
- Efficient lookup algorithm
- Demonstration scripts