douluo6626 2019-07-17 08:40
浏览 95
已采纳

我是否需要将BCRYPT哈希拆分为数据库中的单独字符串?

I wanted to make my password database more sequre encrypting the passwords with bcrypt. The thing is I do not know if it is important to split the hash returned by the method into different strings (-prefix-cost-salt-password-) in order to make it safer. Does it? The hash returned: $2y$10$/s1xHJ04qAY2CCs16BHdQ.VpzQjd3HSUGEsL6xiKrd.RQig7uFpZ.

And in that case, which columns should I create in my database table?

  • 写回答

1条回答 默认 最新

  • dongli564510 2019-07-17 10:10
    关注

    You don't need to split the hashed password, why you want to do that? Just use the PHP native password hashing function: password_hash($user_password, PASSWORD_BCRYPT, ['cost'=> 12]) and store the result inside the database.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?