digitalbazaar / forge

A native implementation of TLS in Javascript and tools to write crypto-based and network-heavy webapps
https://digitalbazaar.com/
Other
5.01k stars 767 forks source link

Invalid RSAES-OAEP padding WHY #1075

Closed briancorbin closed 3 months ago

briancorbin commented 3 months ago

Could someone help me understand what is causing this error?

https://github.com/digitalbazaar/forge/blob/2bb97afb5058285ef09bcf1d04d6bd6b87cffd58/lib/pkcs1.js#L255

My situation is:

I generate the keypair on one platform, and try to decrypt on another (react-native), and it throws this error for ~30% of the generated keys. Some work, some don't, and I can't figure out why 😭