Hash cracker
Overview
This project is a command-line wordlist hash cracker built to learn how common digest algorithms work and how CPU-bound candidate generation can be distributed across multiple processes.
The program reads a file of target hashes and a wordlist, hashes every candidate with one or more selected algorithms, and reports candidates whose digest matches a target. Target hashes are stored in a set so each comparison uses efficient membership lookup.
Current features
- File-based wordlist and target-hash input.
- Support for algorithms exposed by Python’s
hashlibinterface. - Multiple comma-separated algorithms in a single run.
- Optional salt values placed before or after each candidate.
- Lazy task generation instead of constructing every candidate and algorithm combination in memory first.
- Parallel comparison with
ProcessPoolExecutor. - A concise result summary containing the plaintext candidate, matching digest, and algorithm.
Example usage
python hashcracker.py \
--hashes files/hashes.txt \
--wordlist files/wordlist.txt \
--algorithm md5,sha256Salted candidates can be tested by adding --salt and selecting either --salt-position beginning or --salt-position end.
What I learned
- How deterministic digest functions enable offline wordlist comparisons.
- How salts change the byte sequence supplied to a hash function.
- Why a set is useful when comparing candidates against multiple target hashes.
- How generators keep large candidate pipelines from being loaded into memory at once.
- When multiprocessing is more appropriate than threads for CPU-bound work.
- Why password storage requires deliberately slow, password-specific algorithms rather than general-purpose hashes.
Current status and next steps
The main cracking pipeline, multi-algorithm support, salt positioning, and multiprocessing are implemented. Planned improvements include pre-validating algorithm names, normalizing and validating input hashes, controlling the worker count and chunk size, reporting progress and elapsed time, handling duplicate matches, and adding automated tests and benchmarks.
This is an educational tool for testing hashes I generated or am explicitly authorized to audit.