I’m currently building a web application that needs to encrypt large files (10GB+) using AES encryption. Given the size of these files, they cannot be loaded entirely into memory. I want to process them as streams to handle encryption.
I’ve encountered a few challenges:
-
WebCrypto currently doesn’t support stream processing for security reasons.
-
Based on the advice from this post, it’s recommended to avoid JavaScript and WebAssembly crypto implementations due to potential security vulnerabilities, particularly side-channel attacks. Additionally, these implementations are unable to take advantage of AES hardware acceleration, which makes them significantly slower compared to native implementations.
Given these constraints, I need a way to securely encrypt large files in chunks in the browser. What would be the best approach to achieve this?