1

Because the format of hashed string ($2y$10$salt....) itself gives clues to hacker(i.e, who hacked the DB) that the encryption is done using Bcrypt algorithm and so he can easily hack by using password_verify() in php by passing parameters as his guess passwords.

2
  • 3
    I wouldn't say 'easily': brute forcing Bcrypt will take a very, very long time. Commented Jun 23, 2014 at 13:42
  • Yes, it is fine to do so. Brute force attacks on bcrypt are not a very effective method, especially when you increase the cost. Commented Jun 23, 2014 at 13:45

1 Answer 1

1

There is no disadvantage in storing those BCrypt hashes directly in the database, none of the parameters are meant to be secret. Furthermore they allow to switch to a better algorithm (or increase the cost factor), without becoming incompatible with older hashes.

If those parameters would be hidden somehow, an attacker would have to guess them. But there are not this many possible values, a cost factor e.g. only makes sense between 9-13. If you really want to add such a server side secret, there are much better ways to do it. You could encrypt (two-way) the already hashed values with a strong key, then an attacker has to "guess" this key, which is impossible.

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

2 Comments

Some where in the internet i saw, bcrypt is based on Blowfish cipher. But it seems Blowfish implementation is having both encrypt and decrypt also. so it means is it possible to decrypt the bcrypted hash values ?
@user3767551 - It is true that BCrypt is based on Blowfish, but while Blowfish is an encryption algorithm (two-way), BCrypt is a true hash algorithm (one-way).

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.