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.

4
  • Which version of php are you using? You need php 5.5 or above Commented Dec 1, 2015 at 19:58
  • see also stackoverflow.com/questions/4795385/… Commented Dec 1, 2015 at 19:59
  • Solution not found yet :( Commented Dec 1, 2015 at 20:16
  • What symfony do you use? It should explicitly create an instance of BCryptPasswordEncoder if bcrypt is specified. Commented Dec 2, 2015 at 3:38

3 Answers 3

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

Sign up to request clarification or add additional context in comments.

Comments

0

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

Comments

0

Don't use AppBundle\Entity\Usuario:

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.