如何在 laravel 5.4 中将默认的 bcrypt 哈希修改为 md5

How to modify default bcrypt hashing into md5 in laravel 5.4

我有一个 MD5 密码,我想在 Laravel 5.4 中导入用户,因为 Laravel 由于 bcrypt 散列不允许使用基于 md5 的导入用户登录。

1) Is there any way to use MD5 instead of bcrypt?
2) How can I use the original password to store in Laravel with default bcrypt?

这样做的主要目的是在Laravel 5.4中导入用户后,在Laravel中使用md5加密密码。

Like most hash functions, MD5 is neither encryption nor encoding. It can be cracked by brute-force attack and suffers from extensive vulnerabilities as detailed in the security section below.

来源:https://en.wikipedia.org/wiki/MD5

我不会将密码散列更改为 MD5,而是创建一个页面,用户可以在其中更新密码。

只需创建一个包含 4 个输入字段的页面:

  • 电子邮件
  • 旧密码
  • 新密码
  • 验证新密码。

如果旧的 MD5 密码匹配,请使用 bcrypt() 更新他们的密码,他们可以登录到您的 Laravel 应用程序。您可以将信息 & link 添加到登录页面,并向所有用户发送包含信息和 link.

的电子邮件