Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

**Please it is necessary to use the functions and the names given. It is also important to use string and getline.** Implement two decryption functions

**Please it is necessary to use the functions and the names given. It is also important to use string and getline.**

Implement two decryption functions corresponding to the above ciphers. When decrypting ciphertext, ensure that the produced decrypted string is equal to the original plaintext:

decryptCaesar(ciphertext, rshift) == plaintext 
decryptVigenere(ciphertext, keyword) == plaintext 

Write a program decryption.cpp that uses the above functions to demonstrate encryption and decryption for both ciphers.

It should first ask the user to input plaintext, then ask for a right shift for the Caesar cipher and report the ciphertext and its subsequent decryption. After that, it should do the same for the Vigenere cipher.

Example:

$ ./decryption Enter plaintext: Hello, World! = Caesar = Enter shift : 10 Ciphertext : Rovvy, Gybvn! Decrypted : Hello, World! = Vigenere = Enter keyword : cake Ciphertext : Jevpq, Wyvnd! Decrypted : Hello, World! 

(When reporting decrypted strings, they should be the result of applying decryption functions to the ciphertext, not the original plaintext variable.)

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

More Books

Students also viewed these Databases questions

Question

Describe the trend in global poverty rates.

Answered: 1 week ago