Created
February 14, 2013 17:00
-
-
Save SkAZi/4954257 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
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