Skip to content

Streaming decryption consumes too much memory in browser (React) #1614

Answered by twiss
sumitsahoo asked this question in Q&A
Discussion options

You must be logged in to vote

Hey 👋 There's multiple issues here:

  1. OpenPGP.js buffers the file by default to check the authentication tag. See the allowUnauthenticatedStream config option.
  2. You're then buffering the chunks yourself into an array, to create the Blob. To reduce the memory usage, you need to write them directly to disk, using StreamSaver.js or the File System API.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@sumitsahoo
Comment options

Answer selected by sumitsahoo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1613 on March 17, 2023 10:49.