I have two applications, one in Laravel 5.2 and one in Meteor. I want to collect hashes for passwords which are compatible with both platforms.
The database stores the hashes separately
passwordfor Laravel.meteor_passwordfor Meteor.
Both platforms use bcrypt with 10 rounds by default, but Meteor appears to sha256 the plain password before bcrypt.
If Meteor creates password hash abc, I can sha256 the plain password, and compare it with abc using Laravel's internals, i.e. Auth::attempt()
$sha256 = hash('sha256', $request->get('password'), false);
This works. Laravel successfully authenticates the user.
However, if I register a new user in Laravel, and store the hash meteor_password, when authenticating against that hash in Meteor, it fails with the error message "Login Forbidden". This error appears to be mean incorrect credentials.
I'm creating the hash in the same way as I did when I verified it in Laravel.
$meteor_password = bcrypt(hash('sha256', $plain, false));
It seems strange that it'd work one way and not the other so I assume I'm missing something.