Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import sys
- with open('encrypted_text', 'r') as file:
- mes = file.read()
- alphabet = set('qwertyuiopasdfghjklzxcvbnm_')
- key_len = 24
- for step in range(0, key_len):
- possible = {i for i in range(0, 256)}
- for b in range(256):
- for index in range(step, len(mes), key_len):
- # print('b = {0}; {1}'.format(b, chr(ord(mes[index]) ^ b)))
- symbol = chr((ord(mes[index]) ^ b) % 256)
- if b in possible and symbol not in alphabet:
- possible.remove(b)
- print(len(possible))
- # for code in possible:
- # print(chr(code), end=' ')
- # print()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement