c++ - Encrypting a "stream" with AES -


i continuously produce string need write local file (encrypted).

as i'm having aes library in application, prefer use aes - if possible.

approach 1: aes has block size of 16 bytes, need buffer 16 bytes of data in memory might lose if computer crashes.

approach 2: writing data file first , periodically encrypt whole file aes-cbc. way, user access unencrypted file short period of time.

is there other way?

since can't write 15 bytes disk anyway, pad out data multiple of 4kb (minus whatever header need) , encrypt padded data.


Comments

Popular posts from this blog

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -