views:

40

answers:

1

As the title says. Using the iPhone SDK, I want to RSA encrypt some (small) plaintext using an existing key and exponent I am given from a server for authentication. Surely this is a trivial task that requires one library import and a couple of lines of code? If not, why not?

+1  A: 

Unfortunately the only way to work with RSA keys on the iPhone is by importing them in the KeyChain. If you don't mind to use a third-party library then you can go around this. For example by using libcrypto from OpenSSL.

St3fan
I don't mind importing the key but there doesn't seem to be much in the way of example code, or a wrapper that would import and encrypt for you.
Jimmy