Question: Exercise 4 - Encryption and decryption of a text A simple cryptography method is the following one Vigenere cipher) We take the text we want

Exercise 4 - Encryption and decryption of a text A simple cryptography method is the following one Vigenere cipher) We take the text we want to encrypt and the key P. We suppose that P has length equal to n . We assign to each letter, both for the text and the key, a number based on the following pattern: a=1, b 2, c = 3, d = 4, Encoding: We take the first letter of the text and the first letter of the key and we add their number representations. Then, we find which character corresponds to the sum and we replace the first letter of the text with that character. Then, we take the second character of the text and the second character of the key and we do the same etc. If the sum is above 26, we subtract 26. Decoding: We take the first letter of the encoded text and the first letter of the key and we subtract their number representations. Then, we find which character corresponds to the result and we replace the first letter of the encoded text with that character. Then, we take the second character of the encoded text and the second character of the key etc. If the result is below 0, we add 26. In any case, if the key ends, we start from the beginning Write a C program that reads from the keyboard the key and a phrase. Implement the encryption and the decryption functions. Capital and lower letters should be considered the same. Spaces are ignored. For your program you can use the isaplha) tolower functions from
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
