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

Port Node crypto to WebCrypto #44

Open
eligrey opened this issue Jul 16, 2019 · 6 comments
Open

Port Node crypto to WebCrypto #44

eligrey opened this issue Jul 16, 2019 · 6 comments
Labels

Comments

@eligrey
Copy link
Member

eligrey commented Jul 16, 2019

In order to reduce the worker script bundle size, we should look into porting our Node crypto usage to WebCrypto. This is a low priority task.

@bencmbrook
Copy link
Member

bencmbrook commented Jul 16, 2019

This might be useful when we do
https://github.com/mozilla/send/blob/master/app/fileReceiver.js#L115
https://github.com/mozilla/send/blob/master/app/serviceWorker.js#L117

GitHub
Simple, private file sharing from the makers of Firefox - mozilla/send

@bencmbrook
Copy link
Member

bencmbrook commented Aug 21, 2019

I imagine there’s a ton of unused code in this dependency. We should first try tree shaking. It’s definitely not on since webpack is in development mode https://webpack.js.org/guides/tree-shaking/

@bencmbrook
Copy link
Member

w3c/webcrypto#73

@bencmbrook
Copy link
Member

I think this will be difficult because authentication checks are done under the hood for each call to crypto.subtle.decrypt, meaning we can't perform decryption on chunks (AFAIK).

https://github.com/jedisct1/libsodium.js has a web assembly that might have a similar perf gain.

@bencmbrook
Copy link
Member

Investigate whether https://www.npmjs.com/package/libsodium-wrappers can handle whatwg streams

@bencmbrook
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants