I'm adding encryption functionality to existing program (plain c console app).
It takes few files as input parameter.My task is to make this files(sensitive data) secure.
What I do now is that I encrypt the files first (simple XOR with external application), then decipher them back inside program, existing program process the files, then after everything is successful encrypt those files back (everything is stored locally on hard disk) HOWEVER here is a hole in security, since all the "open" files are stored on hard disk, in case program fails somewhere in the middle, those file will not be decrypted back.
My problem is that existing program is taking FILE variable as input
and works directly with those files, it's not my program so I don't have rights to modify it.
What I would need is to write files into memory instead of hard disk.
I know that there are some libraries in linux that enable this but I develope this in win.