I\'m using sha256 to encrypt the password. I can save the sha256 encrypted password in mysql. But i can\'t login with the same clause.
Insert code:
A way better solution is to just use the excelent compatibility script from Anthony Ferrara:
https://github.com/ircmaxell/password_compat
Please, and also, when checking the password, always add a way (preferibly async, so it doesn't impact the check process for timming attacks) to update the hash if needed.