Best PHP hashing method for storing user passwords in a MySQL table?

前端 未结 6 1115
半阙折子戏
半阙折子戏 2021-02-05 22:57

I\'ve been reading Stack Overflow questions for about 15 minutes now and every single one seems to contradict the previous one I read. Bcrypt, SHA1, MD5, and so on. I currently

6条回答
  •  谎友^
    谎友^ (楼主)
    2021-02-05 23:25

    I'd go with bcrypt. It drastically reduces the ability to generate rainbow tables.

    http://codahale.com/how-to-safely-store-a-password/

    It's important to note that salts are useless for preventing dictionary attacks or brute force attacks. You can use huge salts or many salts or hand-harvested, shade-grown, organic Himalayan pink salt. It doesn't affect how fast an attacker can try a candidate password, given the hash and the salt from your database.

提交回复
热议问题