Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ Hints for #4: When modifying the code, you need to understand what the existing program does. There should be two text files: input file

C++

image text in transcribed

image text in transcribed

Hints for #4: When modifying the code, you need to understand what the existing program does. There should be two text files: input file and output file. The input file contains a string to be encrypted and the output file should contains the new string/encrypted string. For instance, if the original string in the input file is "abc" and if the key value is 1 and if you add 1 to each character of the string, the encrypted string would be "bed" and it is written to the output file one by one character. The problem also asks you to decrypt it, so come up with a function that will decrypt it. The function uses the key value to subtract from the encrypted string. You should have an additional text file(output2) to store the decrypted string. 4. Flexible Encryption Write a modification of the encryption program of Section 15.5 whose transform function uses an integer key to transform the character passed to it. The function transforms the character by adding the key to it. The key should be represented as a member of the Encryption class, and the class should be modified so that it has a member function that sets the encryption key. When the program runs, the main function should ask the user for the input file, the output file, and an encryption key. Show that with these modifications, the same program can be used for both encryption and decryption

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

Students also viewed these Databases questions