User Database Password Encryption
Do you store your user passwords in plaintext or encrypted
A question for those of you who do virtual hosting of email/ftp and other services. Looking at how hard it is to get an encryption standard that works across all, and the very limited support of standards in clients, do you bother encrypting the password in the database?
Articles from Dovecot (
So to the linode community, what do you do?
6 Replies
Both e-mail and FTP passwords are encrypted with the MySQL ENCRYPT function in our databases.
I also use this kind of thinking when creating websites that use a username and password to log in.
Dovecot and exim4 were a bit of a fiddle to get working correctly with php's sha1(), but no complaints about the less standards-compliant clients (yet).
Encryption(two way can be decrypted back into original password):
plaintextpassword->encryptionkey->encryptedpassword
encryptedpassword->encryptionkey->plaintextpassword
Hashing (supposedly one way):
plaintextpassword->hashedpassword+anyextrastuffyouwanttoaddinlikesalt->finalhashedpassword
finalhashedpassword->nowaytogetfinalhashedpasswordinplaintextunlessyoualreadyknowwhattheplaintextpasswordisalready
The only way to get the password would be to come up with the plain text equivalent of the hashed value, even if you do not have the original there is a change that you might come into another plaintext value that has the same hash eventually.
@Internat:
Do you store your user passwords in plaintext or encrypted
When I come across an unsalted, non-hashed plaintext password…I'm. frankly staggered
@jed:
@Internat:Do you store your user passwords in plaintext or encrypted
When I come across an unsalted, non-hashed plaintext password…I'm. frankly staggered
I just say ….. keeps me employed
Hashed and salted with sha1 or better is the way to go. And make sure you use a unique salt for each password, otherwise the purpose of the salt will be defeated.