Question: For this homework assignment, you will modify the Caesar cipher by shifting each letter in the plaintext by the given shift value plus the position
For this homework assignment, you will modify the Caesar cipher by shifting each letter in the plaintext by the given shift value plus the position of the letter in the plaintext. For example, if the we have:
plaintext = 'hello'
shift = 16
we would shift the 'h' by 16 since the 'h' is the first letter in the plaintext. So the plaintext would be shifted as follows:
'h' (7) - shifted by 16 + 0 ==> 23 ('x')
'e' (4) shifted by 16+1 ==> 21 ('v')
'l' (11) shifted by 16+2 ==> 29 mod 26 = 3 ('d')
'l' (11) shifted by 16+3 ==> 30 mod 26 = 4 ('e')
'o' (14) shifted by 16+4 ==> 34 mod 26 = 8 ('i')
the ciphertext would be 'xvdei'
Write a function that takes the plaintext and the shift value as parameters and returns the ciphertext using this modified Caesar cipher algorithm Write another function that deciphers the modified Caesar cipher algorithm. This second function will take the ciphertext and the shift value as parameters and return the plaintext. The output of your functions should look something like this:
Please write in Python IDLE and comment, thanks!!
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
