Question
c++ Consider the following two functions whose prototypes are given below. The first function encrypts the character given as an input parameter using an algorithm,
c++ Consider the following two functions whose prototypes are given below. The first function encrypts the character given as an input parameter using an algorithm, not specified here. The second function performs the reverse.
// returns the encrypted version of character c char encrypt(char c);
// return the decrypted version of character ec char decrypt(char ec);
[7.5 points] Write a function that can be used to encrypt a text of arbitrary length.
// returns string s representing the encryption of text string encrypt(string text);
[7.5 points] Write a function that can decipher a text using the encryption function.
// returns string s representing the decryption of etext
string decrypt(string etext);
[5 points] Illustrate the use of encryption by writing a main program which encrypts a text The fox jumps the fence over and over!; prints the encrypted text, and then applies decryption on the encrypted text and prints the result.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started