Created
July 10, 2012 21:21
-
-
Save 0xa/3086304 to your computer and use it in GitHub Desktop.
Minecraft lastlogin decrypt
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
import Crypto.Random | |
from Crypto.Cipher import DES | |
import hashlib | |
import struct | |
password = "passwordfile"; | |
salt = "\x0c\x9d\x4a\xe4\x1e\x83\x15\xfc"; | |
iteration_count = 5; | |
def decrypt(ciphertext): | |
key = password + salt | |
for i in range(iteration_count): | |
key = hashlib.md5(key).digest() | |
cipher = DES.new(key[:8], DES.MODE_CBC, IV=key[8:]) | |
output = cipher.decrypt(ciphertext) | |
return output; | |
def parseOutput(out): | |
username_len = struct.unpack(">h", out[0:2])[0]; | |
username = out[2:username_len+2]; | |
password_len = struct.unpack(">h", out[username_len+2:username_len+4])[0]; | |
password = out[username_len+4:username_len+password_len+4]; | |
return (username, password); | |
file = open("lastlogin", "rb"); | |
out = parseOutput(decrypt(file.read())); | |
file.close(); | |
print "Username : ", out[0]; | |
print "Password : ", out[1]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment