开发者

how to use md5 encryption for password field in mysql database in coldfusion

I am implementing an application in which I must insert encrypted passwords into a MySQL database. Then retrieve the decrypted password from the database using md5 encryption in ColdFusion.

How can I use md5 encryption in Co开发者_开发问答ldFusion with a MySQL database?


md5 is a one way hash, it cannot be reversed.

You should never store decryptable passwords in the database. Store the md5 hash only. When the user tries to login, generate an md5 hash of the plain text password. Then compare it to the md5 hash stored in the db.


You can use md5 function that is available with mysql itself.

However, it in one-way algorithm.

You cannot decrypt it. You will need with md5 of given password against the stored one.

for more information, please check,

http://dev.mysql.com/doc/refman/5.5/en/encryption-functions.html#function_md5

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜