What is the best practice to encode the string with encryption key(like password) in device
side(android and ios).And to decode that encoded string in server side with the encryption
key used in the device side.
What is the best practice to encode the string with encryption key(like password) in device
side(android and ios).And to decode that encoded string in server side with the encryption
key used in the device side.
You could try one of the following
RSA Encryption:
Encrypt using public key in iOs Device and decrypt it using private key in web service
Host the web service with SSL certificates
Set up a Secured VPN and access the service through the VPN.
Since you mentioned about encrypting passwords.salting and hashing the password is most preferred.
Wouldn't it better to use a SSL/TLS related protocol (e.g. ssh, https, etc.)? Those protocols implement negociation mechanism to choose the encryption algorithm for the data transfert.
You might want to read (android) http://developer.android.com/training/articles/security-ssl.html and (iOS) https://developer.apple.com/library/mac/#documentation/security/conceptual/cryptoservices/SecureNetworkCommunicationAPIs/SecureNetworkCommunicationAPIs.html