Open Gu7z opened 2 years ago
Anyone? :eyes:
Without looking into it, I assume the performance difference is because the forge version is all in JavaScript and the webcrypto version is native. Forge will try to use native APIs in Node.js. But that code pre-dates webcrypto and it's never gained support for trying to use a webcrypto version if available.
I'm pretty sure in browsers the pure js forge version is going to be slow. 5x+ is unfortunate, but it is what it is. I'm sure the js code could be modernized and optimized. But since webcrypto support is so common, it's probably a better choice to just use that for most use cases.
If there's a desire to use the forge API across platforms but have it use webcrypto APIs if available, someone could likely write a patch to do that.
I had node-forge in my application for a long time but when the amount of information increased, the time to decrypt it increase too
I was searching alternatives for the node-forge library and found Web Crypto
The following code generated the same keys but with a huge time difference
The difference from my console
am I implementing correctly node-forge or have I missed something?