Guest User

Untitled

a guest
Dec 11th, 2018
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. import binascii
  2.  
  3. DICT = "qwertyuiopasdfghjklzxcvbnm"
  4.  
  5.  
  6. def decrypt_xor(encoded):
  7. nums = binascii.unhexlify(encoded.strip())
  8.  
  9. for j in range(0, 256):
  10. key = max(nums, key=nums.count) ^ j
  11. res = ''.join(chr(num ^ key) for num in nums)
  12. if len(list(filter(lambda x: x.lower() in DICT, res))) > 25:
  13. print(res)
  14.  
  15.  
  16. for i in encoded:
  17. decrypt_xor(i)
Add Comment
Please, Sign In to add comment