Forum Moderators: open
I'm working in a project where the owner wants to encrypt all passwords in the (MySQL) database. This may sound stupid, but is it safe to use the users' own passwords as keys for their encryptions? Example, if I would encrypt all passwords in one go:
UPDATE users SET password = AES_ENCRYPT(password, password); Is there some giant security hole I am not aware of in this use of AES?
Thankful for answers.
Many developers store passwords in a database using a one-way encryption that cannot be "decrypted", such as a MD5 hash. Then to you would only compare the two passwords after encryption, and never actually plain text.
The biggest security hole I see is having your key in your code. Look for a 3rd party encryption system that uses a shell script to write the key directly to your server bios/rom.