Created
December 22, 2015 17:09
-
-
Save TomYeoman/515f559982b3a85b5143 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// MD5 hash puzzle test | |
function findHash(){ | |
var secretKey = "iwrupvqb"; | |
var tempKey = ""; | |
var solution = ""; | |
var solutionFound = false; | |
for (var i = 0; i < 2000000; i++){ | |
if (!solutionFound){ | |
tempKey = secretKey + i; | |
hashValue = String(CryptoJS.MD5(tempKey)); | |
console.log(i+": "+hashValue); | |
if (hashValue.substring(0, 5) === "00000"){ | |
solution = hashValue; | |
alert(solution); | |
solutionFound=true; | |
} | |
tempKey = ""; | |
} | |
} | |
if (solutionFound){ | |
console.log("SOLUTION FOUND WITH HASH CODE: "+solution) | |
} | |
} | |
findHash(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment