Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can a "secret" string in a compiled Obj-C app be discovered?

I need to send data from my iPhone application to my webserver, and back. To do this securely, I'm using an encryption algorithm. It requires a key that must be known by both the server and the user so that decryption can take place. I was thinking about just using a simple static string in my app and on the server as the key, but then I remembered that compiled code can still be disassembled and viewed, but only to a certain extent.

So, how safe would I be by placing the encryption methods and "secret" string in the source code of my app? Are there any other ways to accomplish communication between an app and server securely?

Thanks.

like image 291
pop850 Avatar asked Aug 09 '10 19:08

pop850


3 Answers

Yes, it can be found rather easily. Run the strings program on your executable and you'll probably find it. Besides, anything in your program can be "found", since it's necessarily open for reading.

Use SSL for secure connections. It uses asymmetric encryption, which means the key to encrypt the data is not the same that will be required to decrypt it. That way, even if attackers find out your encryption key, they still can't use it to decode. All major HTTP servers and client libraries support HTTPS, and that's what it does.

like image 72
zneak Avatar answered Sep 29 '22 02:09

zneak


What "certain extent" do you think that is exactly? Every instruction and every piece of data your application contains is open to possible viewing. Besides, using the same key for every device is the ultimate in cryptographic insanity.

Just use HTTPS. SSL/TLS is a secure, proven technology built into every major HTTP server and every major HTTP client library.

like image 41
Nicholas Knight Avatar answered Sep 29 '22 02:09

Nicholas Knight


You use a symmetric algorithm. Maybe you should consider to have an unsymetric method if you need a high security. That way you could even recreate the keys at i.e. every session and only need to exchange the public key.

Here some examples:

  • RSA
  • Diffie-Hellman
  • ElGamal
  • ECDSA
  • XTR
like image 24
schoetbi Avatar answered Sep 29 '22 02:09

schoetbi