PeculiarVentures / webcrypto-liner

webcrypto-liner is a polyfill that let's down-level User Agents (like IE/Edge) use libraries that depend on WebCrypto. (Keywords: Javascript, WebCrypto, Shim, Polyfill)
MIT License
148 stars 26 forks source link

PBKDF2 on Internet Explorer resorts to native subtle and fails #81

Open wh1t3cAt1k opened 3 years ago

wh1t3cAt1k commented 3 years ago

The reason is that (to the best of my knowledge) PBKDF2 is not supported on IE11.

The failure is NotSupportedError returned by native IE11 subtle upon importKey() call with PBKDF2. Here are the args:

image

I know this library does not officially support IE11, however I have nowhere else to go 😂 until Microsoft deprecates its IE-based webview for Office.js add-ins.

As far as I can see, the liner already supports PBKDF2 fallback, can any tweaks be made at the wrapNative level to enable this scenario?..

rmhrisk commented 3 years ago

Should be an easy fix if so. PR welcome. We will try to get to it in the meantime.

wh1t3cAt1k commented 3 years ago

(just to clarify, deriveKey() is not supported either: that method (also with PBKDF2) is also used by @webcrypto/storage library that I'm using.

However I am not certain whether that error is because PBKDF2 algorithm is not implemented, or deriveKey() in general is hard-cut-off on IE11 - at any rate, probably makes sense to specifically test the case with deriveKey as well...)