Trying out a simple text cipher program by simply mapping each alphabet to a numerical value plus one. Here is the code.
import string
chars = [c for c in string.ascii_lowercase]
nums = [n for n in range(1, 27)]
plain_cipher = dict(zip(chars, nums))
prompt = input("Enter a word to decipher > ")
# Ciphering ...
print('Ciphering ... ')
cipher = [str(plain_cipher[char]+1)for char in prompt]
print('-'.join(cipher))
# Deciphering ...
decipher = [int(num)-1 for num in cipher]
text = ''
for k in plain_cipher.keys():
for n in decipher:
if plain_cipher[k] == n:
text += k
print('Deciphering ... ')
print(text)
. 
Prints out the correct ciphered output but the wrong deciphered output. Output returned alphabetically. How do you correct this?