MyScript / iinkTS

Other
52 stars 6 forks source link

Reliance on discontinued `crypto-js` requires node/browser pollyfill #3

Closed adamc-texthelp closed 6 months ago

adamc-texthelp commented 7 months ago

This is more of an inquiry/suggestion on the use of the crypto-js library.

crypto-js is discontinued and versions 4+ of crypto-js rely on using the native node / browser library crypto for some functionality . https://github.com/brix/crypto-js/blob/develop/README.md#400

This means people using this library need to decide on either polyfilling with the node api module or relying on browser support. This is difficult to check as I'm not entirely sure what functions of crypto are required for crypto-js usage so it's hard to gauge browser support.

Could you provide insight on what you recommend for iink-ts usage of crypto-js and If possible would removing the crypto-js dependency be viable in future?

leJsboureau commented 6 months ago

Cyrpto-js is only used to encrypt the "hmac" header in batch or respond to the ack message when the hmac is activated with the key used. You can see how we implemented the library here: crypto.ts You can see where we use it here:

You are right, the library is no longer maintained. This will disappear in the next version in favor of the native Crypto module.

leJsboureau commented 6 months ago

New version (1.0.5) with removal of crypto-js dependency. Thank you for your feedback.