2

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.

3 Answers3

1

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

Chin Lee
  • 133
  • 1
  • 1
  • 8
0

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

0

Don't use AppBundle\Entity\Usuario:

security:
   encoders:
      App\Entity\User:
         algorithm: bcrypt
deo
  • 1