Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

the polyalphabetic cipher that uses a word as the key for shifting the plaintext and creating ciphertext. When the keyword is smaller than the plaintext,

the polyalphabetic cipher that uses a word as the key for shifting the plaintext and creating ciphertext. When the keyword is smaller than the plaintext, the keyword is repeated. A variation on this algorithm uses the keyword to shift the plaintext, and if the keyword is smaller than the plaintext, the keyword is used, followed by the reverse of the keyword, and then the keyword again until all letters in the plaintext are shifted. For example, given the following plaintext and keyword:

plaintext = computerscience

keyword = code

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

computerscience

codeedoccodeedo

c would be shifted by c, o would be shifted by o, m would be shifted by d, p would be shifted by e, the u would be shifted by e, and so on.

The resulting ciphertext of the example above would be:

ecptywstuqlirfs

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. Write another function that deciphers this variation of hte polyalphabetic cipher.

Test your functions with the following examples:

polyReverse("computerscience","code")

"ecptywstuqlirfs"

unPolyReverse(ecptywstuqlirfs,code)

computer science

polyReverse(supercalifragilistic,poppins)

hietzpsdvngpuxawhiqp

unPolyReverse(hietzpsdvngpuxawhiqp, poppins)

supercalifragilistic"

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Power Bi And Azure Integrating Cloud Analytics For Scalable Solutions

Authors: Kiet Huynh

1st Edition

B0CMHKB85L, 979-8868959943

More Books

Students also viewed these Databases questions

Question

What is an interface? What keyword is used to define one?

Answered: 1 week ago