Created
February 25, 2019 02:53
-
-
Save fadil703/794b2f1bd6ad97458eeba92746c873e1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from string import ascii_letters | |
cipher_letters = 'defghijklmnopqrstuvwxyzabcDEFGHIJKLMNOPQRSTUVWXYZABC' | |
trans = str.maketrans(ascii_letters, cipher_letters) | |
trans_rev = str.maketrans(cipher_letters, ascii_letters) | |
text_to_cipher = input('Text to cipher: ') | |
ciphered = text_to_cipher.translate(trans) | |
plaint = ciphered.translate(trans_rev) | |
print(f'Ciphered text: {ciphered}') | |
print(f'plain tex: {plaint}') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment