09-26-2008 07:01 AM
i need to send RSA encrypted data from computer to BB (and later also back).
The data encryption is done calling OpenSSL function
RSA_public_encrypt(512, from, to, rsa_key, RSA_NO_PADDING);
Now, i would like to get original (decrypted) data on BB.
I use the decrypt function from BB knowledge centre: How to - Use Advanced Encryption
I'm getting Exception : net.rim.device.api.crypto.CryptoIOException ( net.rim.device.api.crypto.DecodeException )
Does anybody have some experience with this type of problem?
A tried to encrypt the expected data using RSA on BB and i got another content then that one, i'm trying to decrypt, so somewhere is a problem. Maybe, the key pair could be wrong. I moved the key from OpenSSL into BB my-way, i have decomposed the mail from OpenSSL manually and recreated BB RSA Keys from this data.Maybe, this is wrong. But using this keys to encrypt-decrypt some data was ok, ie. i've used them to encrypt message and then decrypt and everything was fine.
So, to put together my questions:
- Does anybody know about some documents about compatibility between OpenSSL and BB?
- or Is there a simple way to get RSA keys from OpenSSL into BB?
- how to send encrypted data (RSA using OpenSSL) to BB?
I appologise for so many questions, but i have not found any articles about this problem. I appreciate any information.
09-26-2008 02:29 PM
Before I send you down this path to help you better understand how to leverage the Crypto API on BlackBerry I think there is an important point that you need to understand before proceeding further. RIM has licensed its public key cryptography on the device from Certicom which requires 3rd party developers to obtain a license for the use of RSA on the BlackBerry. You can find out more information on how to license this capability on this website (http://www.certicom.com/rim).
If you decide to move forward using this mechanism, then you can check out the labs on using the Crypto API here: