-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use web crypto instead? #1
Comments
First of all thanks for looking into the code @jimmywarting! I appreciate any tips and advice. The reason why I decided to go with forge was the requirement to process data in chunks in order to achieve constant memory operation. The Web Crypto API as I looked at the SubtleCrypto Implementation does not provide support for encrypting a file in chunks. It operates on the whole blob of data. This is unfortunately not what I need. And it is sad because I'm pretty sure it will provide the best performance out there. My requirement is to have I played around with The way I understand it is that I can't get away from not using |
I see, well, have a look at this two:
|
👍 was given to the webcrypto project The SO suggestion is rather complex for Authenticated Encryption AEAD cipher such as AES-GCM. What he suggests is to chunk the data as 1MiB encrypted blobs with their own authenticated tag but then at the end run another encryption of all the authenticated tags as additional authenticated data in order to prevent reordering attack. I'm not sure if all this work is necessary if the forge library already handles the case. 9MB/s is not too bad of performance while we wait for proper native implementation. |
Why involve node stuff in the browser? (aka: node-forge)
can't you achieve the same thing using web crypto
I bet it have better performance (cuz it's native).
I also think you should be using readAsArrayBuffer and not readAsBinaryString.
technically you could then just do
blob.arrayBuffer()
if you like promises... ornew Response(blob).arrayBuffer()
and screw the hole filereaderThe text was updated successfully, but these errors were encountered: