Skip to content

Instantly share code, notes, and snippets.

@SkAZi
Created Feb 14, 2013
Embed
What would you like to do?
function hackcrypt(last, message) {
var len = message.length;
for(var ret = "", i = 0; i < len; i++)
ret += chars[last = (i + last + message.charCodeAt(i)) % 64];
return ret;
}
function uncrypt(endata){
var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),
total = 0;
for(var ll=59; ll; ll--){
var ret = "", last = ll;
for(var i=0,l=endata.length; i < l ; i++){
var next_symb = 0;
while( endata.substr(0, i+1) !=
hackcrypt(ll, ret + chars[next_symb]).substr(0, i+1) &&
next_symb < 64){
next_symb++;
}
total += next_symb;
if(next_symb == 64) break;
ret += chars[next_symb];
}
if(encrypt(ret) == endata){
console.log('Hash count: ', total, 'Password: ', ret);
break;
}
}
}
uncrypt('mWodQ3pVKgLE');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment