Does it make security sense to hash password on client end

后端 未结 10 1475
清酒与你
清酒与你 2020-12-23 12:21

If you were to hash a user\'s password prior to sending it across the line and leaving it in plain-text in memory, would this improve the security of the application?

<
相关标签:
10条回答
  • 2020-12-23 12:44

    Sending a hashed password won't improve security on your site, as others have pointed out (since you accept a hashed password, all the bad guy needs to know is the hashed version). It's also not really secure, since the bad guy can presumably load your login page and examine the Javascript or Java deployed.

    What it does do is prevents somebody watching the packets from being able to pull out a password, and that is moderately useful. Many people use the same password on multiple sites (I do it for all but the higher security sites), and therefore if you can get one password from them you can log into other accounts on other sites.

    It also prevents the real password from being stored, even temporarily, on your site, and that may provide a little extra security if your site is compromised.

    So, while I'd consider user-side hashing to be potentially a good things, it isn't worth going to much extra trouble.

    And, as others have told you, don't roll your own security. There's far too many things that can go wrong. You won't notice them nearly as fast as a practiced bad guy will.

    0 讨论(0)
  • 2020-12-23 12:51

    You'd be much better off if you used the Secure Remote Password protocol (SRP). It was designed for this.

    0 讨论(0)
  • 2020-12-23 12:52

    No.

    When the client sends something, whether it is P or H(P) or H(H(P)) anyone who intercepts this can simply resend the exact same thing, thus making any function like this equivalent to using the password directly.

    That's why you should use a nonce; The server can give out some random garbage k and the client will calculate H(P,k) and send it to the server. HMAC is a popular implementation of this method.

    Provided the server never accepts the same nonce twice, this is secure against a replay attack.

    0 讨论(0)
  • 2020-12-23 12:55

    Just make sure that you are sending your password through a secure channel (SSL). If the client can have an application private memory read, then most likely they have bigger problems, like for example a keylogger.

    0 讨论(0)
提交回复
热议问题