The result of a Caesar cipher looks like gibberish, but it's actually quite easy to break a Caesar cipher. Simply try decrypting the message with each of the possible shifts 1 through 26 and look at the results. When the shift is incorrect, the result is still gibberish, but when the shift is correct, the result looks like words, albeit in five-grams without spaces or punctuation.
The Vigenère cipher improves on the Caesar cipher by using multiple interlaced Caesar ciphers. This cipher uses a word as its key. Each letter in the key represents a shift. For example, A represents a shift of 0, B represents a shift of 1, and so forth. The cipher matches letters in the plaintext with letters in the key, repeating the key if necessary. It then uses the key letters' shifts to modify the plaintext letters.
Write a program similar to the one you wrote for the preceding problem but this time use a Vigenère cipher to encrypt and decrypt messages.