2014-git-work/javascript/deffftp.html
2012-08-28 22:46:51 +09:00

41 lines
No EOL
1.1 KiB
HTML

<!DOCTYPE html>
<meta charset="UTF-8">
<title>FFFTPパスワード解読</title>
<script>
function deffftp(Str) {
if (Str == null) return;
Put = "";
for( i = 0; i < Str.length; i+=2 ){
Get1 = Str.charCodeAt(i);
Get2 = Str.charCodeAt(i+1);
Rnd = Get1 >> 4 & 0x3;
Ch = (Get1 & 0xF) | ((Get2 & 0xF) << 4);
Ch <<= 8;
if ((Get1 & 0x1) != 0) i++;
Ch >>= Rnd;
Ch = (Ch & 0xFF) | ((Ch >> 8) & 0xFF);
Put += String.fromCharCode(Ch);
}
return Put;
}
function decode() {
Out = ""
Str = document.getElementById("input").value.split(/\n/);
while(Str.length > 0){
Out += deffftp(Str[0]) + "\r\n";
Str.shift();
}
document.getElementById("output").value = Out;
}
</script>
<h3>FFFTPパスワード解読</h3>
ffftp.iniに書かれたパスワードを解読します。
<form action="">
<textarea id="input" name="" rows="10" cols="30">XN^MVMEGeVMeJ[NFmKJmJV^M</textarea>
<input type="button" value="解読" onClick="decode()">
<textarea id="output" name="" rows="10" cols="30"></textarea>
</form>
<footer>
&copy;2012 kou029w - <a href="http://www.opensource.org/licenses/mit-license.php">MIT License</a>
</footer>