Two-way encryption is inherently less secure, since real data is stored somewhere. That is, you have a hi password. Then you get it, you get 5d41402abc4b2a76b9719d911017c592. This does not make sense for a normal person, and they will not know how to decrypt it without knowing the correct encryption algorithm. They cannot use this either because only the original password is used. You verify the password by hashing it and comparing it with the hash (also stored). 5d41402abc4b2a76b9719d911017c592 hashes 69a329523ce1ec88bf63061863d9cb14, so they do not match. Even if the user knows the hashed password, he cannot extract anything from it.
That way you can store encrypted data, but if you decrypt it when you pull it out, then anyone can use it.
The security of sending a link to a user compared to giving them a password is another problem. If you email the password, it prints out in plain text so that everyone can see (and use). Providing them with a link that allows them to enter a new password means that no one will see it, which is a bit more secure, but if someone who has committed fraud has access to this link, it will still cause problems.
About AES, I can't find out too much about this at a glance, but it doesn't seem like it matters that you encrypt. Therefore, if you use AES_DECRYPT (AES_ENCRYPT ('x', 'b'), 'b'); it will return an "x". You must follow the key.
source share