Implement Monoalphabetic Cipher Encryption And Decryption In Python
I have to make a Substitution Cipher Program, where I first create a randomized secret-key and then use this key to decrypt/ encrypt some user input (plaintext). The constraints for the problem as follows: • encryptMsg(plaintext,key,alphabet) Takes a plaintext string, an alphabet string and a secret key string as arguments and returns an encrypted cipher string. Note, within this function, you must first convert the plaintext string to all lower case and remove any punctuation/characters that do not appear in the alphabet string! • decryptMsg(ciphertext,key,alphabet) Will take a ciphertext string, an alphabet string and a secret key string and return the plaintext string. • makeKey(alphabet) Generate and return a secret-key string by randomly shuffling the characters in the alphabet string argument. Hint: this involves turning the string into a list, using the random.shuffle() method, then turning the list back into a string Here's what I have: import random alphabet = 'abcdefghijklmnopqrstuvwxyz.,!' ' def makeKey(alphabet): alphabet= list(alphabet) key= random.shuffle(alphabet) alphabet= str(alphabet) return key def encrypt(plaintext, key, alphabet): ''Encrypt the string and return the ciphertext'' return '.join(key[l] for l in plaintext) print (alphabet) I know I'm doing something wrong with the makeKey function because it doesn't work.
I need some help on how to start the other functions. We cannot use dictionaries, only list methods. Download Game Resident Evil 4 Pc Full Ripe. Install Leisure Suit Larry 7 Windows Xp more. Any help or just advice on jumpstarting me in my assignment will be highly appreciated.