encrypting and/or decrypting large files (AES) on a memory and storage constrained system, with “catastrophe recovery”

前端 未结 3 454
一生所求
一生所求 2021-01-01 03:50

I have a fairly generic question, so please pardon if it is a bit vague.

So, let\'s a assume a file of 1GB, that needs to be encrypted and later decrypted on a given

3条回答
  •  忘掉有多难
    2021-01-01 04:48

    Surely this is doable.

    The "largest" (not large at all however) problem is that when you encrypt say 128 Mb of original data, you need to remove them from the source file. To do this you need to copy the remainder of the file to the beginning and then truncate the file. This would take time. During this step power can be turned off, but you don't care much -- you know the size of data you've encrypted (if you encrypt data by blocks with size multiple to 16 bytes, the size of the encrypted data will be equal to size that was or has to be removed from the decrypted file). Unfortunately it seems to be easier to invent the scheme than to explain it :), but I really see no problem other than extra copy operations which will slowdown the process. And no, there's no generic way to strip the data from the beginning of the file without copying the remainder to the beginning.

提交回复
热议问题