Sending encrypted data in iPhone [closed]
Want to improve this question? Update the question so it focuses on one problem only by ed开发者_JAVA技巧iting this post.
Closed 4 years ago.
Improve this questionWhat are the best options to encrypt the data in iPhone?
I want to send the encrypted key over the network. Please suggest.
Unless you have a good understanding of cryptography use SSL/HTTPS. It's designed for transferring data securely over the net.
Assuming that you are connecting with a web server over HTTP, then install an SSL certificate on the web server and you will be able to use HTTPS. All you need to do in your code is change the URLs from http://
to https://
.
If you need to add an additional layer of security, then I recommend that you look into the CommonCryptor library and using CCCryptorCreate
/CCCryptorUpdate
/CCCryptorFinal
methods.
unlike Mac OS X, iPhone doesn't have openSSL included. You can compile and add it in if you want, but HTTPS is far, far easier.
If you are using a socket connection, you can use TLS.
If you want to tread the hard way, check this out. You don't have to write a custom algo to encrypt/decrypt data. You may try out the encryption/decryption supported in the iOS.
精彩评论