Hey lads,
I am still stuck with migrating a shitty plaintext website to Laravel. However, so far the entire user administration is done by other applications, using a different hashing algorithm than Laravel.
Laravel by default uses bcrypt which is okay-ish.
The Passwords in my database however are being generated with
bcrypt(sha256(password))
I cannot adjust the in-use windows applications and they still require to work after this website migration.
Which is the best, safest and please, easiest way to adjust the hashing algorithm of Laravel to work with mine, rather than just bcrypt?
Sure registration is no issue, I could just do this:
RegistrationController.php
protected function create(array $data)
{
return User::create([
'name' => $data['name'],
'surname' => $data['surname'],
'email' => $data['email'],
'password' => Hash::make(hash('sha256',$data['password'])),
]);
}
But I have no idea how to verify that by login. I am using the Laravel Auth package.
Weird solutions by some weird people showing how to change the algorithm to MD5 by manipulating files within the vendor directory itself. This cannot be correct, since once updated the entire stuff gets broken again. There must be a better solution, probably with some custom made service provider? Sadly I am too new/bad with laravel to understand this. I'd love to get some serious spoonfeed here.
Thanks.