Open librehat opened 8 years ago
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.
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
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
Looks like we need to wait for awhile. https://github.com/vibornoff/asmcrypto.js/issues/68
Or we can patch it by ourselves, like I did to forge, maybe it's not a hard work
Neither you, nor I have the time for extra work.
I'm very new to JavaScript...
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