Question

I have a problem with SimplePasswordHasher in CakePHP.

For example when I hashed "h" I get:

761e523c2f835beeb39c69b0d1b717893c5a5c62 

but I know from several different sources that right solution is actually

27d5482eebd075de44389774fce28c69f45c8a75

My code in CakePHP:

$passwordHasher = new SimplePasswordHasher(array('hashType' => 'sha1'));
    $this->data[$this->alias]['password'] = $passwordHasher->hash(
        $this->data[$this->alias]['password']
);

What I am doing wrong?

Was it helpful?

Solution

You should not tell WRONG better call it DIFFERENT. And you will get different hash if you change the salt value on app/Config.core.php on your same CakephpApp. Learn about Salt.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top