Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help to design a simple Vigenre Cipher C++ program. For this program, it should both encrypt and decrypt using this cipher using a

I need help to design a simple Vigenre Cipher C++ program.

For this program, it should both encrypt and decrypt using this cipher using a combination of letter to number mappings and modulo arithmetic. For example, we can map the letter 'a' to the number 0, 'b' to 1, . . . , 'z' to 25. 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 (20 represents the letter 'u').

Example of working program for both encrypting and decrypting:

image text in transcribedimage text in transcribed
Do you wish to encrypt er decrypt? encrypt What is the key for this encryption? {all lowercase letters, no spaces] elephant Please type your plaintext message.r all on one line; when you are finishedIr 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

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

Step: 3

blur-text-image

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

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions