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
Post a Comment