Question: Haskell 8. vigenere String - String -> String The Vigenere encryption scheme is similar to the Caesar cipher presented in class in that it makes

Haskell

Haskell 8. vigenere String - String -> String The Vigenere encryption scheme

8. vigenere String - String -> String The Vigenere encryption scheme is similar to the Caesar cipher presented in class in that it makes use of shifting, but instead of a single numeric key applied uniformly to the entire plain text, a string of characters is used as the key. The numeric value of each character (as its position in the alphabet) is used as a shift value, and if the key is shorter than the length of the plain text it is simply repeated E.g., to encrypt the plain text "FOOBAR" with the key "BAZ", we can proceed as follows: 1. Paireach letter of the plain text with a letter from the key: F O O B A R B AZ BA Z 2. Convert each letter to its numeric value (A-0, B-1. Z-25) 5 14 14 1 0 17 1025 1025 3. Add them together: 6 14 39 2 0 42 4. "Wrap" the numbers around so they're in the range 0-25: 6 14 132 0 16 5. Convert the numbers back into letters: Write a function that takes a key and plain text and returns the Vigenere encrypted cipher text. Plain text can contain a mix of lowercase and uppercase letters and punctuation, but all letters will be interpreted as uppercase. Punctuation will not be encrypted. The key will contain only letters (lower or upper case), but again will only be interpreted as uppercase

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!