1

We are in the process of moving a website from Ruby to PHP. We already have a users table where the passwords were generated by Devise.

I am trying to find out how Devise stores the password in MySQL. Appears at first look to be a SHA encrypted with a salt, but I am not clear on how the salt is selected.

I am trying to work the Devise code back to pseudo code so that we can the re write the code in PHP. Looking for help or suggestions with this.

Trying to avoid resetting everybody's password, but depending on how well Devise stores passwords that might be the only option.

4

2 回答 2

0

设计使用 bcrypt 你应该问“我如何在 PHP 中使用 bcrypt”。这个问题已经被问过了:

PHP 和 Bcrypt

PHP中的Ruby bcrypt密码检索

基本上,您应该将crypt函数与河豚算法一起使用。

于 2012-11-28T23:11:01.907 回答
0

也许您可以导出数据库并将其导入 PHP 数据库?

于 2012-11-15T03:12:01.257 回答