This code generates hashes that can be used to test your node.js application against a vulnerabilty to hash collisions attacks. We use the "meet in the middle" method to generate collisions very fast. This video describes how a hash collision attack works
Use it for good, not evil!
gcc -o generateCollisions generateCollisions.c -O3
This example generates over 9000 collisions against the hash of "teststr"
./generateCollisions teststr 100000
This code shows you how to generate hashes and put them into a JSON string. Me measure the time it needs to parse this JSON string again
./generateCollisions teststr 100000 > collisions.txt ./jsonify.js collisions.txt > json.txt ls -lh json.txt # before we start, lets check how big the file is that we have generated time ./testHashes.js json.txt # this will take a very long time