File in memory

Hi experts,

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.

Thanks a lot

Last edited on
it's not my program so I don't have rights to modify it.
You cannot solve this security problem in a robust way without modifying the program to use the encrypted data directly.
Last edited on
Topic archived. No new replies allowed.