String Encryption in Objective C
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开发者_StackOverflow中文版 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?
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.
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: RSA Encryption-Decryption in iphone
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.
精彩评论