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

Use WebCrypto API for HMAC-SHA1 #15

Open
librehat opened this issue Dec 5, 2015 · 6 comments
Open

Use WebCrypto API for HMAC-SHA1 #15

librehat opened this issue Dec 5, 2015 · 6 comments

Comments

@librehat
Copy link
Contributor

librehat commented Dec 5, 2015

Much faster than JS library and supported well by Chrome.

However, AES-CFB is removed from W3C draft and not supported by Chrome :(

https://www.chromium.org/blink/webcrypto

https://dvcs.w3.org/hg/webcrypto-api/raw-file/tip/spec/Overview.html

@nekolab
Copy link
Collaborator

nekolab commented Dec 5, 2015

This one is also in my plan :)

But first we need to unify the data representation, now we use string as forge's buffer and ArrayBuffer as Chrome API's buffer, they are different and the convert between them is expensive.

Maybe use ArrayBuffer at all time is a good choice, because it's native and WebCrypto API also use this. But we need something like StringView to interpret ArrayBuffer as String, this maybe a big change.

@librehat
Copy link
Contributor Author

librehat commented Dec 5, 2015

ArrayBuffer should be more efficient. We can replace forge with asmcrypto which claims to be the fastest JS crypto and it accepts both Uint8Array and ArrayBuffer

@nekolab
Copy link
Collaborator

nekolab commented Dec 6, 2015

Sounds good~
We may run some tests to confirm this,and we must confirm asmcrypto supports partial block encryption,many js crypto implementation didnt support it

@librehat
Copy link
Contributor Author

librehat commented Dec 6, 2015

Looks like we need to wait for awhile. asmcrypto/asmcrypto.js#68

@nekolab
Copy link
Collaborator

nekolab commented Dec 6, 2015

Or we can patch it by ourselves, like I did to forge, maybe it's not a hard work

@librehat
Copy link
Contributor Author

librehat commented Dec 6, 2015

Neither you, nor I have the time for extra work.

I'm very new to JavaScript...

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

No branches or pull requests

2 participants