I’m building a password protected login system for a site, and I have run into two MySQL functions to encrypt the user’s password: MD5() and ENCODE().
They both seem to encrypt it, but I want to use whichever one is more secure. Is there a clear winner here, or is it just a preference situation? Thanks!
Here is a brief explanation of what each one does:
When it comes to using hashes (one-way encryption), it is a good practice to salt your hashes. This prevents potential attackers from using a database of known hashes to rapidly discover passwords.
In short, encode is totally insecure, MD5 is insecure, and SHA2(string, 512) with salt is not a bad choice.