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.)

How to develop a Vigenere Cipher C++ program? Background info: We can

use a combination of letter to number mappings and modulo arithmetic to

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 : abortattackatdawn The encryption for your input is ***emsgaagmenopadnpr*** All done Do you wish to encrypt or decrypt? decrypt What is the key for this decryption? (all lowercase letters, no spaces) elephant Please type your encrypted message, all on one line; when you are finished, hit : emsgaagmenopadnpr The plaintext for your input is ***abortattackatdawn*** All done

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!