Skip to content

Instantly share code, notes, and snippets.

@TomYeoman
Created December 22, 2015 17:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TomYeoman/515f559982b3a85b5143 to your computer and use it in GitHub Desktop.
Save TomYeoman/515f559982b3a85b5143 to your computer and use it in GitHub Desktop.
// 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