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

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!