How to use `bcrypt` algorithm within `encrypt` function in MySQL for verifying password?

You can’t. The MySQL ENCRYPT() function uses the operating system’s crypt() function — if your operating system does not support bcrypt hashes, MySQL will not support them either.

Also, do not use the MySQL ENCRYPT() function. As ircmaxell noted, any data you pass to a MySQL query may end up in server log files, so it’s potentially unsafe to use it for anything password-related.

Leave a Comment