Question: Vigenre Cipher. In the Vigenre Cipher, we use a special keyword to encrypt a message. We represent each letter of the alphabet as a number
Vigenre Cipher. In the Vigenre Cipher, we use a special keyword to encrypt a message. We represent each letter of the alphabet as a number from 0-25. In order, we add each letter from the keyword to the message and mod by 26. If the keyword is shorter than the message, we simply repeat the keyword. For example, lets say that the message is HOWSTUFFWORKS and the keyword is CIPHER. The following table shows how we can find the final version of the ciphertext, borrowed from How Stuff Works. Plain Text: HOWSTUFFWORKS Keyword: CIPHER Cipher Text: JWLZXLHNLVVBU Your mission is to write a program that will read a message and a keyword and apply the Vigenre Cipher to it. Your main() method should prompt the user for some plain text. Then, it should prompt the user for a keyword. You may assume that both the plain text and the keyword contain no spaces and are only made up of upper case letters. To perform the encryption, you need to loop through the plain text and add each letter from the keyword to it, mod 26. Unfortunately, neither the letters in the plain text nor in the keyword have values between 0 and 25. You will have to convert those letter values so that they are between 0 and 25, then do the add, then do the mod, then convert them back to the proper ASCII values Must be in Java. With comments
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
