I need to decrypt a AES encrypted file while downloading it.
That means, every time I receive 256 bytes of data, I could decrypt it right away.
The problem is, users may pause the download process, and restore it later. Then, a new CCCryptorRef instance need to be created to continue to decrypt. But the decrypted data is wrong.
Is there any way to perfectly save a CCCryptorRef instance, so I can use it later?
Btw, I am using iOS framework apis.
I am using CCCryptorCreateWithMode()
, CCCryptorUpdate()
,CCCryptorFinal()
for normal AES processes.