-3

I am working on a small project that requires the registration of the password of my user is in MD5.

I know that for more security it's better to use BCRYPT, but I'm trying to find out if there is a way to implement something more simple

OMR
  • 11,736
  • 5
  • 20
  • 35
BERL1
  • 11
  • 2
  • 1
    It's *harder* to do it the bad way in Laravel. It's built around strong password hashing, and you should use that strong hashing. – ceejayoz Oct 05 '19 at 21:18
  • https://stackoverflow.com/a/32686882/916000 – Taha Paksu Oct 05 '19 at 21:26
  • 2
    Why does it require MD5? Is it because you already have passwords stored that way and you don't know how to change them over? Because you could pretty easily edit your login controller to check the existing MD5 hash on first login, then rehash the password using Laravel's hash facade for future use. – matticustard Oct 05 '19 at 21:54

1 Answers1

0

protected function create(Request $request)
{
    $user= User::create([
        'username' => $request->user_name,
        'email' => $request->email,
        'password' => md5($request->password),

    ]);
}
albus_severus
  • 3,626
  • 1
  • 13
  • 25