Is “double hashing” a password less secure than just hashing it once?

后端 未结 16 1796
梦谈多话
梦谈多话 2020-11-22 08:09

Is hashing a password twice before storage any more or less secure than just hashing it once?

What I\'m talking about is doing this:

$hashed_password         


        
16条回答
  •  灰色年华
    2020-11-22 08:51

    Personally I wouldn't bother with multiple hashses, but I'd make sure to also hash the UserName (or another User ID field) as well as the password so two users with the same password won't end up with the same hash. Also I'd probably throw some other constant string into the input string too for good measure.

    $hashed_password = md5( "xxx" + "|" + user_name + "|" + plaintext_password);
    

提交回复
热议问题