ENCRYPT uses a one-way hash algorithm, DECRYPT does not exist .. What is the meaning of password encryption: a hacker should not be able to see transparent text passwords.
If you need to compare the password in db with the user entered, use such a request (using prepared requests)
SELECT * FROM `user` WHERE `name` = 'hek2mgl` AND `password` = ENCRYPT('user_input', `password`)
The ENCRYPT function will output a "salt" string with the prefix of the salt itself, so when you feed back the encrypted password will re-submit the original salt.
hek2mgl
source share