To embed a CRC-32 hash collision within a script to make the file hash to that value.
- Add exactly
sum=00000000
with a newline anywhere in a script file/path/to/your/file
#!{{whatever}}
# ... your code
sum=00000000
## bash self-check example
[ "$(crc32 "$0")" = "$sum" ] || { echo >&2 "$0: Hash failed"; exit 1; }
# ... code to run
- Run
$ git clone https://gist.github.com/c85d295cf9e6124dd7e90716dc7b7310 find-crc32-collision
$ cd find-crc32-collision
$ make
$ bash find-crc32-in-parallel /path/to/your/file
### wait a long time
- Update the script with found CRC-32 value
- More physical cores = more performance with linear speed-up.
- The parallel script is wasteful once it has found a match. Just ^C it if you only care to find one rather than to brute force the entire hash range.
- While it maybe possible to adapt a brute force search to find an MD-5, SHA-0, or SHA-1 on a many-core server, it's probably a waste of time and money. It would probably work better re-arranged to launch many multiple AWS micro instances similar to computing rainbow tables.