Org.BouncyCastle.Crypto.DataLengthException: attempt to process message to long for cipher #591
-
I try to encrypt a url data, and decrypt it on another web page, like the CryptographiesTexter do Can someone tell me the code where need to change to fix It |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
I guess you get the exception because you try to decrypt a message that is too large for the RSA key you are using, but I don't know if it's a design issue or an implementation bug. You should create small example showing the input and the decryption key you are trying to use. |
Beta Was this translation helpful? Give feedback.
-
The problem is in CryptographyHelper:
The encryptData that is passed to this method is in Base64 encoding, so it should be decoded from Base64 instead of UTF8:
|
Beta Was this translation helpful? Give feedback.
The problem is in CryptographyHelper:
The encryptData that is passed to this method is in Base64 encoding, so it should be decoded from Base64 instead of UTF8: