I'm adding encryption functionality to existing program (plain c console app). It takes few files as input parameter and my task is to make this files(sensitive data) secured.
What I do now is that I encrypt the files first (simple XOR with external application), then decipher them back inside the program, the existing program process the files. Then, after everything is successful I encrypt those files back (everything is stored locally on hard disk).
HOWEVER, there is a hole in security, since all the "open" files are stored on hard disk. In case the program fails somewhere in the middle, those files will not be decrypted back.
My problem is that the existing program is taking the 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 develop this in win.