I am very new to authentication/ssl especially combined with ios. My question is, if I am sending a username and password to lets say https://server.com/login.php do I need to hash my passwords in the iOS client or can I post the text of password then hash them before they are stored in the DB?
- 1Hashing doesn't help you much if your server accepts password hashes instead of the password. You prevent the password from being revealed, but the password hash can still be used to authenticate with your service.Michael Mior– Michael Mior2012-08-13 20:39:10 +00:00Commented Aug 13, 2012 at 20:39
2 Answers
Sending an hash or the cleartext password is essentially the same issue.
If an attacker can capture data from the connection between client and server, he can later authenticates himself impersonating the client by sending either the hash or the cleartext password to the server.
The key point is to use HTTPS, wich encrypt communication between client and server, so that an attacker can not intercept the data (hash or password) the client are sending to the service.
That said, hashing the password is good practice for the client so that no one will know the real user password (even if the client stores the hash in memory for usability, you should never store cleartext passwords anywhere).