Advertisement
Guest User

Untitled

a guest
Apr 21st, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. #!/usr/bin/env python3
  2.  
  3. from Crypto.Cipher import DES
  4. import os,sys
  5. from base64 import b64decode
  6.  
  7. data = b64decode('noFdixIZv6Ga9rMqeTWCJTRAI3LkFFO8n9uzYZhN2KbO4II4QxH5rnTe4ltCO/ca')
  8.  
  9. size = 0x10000
  10. bsize = size / ntasks
  11. ntasks = 20
  12. for i in range(1, 22):
  13. task = int(sys.argv[1])
  14. off = (task - 1) * bsize
  15.  
  16. key1 = bytearray(b'\0' * 8)
  17. key2 = bytearray(b'\0' * 8)
  18. for i in range(off, off+bsize):
  19. key1[6] = i // 0x100
  20. key1[7] = i % 0x100
  21. print('[%04x]'% (i))
  22. d1 = DES.new(bytes(key1), DES.MODE_ECB)
  23. for j in range(0, 0x10000):
  24. key2[6] = j // 0x100
  25. key2[7] = j % 0x100
  26. d2 = DES.new(bytes(key2), DES.MODE_ECB)
  27. test_cicpher = d1.decrypt(data)
  28. if not test_cicpher or len(test_cicpher) % 8:
  29. continue
  30. test_cicpher = d2.decrypt(test_cicpher)
  31. if test_cicpher[:3] == b'HSE':
  32. raise Exception(test_cicpher)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement