Does it make security sense to hash password on client end

后端 未结 10 1621
清酒与你
清酒与你 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: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.

提交回复
热议问题