2

i have client-server application (objective-c and php).
how can i encrypt data on client and then decrypt on server?
the simpler the better

2
  • A much better deal than 40 days of Lent. Commented Apr 18, 2011 at 19:12
  • @Charlie, idk. matzoh makes you a bit plugged up Commented Apr 18, 2011 at 19:20

3 Answers 3

1

The simplest way to encrypt data traveling over the network is going to be to simply always use TLS to connect to your server running your PHP app. You could verify a particular certificate from within your app if you're afraid of sophisticated man in the middle attacks, though that will make your app fail to work without an update when your certificate changes.

If you truly need encryption/decryption at the application level, not just transport, then you should probably use RSA public-key encryption. Your client will have the public key, your server will have the private key. Apple has documentation on RSA encryption.

Sign up to request clarification or add additional context in comments.

Comments

1

Okay, rule number 1: DO NOT write your own cryptographic routines.

Given that, there are some standard cryptographic libraries available. OpenSSL is recommended in this SO article.

Comments

0

Use SSL/TLS protocol, OpenSLL have the implementation of both, check this tutorial, its in c but may be a good start to you.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.