kjur / jsrsasign

The 'jsrsasign' (RSA-Sign JavaScript Library) is an opensource free cryptography library supporting RSA/RSAPSS/ECDSA/DSA signing/validation, ASN.1, PKCS#1/5/8 private/public key, X.509 certificate, CRL, OCSP, CMS SignedData, TimeStamp, CAdES and JSON Web Signature/Token in pure JavaScript.
https://kjur.github.io/jsrsasign
Other
3.28k stars 644 forks source link

KJUR.jws.JWS.sign is very slow. #592

Closed xunziheng closed 12 months ago

xunziheng commented 1 year ago

Env:

  1. "jsrsasign": "^10.8.6",
  2. typescript
  3. webpack
  4. react

Issue:

when I use KJUR.jws.JWS.sign() Its very slow for me, about 7000ms, but the answer is all right. I'm not sure if it's my problem, but I really have no more idea to debug.

I had try to change version.

thank you guys for any suggestion

I guess the webpack ts-loader cause that?

xunziheng commented 1 year ago

By the way, I use "RS256" for sign.

kjur commented 12 months ago

Please use Web Crypto API. https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API

trevordixon commented 8 months ago

I came into a project using KJUR.jws.JWS.sign and traced slowness to this function. Maybe mark that function as deprecated so people know there are better implementations now?