Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Haskell

image text in transcribed

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

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_2

Step: 3

blur-text-image_3

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

Optimizing Data Collection In Warzones

Authors: Aaget Aamber

1st Edition

B0CQRRFP5F, 979-8869065902

More Books

Students also viewed these Databases questions

Question

Identify five strategies to prevent workplace bullying.

Answered: 1 week ago