如何在coldfusion中对mysql数据库中的密码字段使用md5加密

发布于 2024-10-08 10:59:47 字数 131 浏览 0 评论 0原文

我正在实现一个应用程序,必须将加密密码插入 MySQL 数据库。然后使用 ColdFusion 中的 md5 加密 从数据库中检索解密的密码。

如何在 ColdFusion 中对 MySQL 数据库使用 md5 加密?

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 ColdFusion with a MySQL database?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

原野 2024-10-15 10:59:47

md5 是一个单向哈希,它无法逆转。

您永远不应该在数据库中存储可解密的密码。仅存储 md5 哈希值。当用户尝试登录时,生成纯文本密码的 md5 哈希值。然后将其与数据库中存储的 md5 哈希值进行比较。

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.

℉絮湮 2024-10-15 10:59:47

您可以使用 mysql 本身提供的md5函数。

然而,它是单向算法。

你无法解密它。您需要将给定密码的 md5 与存储的密码进行比较。

有关详细信息,请查看

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

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文