IPhone: how to encrypt a string

I would like to encrypt the string from AES 256 on the iPhone, but did not find much with google. What I'm trying to do is post some data to the website as part of the game that I am creating, but I do not want the user to be able to cheat, seeing how it is published, because it is plain text. So I want to publish one encrypted string on my php page (ala www.test.com/test.php?encrypted=, etc.), and then the php script will decrypt it and do what it needs if it is valid .

+4
iphone cocoa-touch
source share
3 answers

It will be much easier to use HTTPS POST, which will give you similar protection with much less code, although there are still problems to solve the problem you are attacking. Such a solution that you describe usually requires some kind of general secrecy, and it is very difficult to protect the code for a long time using a shared secret. You may find these posts helpful:

  • Mac Machine ID
  • Store the encryption key in the keychain during the installation process
  • Cocoa Obfuscation

However, HTTPS is probably much better than AES here.

+4
source share

You can simply use CryptoHelper , which is adopted by CyrptoExercise Project Example

+5
source share
0
source share

All Articles