0

I am looking for a way to encrypt a string in iOS, send it to a PHP server and decrypt it there.
server would send a normal message back to iOS, no need to encrypt.
Any idea how to accomplish that ?

EDIT: The encryption should have a similar key hardcoded on both ends.

Thanks!

Ted
  • 3,805
  • 14
  • 56
  • 98
  • I have no ios experience, but I found something here: http://stackoverflow.com/questions/6461419/aescrypt-decryption-between-ios-and-php-fixed – dAm2K Jul 13 '12 at 09:45
  • Google OpenSSL, i'm sure you'll find implementations for iOS and PHP – Ugo Méda Jul 13 '12 at 09:48

1 Answers1

0

How about base64 encoding and decoding?

http://php.net/manual/en/function.base64-encode.php

and for iOS: How to Base64 encoding on the iPhone

Community
  • 1
  • 1
PoeHaH
  • 1,936
  • 3
  • 28
  • 52
  • I don't think base64 has a key related to the message? – Ted Jul 13 '12 at 10:38
  • I wrote this before your EDIT :) sorry – PoeHaH Jul 13 '12 at 10:49
  • My apologies, your comment caused my edit. Sorry I guess I forgot to point that out. – Ted Jul 13 '12 at 10:50
  • but, you can do it with a key, but then we're adapting it: http://tech.chitgoks.com/2008/03/24/php-encrypt-decrypt-using-base64/ . as you can see, these 2 functions use a predefined key to do some more encrypting and decrypting – PoeHaH Jul 13 '12 at 10:50