Question: How to develop a Vigenere Cipher C++ program? Background info: We can use a combination of letter to number mappings and modulo arithmetic to accomplish
How to develop a Vigenere Cipher C++ program?
Background info:
We can use a combination of letter to number mappings and modulo arithmetic to accomplish this. For example, we can map the letter a to the number0, b to1, . . . , z to25. For example, to encrypt a plaintext t when the corresponding key letter is b:
Convert t into a number (19)
Convert b into a number (1).
Add the two numbers (mod 26):(19 + 1)%26.
Convert the result back into a letter (20represents the letter u).
Transforming the cyphertext to plaintext is similar, with the only difference being the key value is subtracted from the letter value.
Example of a working program:
(1) Acceptencryptordecryptas input.
(2) Accept thekeyas input.
(3) Accept either the plain text or cypertext, depending on the first input.
(4) Print out the resulting string (the example has *** on either side to show that there are no spaces in the result.)


Do you wish to encrypt or decrypt? encrypt What is the key for this encryption? (all lowercase letters, no spaces) elephant Please type your plaintext message, all on one line; when you are finished, hit
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
