19
Let's say my program has a class called "customer" and the customer class is serializable so I can read and write it to disk. The customer class holds sensitive information that I want to encrypt, the only way I know I could keep the file safe would be to:
1-Serialize the file to disk
2-Reopen and load the file
3-Encrypt the file
4-Rewrite file to disk
This would work, but there is a risk that the file could be intercepted in it's unencrypted state and furthermore this is just really inefficient.
Instead I would like to:
1-Create file in memory
2-Encrypt file in memory
3-Write encrypted file to disk
Is this possible? If it is how? Thanks in advance.