What is the difference between the bcrypt() and the crypt() methods?

2.2k Views Asked by At

I was wondering what is the difference between these? I was having a discussion with someone about the crypt method and he was talking about the bcrypt method but to me it sounded like they are the same methods.

Thanks

2

There are 2 best solutions below

1
qwertynl On

Read the documentation:

password_hash() uses strong hash, generates strong salt, applies proper rounds automatically. password_hash() is simple crypt() wrapper and compatible with existing password hashes. Use of password_hash() is encouraged.

There is no bcript function in PHP.

0
Robin Heller On

crypt without arguments is the standard UNIX password hashing function ported to PHP whereas bcrypt is based on the Blowfish algorithm.

Bcrypt was designed specifically for hashing passwords.