robclancy / laravel4-hashing

Package for when you can't use Bcrypt in Laravel 4
32 stars 11 forks source link

Unsupported Password Hash Supplied #1

Closed jasondavis closed 11 years ago

jasondavis commented 11 years ago

I Installed this libary to work on a server with PHP 5.3.2 and it seemed to work fine with my existing Database, that is until I had to drop my database and rebuild. Now the Passwords created with Hash::make('admin') in my Database Seeder do not seem to let me login anymore.

When I go to login I get this nasty error now... please help?

Unsupported Password Hash Supplied
open: E:\Server\htdocs\projects\timeclock\vendor\passwordlib\passwordlib\lib\PasswordLib\Password\Factory.php
    public function verifyHash($password, $hash) {
        foreach ($this->implementations as $impl) {
            if ($impl::detect($hash)) {
                $instance = $impl::loadFromHash($hash);
                return $instance->verify($password, $hash);
            }
        }
        throw new \DomainException('Unsupported Password Hash Supplied');
    }

My old Hashed password for admin looked like this $2y$08$vNhcPdvTthE5cncP7jTuxeXbMJcvj7cYfJQ51ghIUhig4J/PbE1A6

Using the new library it looks like this $6$rounds=5000$I23arGSCOFbMc.LH$qaIBVL9PsO/UOSvbzll7BMFGTgxXJYv2TQsd77fBX16UN1WkYMZElyYnsc6pWEPFY6W7xBmQanQXQYnJ2pD0q0

Reloading it, it changes everytime but this part stays the same $6$rounds=5000 I am curious is this part is even supposed to be there?

jasondavis commented 11 years ago

Found it to be an issue in my user model

robclancy commented 11 years ago

Just so you know, that consistent stuff added to the hashes is actually configuration saved into the hash. Then the hash before the . I believe is the salt built in as well. Or something similar, works similar to how bcrypt functions.

yandiko commented 10 years ago

i face the same problem, i have table tbaccount , i have 4 accounts that can log in to my system, the first n second account can log in well, but the third n so forth display Unsupported Password Hash Supplied. any solution for this? thanks in advance.

vatsu commented 10 years ago

I have encountered the same problem.

I was wondering if @jasondavis could tell which problem he found on his model.

Thanks

phosphore commented 10 years ago

Same problem here :(

michielgerritsen commented 10 years ago

Make sure your password database field is long enough. The Laravel documentation states:

Please remember when building the Schema for this Model to ensure that the password field is a minimum of 60 characters.

But the hashes created by this library are clearly longer that 60 characters. Making the field longer fixed the problem for me.

hazamukara commented 10 years ago

Yeah, also got this problem, I made the column into varchar and length of 118 characters. It worked now.

yandiko commented 10 years ago

yes, me too, have to 60 length on column.

2014-07-20 15:08 GMT+07:00 hazamukara notifications@github.com:

Yeah, also got this problem, I made the column into varchar and length of 118 characters. It worked now.

— Reply to this email directly or view it on GitHub https://github.com/robclancy/laravel4-hashing/issues/1#issuecomment-49540088 .

polo070770 commented 9 years ago

@hazamukara can you tell me why the column length have to be 118 character? and how did you know it? It works... but I wanna know why.