I need perfect work with output screenshoot
Intro to C – Assignment 5 File Encryption The XOR operator is something we had not yet introduced in class. It works on the bits that
make up the binary representation of a variable, rather than the value of the variable. For example, each
char is 1 byte, or 8 bits. XOR looks at the corresponding bits in each value and creates a new value. If the
two bits in the values were different, the output will have a 1 in that position. If the two were the same,
the output has a 0 in that position.
What makes XOR useful for basic encryption is that the operation is reversible. By using XOR again with
the key and the encrypted data, we get the original as output. While this is very easy to implement, keep
in mind that this is not very secure.
The XOR operator in C is used with the caret symbol, ^. Use it like you would a plus sign, with one
operator on each side of it. It only works on ints and chars.
Your program must: Ask the user for the name of the file to encrypt/decrypt
Ask the user for the name of the file to save the encrypted/decrypted file to
Ask the user for the key to use
Encrypt/Decrypt the file by reading it one character at a time, using XOR on that character
with the next character in the key, and then writing that to the output file
o For example, if the key was “hello”, the first character is XOR’d with ‘h’, the second
with ‘e’, and so on, with the key repeating, so the 6th will also be XOR’d with ‘h’.
o You will need to use the binary file modes
5% of the grade will be removed for each day the assignment is late (up to 30%). If you have extenuating
circumstances and need an extension, please contact me before the due date.
Please submit your main.c file as [YOUR NAME]_assignment5.c , and include the honor code with your
submission.
Example Input and Output
You do not need to match this output exactly, but they’re a guide for what you would want to aim for.