Question: r this extra credit assignment, you need to create a program that reads in a text-file (specified by the user), performs a bit-level Exclusive-OR on

 r this extra credit assignment, you need to create a programthat reads in a text-file (specified by the user), performs a "bit-levelExclusive-OR" on each byte of the text-file (as a method of encryption),

r this extra credit assignment, you need to create a program that reads in a text-file (specified by the user), performs a "bit-level Exclusive-OR" on each byte of the text-file (as a method of encryption), then writes the encrypted file data back out to disk and gives the encrypted file the same name as the input file (i.e. so it overwrites the original file). XOR encryption is a symmetric encryption algorithm, which means, the encrypted file can also be decrypted with the same XOR algorithm (as long as you use the same encryption key, which you will, because the encryption key is hard-coded - a variation of this program would be to ask the user to enter the encryption key) So when testing your program (keep a backup copy of the file to be encrypted), then do the following: (1) Create a text file (make a backup copy) and encrypt it (2) Use cat or vi to view the text file to see that it's encrypted (3) Run the encryption again on the encrypted file, and then see if it's decrypted Below is the description of the (User/Application) interaction: DESCRIPTION 1. Usertypes lextra5 2. Application Asks user to enter name of file to be encrypted 3. UserEnters name of file (this file should be in the same directory as the executable file "extra5") 4. Application Encrypts each byte of the input file and writes encrypted data back to the same file, over writing the original data You will need to refer to pages 603-604(5th edition), or 678-680 (6th edition) of the textbook for information on the bit-level Exclusive-OR operator , which you will need for the encryption process. You can also search the web for "XOR encryption" to see code examples and more information

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!