quentin.dufour.io/assets/code/cesar-python2.py

13 lines
408 B
Python
Raw Normal View History

2018-07-07 16:13:33 +00:00
with open('communication_vBZvcbm.txt', 'rb') as f:
all_bytes = f.readlines()
all_bytes = all_bytes[0] + all_bytes[1]
for n in range(1,128):
2018-07-07 16:32:43 +00:00
print "\033c"
2018-07-07 16:34:25 +00:00
print "==== try number " + str(n) + " ==== \n\n"
2018-07-07 16:13:33 +00:00
dec = [0] * len(all_bytes)
for i in range(len(all_bytes)):
dec[i] = (ord(all_bytes[i]) + n) % 128
print(''.join([chr(x) for x in dec]))
raw_input()