Question: write a C++ program 2. Data Security Encryption is an effective way to achieve data security. To read an encrypted file, you must have access

write a C++ program write a C++ program 2. Data Security Encryption is an effective way

2. Data Security Encryption is an effective way to achieve data security. To read an encrypted file, you must have access to a secret key or password that enables you to decrypt it. You are expected to implement a simple encryption/decryption program. The program shall read the text from an input text file character by character (use cin.get() function) and produces an encrypted or decrypted version of the file. Your program shall allow the user to enter either 1 for encryption or 2 for decryption. The encryption procedure is to replace each alphabet by another one and each digit by another digit as follows: character Encrypted character Hint A, B, C, ......X, Y, Z T,U,V,..., Q, R, S Compute the shift from 'A' to 'T', 'a' a, b, c, ........2 n, o, p,...,k,1,m to 'n', and 'O' to 's'. Use the % operator to rotate. 0, 1, 2, 5,6,7,...,3,4 . ...... 9 Other characters are not encrypted. The decryption procedure is to reverse the encryption procedure such that you obtain the original text file. Sample run: Enter your option: 1. to Encrypt the file 2. to Decrypt the file Option : 1 The encryption result of the input file is stored in "enrypted_msg.txt". Process returned @ (exe) execution time : 2.634 s Press any key to continue

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!