43 lines
1.1 KiB
Markdown
43 lines
1.1 KiB
Markdown
# MagicHashes
|
|
|
|
> Some tools to (try to) break "Magic Hashes".
|
|
|
|
## Introduction
|
|
|
|
If you wonder what a "magic hash" is, please check [this link](https://www.whitehatsec.com/blog/magic-hashes/).
|
|
At the time of writing, no such hashes have been found against the SHA-2 family.
|
|
|
|
This repository contains three different (pretty naive) brute-forcing implementations.
|
|
|
|
They have been developed to output **exactly** the same piece of information, when matching.
|
|
|
|
## Usage
|
|
|
|
### C
|
|
|
|
```bash
|
|
# Install dependency (Debian example) :
|
|
aptitude install libssl-dev
|
|
|
|
# Compilation time :
|
|
gcc -Wall -Wextra -O3 -std=c99 -o magic_hashes_random.out magic_hashes_random.c -lssl -lcrypto
|
|
gcc -Wall -Wextra -O3 -std=c99 -o magic_hashes_iterative.out magic_hashes_iterative.c -lssl -lcrypto
|
|
|
|
# Execution time :
|
|
./magic_hashes_random.out
|
|
./magic_hashes_iterative.out
|
|
```
|
|
|
|
### Python
|
|
|
|
```bash
|
|
python3 magic_hashes_random.py
|
|
```
|
|
|
|
## Performances
|
|
|
|
As far as I can tell, and on my setups only :
|
|
|
|
* The random C implementation is ~75% faster than the Python one.
|
|
* The iterative C implementation is ~10% faster than the C random one.
|