Write a C++ program for encrypting and decrypting files. Since this program performs two different functionalities (encryption and decryption), prompt the user to select the type of cryptographic technique as shown below:   Welcome to the Cryptographic Techniques Program Please enter your selection: 1. Encrypt 2. Decrypt   When the user selects 1 or 2, s/he will be asked to specify the input and output files.   This program will be tested using a .txt file.   If the user selects to encrypt the file (i.e. option 1), then the program will encrypt the original text and outputs the encrypted text to a new file.   If the user selects to decrypt the file (i.e. option 2), then the program will decrypt the encrypted text and outputs the decrypted text to a new file.   The program should give the user the option whether to continue with encrypting/decrypting files (i.e. entering letter �C�) or exit the program (i.e. entering the letter �E�).   This program MUST be written using functions and arrays.   The program MUST and can ONLY contain the following function definitions and layout:   /************************************************************** * This function displays the menu options as in the handout * **************************************************************/ void displayMenu() { /* function body */ } /************************************************************** * This function encrypts the content of infile and saves the * * encrypted text into outfile * * @param infile string (file that has raw text) * * @param outfile string (file that will have encrypted text) * **************************************************************/ void encrypt(string infile, string outfile) { /* function body */ } /************************************************************** * This function decrypts the content of infile and saves the * * decrypted text into outfile * * @param infile string (file that has encrypted text) * * @param outfile string (file that will have decrypted text) * **************************************************************/ void decrypt(string infile, string outfile) { /* function body */ } /************************************************************** * This function takes an character and a cipher key to return * * an encrypted character. * * @param c is a char (the character to be encrypted) * * @param key is an integer (cipher key given in the handout) * **************************************************************/ char ceaserCipher(char c, int key) { /* function body */ } /************************************************************** * This function takes an encrypted character and a cipher key * * to return a decrypted character. * * @param c is a char (the character to be decrypted) * * @param key is an integer (cipher key given in the handout) * **************************************************************/ char ceaserDecipher(char c, int key) { /* function body */ } /************************************************************** * This is the main function of the program. * * @return a value to terminate the program successfully * **************************************************************/ int main() { displayMenu(); // 1. Get user input (e.g. encrypt/decrypt and filenames) // 2. Call the appropriate function(s) to process encryption/decryption // 3. Then, get user input to continue or exit the program return 0; }   **Please write clean code. Any code that does not meet the asking requirements will be rated 0 stars.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Write a C++ program for encrypting and decrypting files. Since this program performs two different functionalities (encryption and decryption), prompt the user to select the type of cryptographic technique as shown below:

 

Welcome to the Cryptographic Techniques Program
Please enter your selection:
1. Encrypt
2. Decrypt

 

When the user selects 1 or 2, s/he will be asked to specify the input and output files.

 

This program will be tested using a .txt file.

 

If the user selects to encrypt the file (i.e. option 1), then the program will encrypt the original text and outputs the encrypted text to a new file.

 

If the user selects to decrypt the file (i.e. option 2), then the program will decrypt the encrypted text and outputs the decrypted text to a new file.

 

The program should give the user the option whether to continue with encrypting/decrypting files (i.e. entering letter �C�) or exit the program (i.e. entering the letter �E�).

 

This program MUST be written using functions and arrays.

 

The program MUST and can ONLY contain the following function definitions and layout:

 

/**************************************************************
* This function displays the menu options as in the handout *
**************************************************************/
void displayMenu()
{ /* function body */ }


/**************************************************************
* This function encrypts the content of infile and saves the *
* encrypted text into outfile *
* @param infile string (file that has raw text) *
* @param outfile string (file that will have encrypted text) *
**************************************************************/
void encrypt(string infile, string outfile)
{ /* function body */ }


/**************************************************************
* This function decrypts the content of infile and saves the *
* decrypted text into outfile *
* @param infile string (file that has encrypted text) *
* @param outfile string (file that will have decrypted text) *
**************************************************************/
void decrypt(string infile, string outfile)
{ /* function body */ }


/**************************************************************
* This function takes an character and a cipher key to return *
* an encrypted character. *
* @param c is a char (the character to be encrypted) *
* @param key is an integer (cipher key given in the handout) *
**************************************************************/
char ceaserCipher(char c, int key)
{ /* function body */ }


/**************************************************************
* This function takes an encrypted character and a cipher key *
* to return a decrypted character. *
* @param c is a char (the character to be decrypted) *
* @param key is an integer (cipher key given in the handout) *
**************************************************************/
char ceaserDecipher(char c, int key)
{ /* function body */ }


/**************************************************************
* This is the main function of the program. *
* @return a value to terminate the program successfully *
**************************************************************/
int main()
{
displayMenu();
// 1. Get user input (e.g. encrypt/decrypt and filenames)
// 2. Call the appropriate function(s) to process encryption/decryption
// 3. Then, get user input to continue or exit the program
return 0;
}

 

**Please write clean code. Any code that does not meet the asking requirements will be rated 0 stars.

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 7 images

Blurred answer
Knowledge Booster
Stack operations
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education