view this code at tagsshortcryptographymath"" import random try import pyperclip pyperclip copies text to the clipboard except importerror pass if pyperclip is not installeddo nothing it' no big deal every possible symbol that can be encrypted/decrypted letters 'abcdefghijklmnopqrstuvwxyz def main() print('''simple substitution cipherby al sweigart simple substitution cipher has one-to-one translation for each symbol in the plaintext and each symbol in the ciphertext ''' let the user specify if they are encrypting or decrypting while truekeep asking until the user enters or print('do you want to ( )ncrypt or ( )ecrypt?' response input(''lower( if response startswith(' ') mymode 'encrypt break elif response startswith(' ') mymode 'decrypt break print('please enter the letter or ' let the user specify the key to use while truekeep asking until the user enters valid key print('please specify the key to use ' if mymode ='encrypt' print('or enter random to have one generated for you ' response input(''upper( if response ='random' mykey generaterandomkey( print('the key is {keep this secret!format(mykey) break else if checkkey(response) mykey response break let the user specify the message to encrypt/decrypt print('enter the message to {format(mymode) mymessage input('' perform the encryption/decryption if mymode ='encrypt' translated encryptmessage(mymessagemykey elif mymode ='decrypt' translated decryptmessage(mymessagemykeysimple substitution cipher