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

Evaluate usage of the WebCrypto API in order to speed up the computation #9

Open
evilaliv3 opened this issue Sep 6, 2016 · 5 comments

Comments

@evilaliv3
Copy link

It would be interesting to evaluate usage of the WebCrypto API in order to speed up the computation.

Here is the possible cross compatible way of using the SHA implemented using web workers: https://github.com/globaleaks/GlobaLeaks/blob/master/client/app/js/crypto/main.js#L48

the example takes into account the difference of API implemented by the great and inimitable Internet Explorer.

This would make the library more secure, modern and efficient.

@ricmoo
Copy link
Owner

ricmoo commented May 19, 2020

Sorry, that page seems dead now. It took me far too long to get to catching up on issues with this repo.

I am trying to avoid external dependencies in this library though. I am considering forking it into my ethers library though, since it would be nice to consolidate the various SHA2 implementations that end up getting swept along, and that way it can easily use the best SHA2 and PBKDF2 implementations available.

@ricmoo
Copy link
Owner

ricmoo commented May 19, 2020

Wow... Just noticed this was opened 2016. I'm way behind schedule.

@webmaster128
Copy link

As far as I can see at https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto#Using_SubtleCrypto (scroll down a little to the table), there is no scrypt support in the WebCrypto API.

@webmaster128
Copy link

I tried replacing PBKDF2_HMAC_SHA256_OneIter with a WebCrypto implementation in #26. It seems to work in Chrome but does not help performance.

@ryancdotorg
Copy link

The PBKDF2/SHA2 functions are only called a small number of times at the start and end of the scrypt algorithm, and likely aren't worth optimizing (for speed, anyway). The PBKDF2 implementation in my fork is a lot faster for large outputs, but it doesn't matter for typical scrypt parameters.

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