Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python3
- from Crypto.Cipher import DES
- import os,sys
- from base64 import b64decode
- data = b64decode('noFdixIZv6Ga9rMqeTWCJTRAI3LkFFO8n9uzYZhN2KbO4II4QxH5rnTe4ltCO/ca')
- size = 0x10000
- bsize = size / ntasks
- ntasks = 20
- for i in range(1, 22):
- task = int(sys.argv[1])
- off = (task - 1) * bsize
- key1 = bytearray(b'\0' * 8)
- key2 = bytearray(b'\0' * 8)
- for i in range(off, off+bsize):
- key1[6] = i // 0x100
- key1[7] = i % 0x100
- print('[%04x]'% (i))
- d1 = DES.new(bytes(key1), DES.MODE_ECB)
- for j in range(0, 0x10000):
- key2[6] = j // 0x100
- key2[7] = j % 0x100
- d2 = DES.new(bytes(key2), DES.MODE_ECB)
- test_cicpher = d1.decrypt(data)
- if not test_cicpher or len(test_cicpher) % 8:
- continue
- test_cicpher = d2.decrypt(test_cicpher)
- if test_cicpher[:3] == b'HSE':
- raise Exception(test_cicpher)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement