Skip to content

Instantly share code, notes, and snippets.

@Andoryuuta
Created March 21, 2019 05:56
Show Gist options
  • Save Andoryuuta/b3c42bb3b18ced5c46e75796c21794db to your computer and use it in GitHub Desktop.
Save Andoryuuta/b3c42bb3b18ced5c46e75796c21794db to your computer and use it in GitHub Desktop.
_SLOW_ decryptor for bleach brave souls
# Requires python3 and the py3rijndael package:
# >> py -3 -m pip install py3rijndael
from py3rijndael import Rijndael
import sys
import io
import gzip
if len(sys.argv) < 3:
print("Usage: {} <input file> <output file> [OPTIONAL <key>]".format(sys.argv[0]))
else:
in_file_name = sys.argv[1]
out_file_name = sys.argv[2]
# Optional key argument with default value.
key = b'1479f22faea6ad4630c1d7fdc6851509'
if len(sys.argv) == 4:
key = sys.argv[3]
with open(in_file_name, 'rb') as in_file:
with open(out_file_name, 'wb') as out_file:
# Do the decryption. This will take a minute, doing this 32 bytes at a time (256bit block size) with py3rijndael is _slow_.
print('Decrypting...')
cipher = Rijndael(key, block_size=32)
output = io.BytesIO()
while True:
data = in_file.read(32);
if len(data) == 0:
break
output.write(cipher.decrypt(data))
# Decompress glib
print('Decompressing...')
decomp = gzip.decompress(output.getvalue()) # 1F 8B 08 gzip header
out_file.write(decomp)
@Poteryannyy
Copy link

How does he work?

@Andoryuuta
Copy link
Author

@Poteryannyy This is three years old at this point, so I imagine the encryption key (or encryption method itself) has likely changed.

@Poteryannyy
Copy link

@Poteryannyy This is three years old at this point, so I imagine the encryption key (or encryption method itself) has likely changed.

I recently tried to decrypt the _masted.db file with it, it took a very long time to load, so I asked

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment