如何以纯文本格式输出MD5哈希密码? [英] How to output MD5 hashed password in plain text?

查看:88
本文介绍了如何以纯文本格式输出MD5哈希密码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有使用MD5加密并存储在数据库中的网站上成员的密码.我想实现一种密码丢失功能,如果忘记密码,将通过电子邮件将其凭据发送给用户.但是,如何输出未加密的密码,或者是加密的一种方式,因此是不可能的?

I have passwords for members on a site encrypted using MD5 and stored in the database. I want to implement a lost password functionality where the user will be emailed their credentials if they forget them. But how to output the unencrypted password or is it one way encryption and hence impossible?

推荐答案

MD5不是加密的-它是单向哈希.您无法反转单向哈希(理论上,您可以找到具有等效哈希的纯文本,该哈希通常一样好,但是您不能在任何合理的时间内),因此您只需要设置一个新密码即可并通过电子邮件临时发送给他们,和/或仅向他们提供一个链接以重置其密码.

MD5 isn't encryption - it's a one-way hash. You can't reverse a one-way hash (theoretically you can find a plaintext that has an equivalent hash which is generally as good, but you can't in any reasonable amount of time), so you just need to set a new password and email it to them as a temporary, and/or just provide them a link to reset their password.

这篇关于如何以纯文本格式输出MD5哈希密码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆