views:

101

answers:

3

I have to encrypt the username and password for a native Apple application. But the server side is in Java, so the same encrypted fields have to be decrypted using Java.

I am new to cryptography, and I don't know how to go about it. One option that has come to my mind is to take any algorithm in Java, understand the source code for encryption, apply the same logic to convert the source in Objective C, and decrypt the encrypted text using the already provided decryption algorithm. But a minor mistake would ruin my application.

Is there any other way? Is an algorithm whose encryption is in Objective C and decryption is in Java or something like that?

+3  A: 

You can use ssl to encrypt the traffic at the socket level. Or you could use a public key algorithm as described in this SO post: http://stackoverflow.com/questions/788569/rsa-encryption-decryption-in-iphone

Joshua Smith
+3  A: 

The most common encryption algorithms such as (AES) will have implementations in objective-c and Java. Pick the algorithm you want to use and Google for an implementation.

mikerobi
A: 

Perhaps the answer is communicate with your server should be running over SSL. Then all the traffic between your client and the server is encrypted.

locka