the-honk/gcse computer science/year 9/python/encryption/brute force caesar decrypter.py
2021-05-28 21:38:55 +01:00

18 lines
No EOL
394 B
Python

counter = 26
ciphertext = input('Please input some ciphertext to decrypt.')
ciphertext = ciphertext.upper()
while counter >= 0:
outputWord = ''
for i in ciphertext:
asc = ord(i)
shiftChr = asc + counter
if shiftChr >= 90:
shiftChr = (shiftChr-90)+64
outputWord = outputWord + chr(shiftChr)
print(outputWord)
counter = counter - 1