Hello experts, I'm new and I have written a program for a class that encrypts a text file using XOR. I have not been able to make it work just right yet. I'm not looking for an answer to my assignment just some direction. Is it possible to create an array that would look at the size of the file? My code is taking the key and trying to XOR it with the entire array that I have alotted. so I end up with the key repeating after it has XORed the text to the eof. Here is a snippet of my code (I don't want to paste the whole thing):
The above piece is my declarations and my array sizes. I am trying to read the file into the "filebuff" array then XOR the characters into the "encbuff" array. I am doing that by:
I think my problem is in my for loop. I think by using i<sizeof(filebuff), it is causing the repeating key? Any suggestions that may help would be appreciated!