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

后端 未结 16 2074
梦谈多话
梦谈多话 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:44

    I'm going to go out on a limb and say it's more secure in certain circumstances... don't downvote me yet though!

    From a mathematical / cryptographical point of view, it's less secure, for reasons that I'm sure someone else will give you a clearer explanation of than I could.

    However, there exist large databases of MD5 hashes, which are more likely to contain the "password" text than the MD5 of it. So by double-hashing you're reducing the effectiveness of those databases.

    Of course, if you use a salt then this advantage (disadvantage?) goes away.

提交回复
热议问题