Hey guys,
Got a quick question.
I am planning on writing a very very simple encryt/decrypt program just for the sake of it.
Now I understand that the simplest way is just to XOR the file with a key
EnC = file ^ key
DeC = Enc ^ key
Thats the baisc idea.
But how do I actually implement it??
So I read in a line from the file, using say fgets()?
Example Pesudo Code:
open file;
get key from user;
while(not end of file) {
msg = fgets(from file);
msg = msg ^ key;
fputs(to file, msg);
}
close file
So is that how I can do it?
Thanks!