Double hashing passwords - client & server

Posted by J. Stoever on Stack Overflow See other posts from Stack Overflow or by J. Stoever
Published on 2010-06-10T20:20:26Z Indexed on 2010/06/10 20:22 UTC
Read the original article Hit count: 244

Filed under:
|
|
|
|

Hey, first, let me say, I'm not asking about things like md5(md5(..., there are already topics about it.

My question is this:

We allow our clients to store their passwords locally. Naturally, we don't want them stored in plan text, so we hmac them locally, before storing and/or sending. Now, this is fine, but if this is all we did, then the server would have the stored hmac, and since the client only needs to send the hmac, not the plain text password, an attacker could use the stored hashes from the server to access anyone's account (in the catastrophic scenario where someone would get such an access to the database, of course).

So, our idea was to encode the password on the client once via hmac, send it to the server, and there encode it a second time via hmac and match it against the stored, two times hmac'ed password. This would ensure that:

  • The client can store the password locally without having to store it as plain text
  • The client can send the password without having to worry (too much) about other network parties
  • The server can store the password without having to worry about someone stealing it from the server and using it to log in.

Naturally, all the other things (strong passwords, double salt, etc) apply as well, but aren't really relevant to the question.

The actual question is: does this sound like a solid security design ? Did we overlook any flaws with doing things this way ? Is there maybe a security pattern for something like this ?

© Stack Overflow or respective owner

Related posts about security

Related posts about passwords