I want to produce a transaction log that is encrypted while being produced. I'd prefer asymmetric encryption. It is possible that my program will terminate without writing any closing blocks, so my output can't depend upon being able to write any end-of-file blocks the encryption scheme may require.
I can open new transaction logs as needed and do not require the ability to append to a previous one.
I believe I can do this by storing the public key on the server (and hiding the private key), choosing the proper algorithm, and using a stream encryption writer in my output.
Later, when viewing the transaction log, I can just do everything in reverse. And in this way, my transaction logs are always stored encrypted at rest.
Is RSA the correct algorithm? If not, what should I use instead?
Coding is in C++. I presume I can do what I need to do with crypto++.