Crack hashes hashed with the FNV-1a algorithm without full brute force
Huge thank you to ConnorM for his incredible writeup and writing the original python proof of concept of which this is based off of. He does some incredible work with cryptography and his writeups are worth a read.
This project requires the following libraries:
- mpfr
- gmp
- fplll
NOTE: This project uses the fplll library which does not support Windows. If you are looking to use this on Windows, look into WSL.
Run the following commands to get started
git clone https://github.com/Nico-Posada/fnv-hash-cracking.git
cd fnv-hash-cracking
If you do not have the fplll library installed, run the following:
sudo apt install fplll-tools
or if you want to build it from source (will probably be better optimized for your machine), run the following
chmod +x scripts/setup.sh
sudo scripts/setup.sh
conda install fplll
brew install fplll
More information on compilation and installation specifics can be found in the fplll repository.
To compile the test cases, run the following
make test
The binary will be output in the build/
directory.
To compile and run the test script, run the following
make run-test
To use in your own program, just copy over the src
directory to your project directory and you can include it in your build script as normal. This uses header files only, so no need to make any object files beforehand.
- fplll has docker containers. Figure out how to make this work in them and provide steps.
- Clean up code, add more tests and actual test outputs.
- Add multithreading support back in.
- Maybe add a python module for this?
- Add support for setting the hash/prime/bit len dynamically to make this into a proper CLI
- If this happens, maybe add JIT compilation for some speedup?
- Benchmarks