Techniques to encrypt Text on iPhone to send over network
In an app for a website, there is a method which needs to send user password to server(server is in .NET)
As sending plain text to server ca开发者_开发问答n expose user password over the network. Considering user privacy. We wish to encrypt the password with any encrypt algo before sending over the network.
Algo should conform following points 1. Should not generate any invalid XML character 2. Should give same result @ server side and iPhone side. As we tried simple XOR encryption with int key 129 it gives different result on iPHone compared to server side.
Please let me know if there are any recomendations on that.
You could just use HTTPS to encrypt the network traffic. Then the only code to do is changing the URL. The only trouble is that you'll have to configure the server, however that's a very common thing to do.
Feels like the True method is using asymmetric cyphers with pubkeys and privkeys. Think about password safety in case of somebody extracted the key from iPhone application.
You can use Base64 or hex encoding to store crypto things in XML.
Do not encrypt the password but either send it via SSL-encrypted HTTP or, even better, transmit a hashed version of the password. For the latter, on the server-side, either store a hashed version in your database and not the clear-text at all OR hash the password on login and compare with the remote (mobile) hashed version.
A rather late answer! But, hope someone in the future finds it useful. What I suggest is the following.
- Using SSL and sending the password as plaintext is quite okay
- If you want to go the extra mile, then suggest that you encrypt the password using a shared key and a shared algorithm with the server and send the encrypted password over SSL. This will be very very difficult to hack.
精彩评论