Reputation: 857
So, I started looking into the WebCrypto API as it seems very fast, the api seems fairly simple to use and I managed to implement encryption/decryption quite easily.
Now I'm trying to see if it's possible to do progressive encryption/decryption using it. I currently use CryptoJs and there are many situations where I deal with chunked download and upload of files, meaning that files are broken into smaller pieces and the processing of those pieces are done separately.
On CryptoJs it's possible to keep an instance of the "Encryptor
" open so you can keep passing the chunks to it as you get them from the source and you can call a finalize()
function when you're done.
I've been searching on Google and StackOverflow for hours for a way to achieve the same thing using WebCrypto but I can't find an answer.
Does anyone know how to do it or if it's even possible to be done using the current apis?
Upvotes: 3
Views: 908
Reputation: 1856
Unfortunately WebCrypto API was not defined with streams support, there are a few reasons but I suspect the main two are that not all algorithms support this and it is the sort of thing that can be added later.
Here is the bug tracking streams support - https://github.com/w3c/webcrypto/issues/73
Upvotes: 2