0

I can easily use the terminal to encrypt a string via openSSL commands, using a CER file and a TXT file to start from. I have to do it the same in the iPhone SDK.

Around there are excellent tutorials on how to compile openSSL for iPhone SDK. But then I'm missing the next step.

How to have in a iPhone .m the following command, for example?

openssl rsautl -encrypt -in TEXT.txt -out ENCRYPTED.enc -inkey CERTIFICATE.cer -certin -pkcs

I'm sorry if this question may sound stupid, but I really don't know how to start... Is there a tutorial or a sample around?

Thanks a lot!

Fabio
  • 31
  • 1
  • 3

1 Answers1

0

OpenSSL isn't pre-built for iOS. Perhaps use Jens Alfke's MYCrypto framework, instead. This adds wrappers around Apple's Keychain and CommonCrypto components. You can use this, for example, to help you set up certificates and to perform public and private key-based encryption.

Alex Reynolds
  • 95,983
  • 54
  • 240
  • 345
  • Thanks... but it seems that it does not work on the iPhone yet, developer says... Actually I tried the security.framework, I think I am almost there, but can't get it work... For those wishing to see my code, please go to http://stackoverflow.com/questions/5019185/iphone-encryption-with-certificate Unfortunately for some reasons it doesn't work... – Fabio Feb 17 '11 at 10:44