Question: 7. File Encryption Using XOR Enhance the file encryption program from Section 6.3.4 as follows: Prompt the user for the name of a plaintext
7. File Encryption Using XOR Enhance the file encryption program from Section 6.3.4 as follows:
• Prompt the user for the name of a plaintext file and a ciphertext file.
• Open the plaintext file for input, and open the cipher text file for output.
• Let the user enter a single integer encryption code (1 to 255).
• Read the plaintext file into a buffer, and exclusive-OR each byte with the encryption code.
• Write the buffer to the ciphertext file.
The only procedure you may call from the book’s link library is ReadInt. All other input/output must be performed using INT 21h. The same code you write could also be used to decrypt the ciphertext file, producing the original plaintext file.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
