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.

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

报告相同问题?

悬赏问题

  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料