Best practice of Hashing passwords

后端 未结 2 880
执笔经年
执笔经年 2020-12-09 00:11

I would like to know which method to use to store passwords in database. I have implemented it using MD5 but according to some posts SHA1 is more secure. Is there any other

2条回答
  •  醉话见心
    2020-12-09 00:42

    SHA1 has less vulnerabilities than MD5. It's a newer algorithm that utilizes more bits and requires more processing to "crack." You can view most of the mainstream hash algorithms and their known vulnerabilities here: http://en.wikipedia.org/wiki/Cryptographic_hash_function

    As someone already commented, definitely make sure you add "salt" to your password hash to further obscure any possible pattern.

提交回复
热议问题