Code: Alles auswählen
def XECryptCrack(cypher,mode='file'):
if mode == 'file':
cypher = file(cypher,'r').read()
enc_list = []
for item in cypher.split('.'):
if item != '':
enc_list.append(item)
counter = 1
enc_list_added = []
while counter < len(enc_list):
enc_list_added.append(int(enc_list[counter-1])+int(enc_list[counter])+int(enc_list[counter+1]))
counter += 3
count_max=0
for item in enc_list_added:
if enc_list_added.count(item) > count_max:
count_max = enc_list_added.count(item)
item_max = item
key = int(item_max) - 32
dec_list = []
for item in enc_list_added:
dec_list.append(int(item)-key)
readable_str = ''
for item in dec_list:
readable_str += chr(item)
return readable_str