I have written a BlackBerry app that RSA encrypts a message using PKCS1FormatterEngine. This outputs a ciphered message formatted in PKCS #1 v2.1
Here is a snippet of the message:
ç½.¦B¯€ü6Áùε"aYÅÂ7;«&â/Ѥ²•¨S.°.b7<iÔ½Œ.:.Ý&D‹±ì‰8.V•.Ä$‡ZAÜ.p.Ø}åÜ.uK.Æøæ
I already have the RSA private key in .NET but I can’t seem to find a way to decrypt this.
Any ideas on classes I should use etc would be greatly appreciated.
I’m using the RSACryptoServiceProvider .NET class with the function Decrypt.
The first paramater is the encrypted data and the second, a boolean specifies which padding type to use.
True = OAEP padding (PKCS#1 v2.1)
False = PKCS#1 v1.5
It is strange because my code worked when it set it the parameter to false. I’m pretty sure the cipher is in PKCS#1 v2.1 because i’m using this class from the BlackBerry SDK.
Quote from the API document:
In any case, it works for me now. Hope this helps somebody else. 🙂