Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

C 

Open File, Encrypt and then save to a new file

Hi guys, how would I open a file, encrypt it with XOR and then save it?
https://gyazo.com/ff5ef33688256f51826d909cdb932b2e
I've managed to get it working with user input but the file is only saving what the user is typing in.

I want the user to only be able to select what encryption type they want as I plan to add 2 more.
I wouldn't recommend using XOR to "encrypt" data.
Code
fin = fopen("filename","rb");
fread(buffer,sizeof(char),sizeof(buffer),fin);
fclose(fin);
setXORMessage(buffer,key);
fout = fopen("enc","wb");
fwrite(buffer,sizeof(buffer),sizeof(char),fout);
fclose(fout);
(Feb 27, 2019 08:53 AM)morph Wrote:  I wouldn't recommend using XOR to "encrypt" data.
It is for an assignment :)


Possibly Related Threads...
Thread / Author Replies Views Last Post
[C#] by Iera NamhorunApr 13, 2019 07:21 PM 5 258 Apr 13, 2019 07:21 PM
Last Post: Iera Namhorun
[C#] by FarosMolokoFeb 24, 2019 07:05 AM 8 320 Feb 24, 2019 07:05 AM
Last Post: gigajew
[Python] by iboyhacker_1997Jan 11, 2018 12:08 PM 7 280 Jan 11, 2018 12:08 PM
Last Post: Itsumi