Entry level python code
1. (2 points) (Attacking the Caesar Cipher.) We discussed how the Caesar Cipher is sus- ceptible to a brute force attack since there are only 25 possible keys (1-25). Write a function caesarBrute that, given a ciphertext as input, prints to the screen every possible decryption. comment under your func but need to copy these functions into your lab. this function to find the message that led to 'ghm 1h lxvkxm and put the answer in s tion. You are welcome to use any of the functions we wrote in class 2. (3 points) (Two-Key Caesar Cipher.) In the two-key Caesar Cipher, there are two keys key even and key.odd, each a number from 1 to 25. Letters in even positions are shifted over key-even spots, while letters in odd positions in the string are shifted over key-odd spots. Implement encryption and decryption functions for this cipher called tuoCaesarEnc and twoCaesarDec. As with the modifications you made to the Caesar Cipher your functions should only shift letters and handle both upper and lower case letters.(Hint: your encryption function will now take three arguments instead of just two.) 3. (2 points) (A Transposition Cipher: Swap-Them.) To encrypt a string s using the Swap- Them transposition cipher, the character in position i is swapped with the character in posi- tion (key-i)%len (s). Implement encryption and decryption functions for this cipher called swapenc and swapdec For example, swapenc (4,'strong vind) should return nortsdniw g 4. (4 points) (Acronyms.) An acronym is a word formed by taking the first letters of the words in a phrase and making a word from them. For example, RAM is an acronym for "random access memory." Write a function acronym that takes one input string and then outputs t acronym for that phrase. Note: the acronym should be all uppercase, even if the words in the phrase are not capitalized. For example acronym'Random access memory) should return RAM'. (Hint: don't forget to test strings with multiple spaces and spaces at the beginning.) Note that since we have not covered lists, you may not use any string functions or methods that return lists (e.g., split is not allowed)