Question: We learned in class about the polyalphabetic cipher that uses a word as the key for shifting the plaintext and creating ciphertext. A variation on

We learned in class about the polyalphabetic cipher that uses a word as the key for shifting the plaintext and creating ciphertext. A variation on this algorithm removes duplicates from the keyword, appends the keyword to the front of the alphabet, and then uses that as the shift key for the cipher. For example, given the following plaintext and keyword:

plaintext = hello

keyword = bye

we would encrypt the plaintext by shifting each letter by the corresponding letter of the keyword followed by the plaintext as follows:

byeab

hello

h would be shifted by b, e would be shifted by y, l would be shifted by e, the next l would be shifted by a, and the o would be shifted by b.

The resulting ciphertext of the example above would be:

icplp

Write a function that implements this variation on the polyalphabetic cipher. The parameters of the function will be the plaintext and the keyword. The function will return the ciphertext. Test your program using the following examples:

You can find the Python code for the Caesar and polyalphabetic ciphers here:

[ [http://www.cs.uri.edu/~cingiser/csc110/assignments/cipher.py] ]

*Please write in Python IDLE and comment, thanks!

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!