Skip to content
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

Streaming mode support #3

Open
syakunin opened this issue Oct 1, 2021 · 0 comments
Open

Streaming mode support #3

syakunin opened this issue Oct 1, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@syakunin
Copy link
Collaborator

syakunin commented Oct 1, 2021

Library should support streaming mode for encrypting large files on-the-fly. Several issues with streaming:

  1. We will not be able to use deterministic CID in streaming mode, because deterministic CID requires to calculate data hash to create encryption key. This means we will need to read the stream twice. First pass is for calculating hash and creating encryption key, second pass is for encryption with calculated key.
  2. Currently WebCrypto supports only in-memory mode hashing/encryption. However NodeJS allows to hash/encrypt data in streaming mode. We might restrict streaming mode only to NodeJS users or we need to find alternative hashing/encryption libraries for streaming in browser (they will not be so fast as native ones). One of the good candidates is hash-wasm library, which can perform stream hashing in browser and in NodeJS.
@syakunin syakunin added the enhancement New feature or request label Dec 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant