Question: 1. (25 pts] Simple Transposition Cipher The textbook explains the simple transposition cipher (Section 3.4) and the course slides (available on Canvas). This cipher divides
![1. (25 pts] Simple Transposition Cipher The textbook explains the simple](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f3dc32e0691_65066f3dc327d317.jpg)
1. (25 pts] Simple Transposition Cipher The textbook explains the simple transposition cipher (Section 3.4) and the course slides (available on Canvas). This cipher divides the original message into two strings corresponding to its even and odd characters. Those strings are then concatenated to form the ciphertext. Requirements: Implement the odd-even transposition cipher, placing your code in the file p4_1.py. In your p4_1.py module, define the functions encrypt (msg:str)-str and decrypt(msg:str)-str. You may define other functions as you see fit, but these three functions must match the interface specified here. The encrypt function should take in the original text and use the odd-even encryption approach described above, returning the encrypted string. The decrypt function should assume that the msg is already encrypted and decrypt it, returning the original text. Examples: The following image shows the results of executing the required functions. >>> encrypted = encrypt("It was a dark and stormy night") >>> encrypted 'twsadr n tryngti a akadsom ih' >>> original = decrypt(encrypted) >>> original 'It was a dark and stormy night
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
