Randomly thrown "Invalid RSAES-OAEP padding." error with a valid key
We are using the forge package for password based authentication, which randomly throws the "Invalid RSAES-OAEP padding." error with an actually VALID password. What could be the potential cause for this?
Found a similar issue that is still not resolved (despite it being encryption related) - https://github.com/digitalbazaar/forge/issues/621
cc: @subnetmarco
I'm facing exact same problem. It is occuring if I have any character which is not an alphabet in source text. That is what I figured until now.
Problem solved.
Had to call forge.util.encodeUtf8 before pass it to encrypt function.
Like below
pk.encrypt(forge.util.encodeUtf8(text), 'RSA-OAEP');