Question: Exercise 3-Encryption and decryption of a text A simple cryptography method is the following one Vigenere cipher) . We take the text we want to
Exercise 3-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, the corresponding number (a = 1, b=2' c = 3, d = 4, ,z=26) . Encoding: We take the first letter of the text and the first letter of the key and we add their representations. Then we find which character corresponds to the sum and we replace the first character of the text. Then we take the second character of the text and the second number character of the key and we do the same etc. If the sum is above 26, we sub 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 character of the encoded text. 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
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
