The student will:
This problem is originally from: http://www.simpson.edu/~cs/problems.html
In a Vignère cipher, each letter of the alphabet corresponds to a number using the scheme: A=0, B=1, C=2, ... Y=24, Z=25. To encode a message, an encryption key word is "added" to the message. For example, if the message were IDES OF MARCH, and the key DAGGER used, the encryption would be:
Message: IDESOFMARCH Key: DAGGERDAGGE Encryption: LDKYSWPAXIL
Note that spaces are not encrypted and sums greater than 25 wrap back around to the beginning of the alphabet again. For example, L + W yields H. The ASCII code for the letter A is 65.
Create a program that would encrypt and decrypt messages based upon the following scheme:
When encrypting, the Vignère method is used. The key is the first word of the message that is at least five letters or longer. For example, in the message "IDES OF MARCH", "MARCH" would be chosen as the key. If the message contains only four letter or shorter words, such as "WILL THIS BE ON THE TEST", then the first five letters of the message ("WILLT") become the key. You may assume that punctuation will not be entered, uppercase letters will be used, and that messages shorter than five letters will not be encoded.
Have your program ask its user if it is to encode or decode a message. When encoding, it should take in the message and give both the key and the encrypted message. When decoding, it should take in the encrypted message and the key, and give the decoded message.
To make this program easier: