Manuel Garcia
Manuel Garcia

Reputation: 144

The algorithm "bcrypt" is not supported. Symfony

Symfony does't work with bcrypt algorithm, it's so strange anyone know what could be ? Thanks.

security:
   encoders:
    AppBundle\Entity\Usuario:
      algorithm: bcrypt

The app says me

The algorithm "bcrypt" is not supported.

Upvotes: 2

Views: 1429

Answers (3)

deo
deo

Reputation: 1

Don't use AppBundle\Entity\Usuario:

security:
   encoders:
      App\Entity\User:
         algorithm: bcrypt

Upvotes: 0

Manuel Garcia
Manuel Garcia

Reputation: 144

Finaly "fixed", I've reinstaled the symfony version, I had a old version. Thanks all for answers.

Upvotes: 0

Chin Lee
Chin Lee

Reputation: 133

Could you please put this code in somewhere to make sure you can run bcrypt algorithm for hashing password

$encoder = new \Symfony\Component\Security\Core\Encoder\BCryptPasswordEncoder(4);
$password = $encoder->encodePassword('your_plain_password', 'your_salt');

If you receive error like To use the BCrypt encoder, you need to upgrade to PHP 5.5 or install the "ircmaxell/password-compat" via Composer.. So unfortunately, I think you should reinstall PHP. otherwise, that must be a bug in symfony document. Because I've just had a check the PHP function hash_algos(), it doesn't return bcrypt algorithm, strange! My PHP version is 5.6.11

Upvotes: 1

Related Questions