dsf12123
2016-08-05 04:20
浏览 102

使用bcrypt哈希密码迁移系统

I plan to migrate a system developed with PHP Laravel that hashed users password with bcrypt, so just wanted to know is there anyway to convert them somehow in order to make new NodeJS system (with bcrypt) to reuse the current password fields? or the only way forward is to ask user to reset passwords?

图片转代码服务由CSDN问答提供 功能建议

我计划迁移使用PHP Laravel开发的系统,用bcrypt清除用户密码,所以只是想知道是否存在 无论如何要以某种方式转换它们以使新的NodeJS系统(使用bcrypt)重用当前的密码字段? 或者唯一的方法是要求用户重置密码?

  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

2条回答 默认 最新

  • dpauxqt1281 2016-08-05 04:45
    已采纳

    Are you asking if the hashed password data (stored on the server, for example) can be used in another bcrypt implementation in node, or something else?

    Using modules in node should work with the existing password data (as someone already suggested), but remember to use the same exact salting method and options as the previous bcrypt implementation in PHP, obviously, so that bcrypt generates the same data as before. As long as all options and input into bcrypt are the same, the bcrypt implementation in node should produce the same results and be able to be used.

    打赏 评论
  • duanqiongchong0354 2016-08-05 04:37

    Using the bcrypt or bcryptjs modules in node with the existing passwords should work just fine.

    打赏 评论

相关推荐 更多相似问题