php 如何将 md5 字符串转换为普通文本?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/8878388/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-26 05:41:21  来源:igfitidea点击:

How to convert md5 string to normal text?

phpmd5

提问by Ravinder Singh

I have saved user passwords in MD5 form in my database, now I want to send password to users in plaintext, is there any way I can convert an MD5 string to plaintext?

我已经在我的数据库中以 MD5 形式保存了用户密码,现在我想以明文形式将密码发送给用户,有什么办法可以将 MD5 字符串转换为明文?

回答by nulltoken

Md5 is a hashingalgorithm. There is no wayto retrieve the original input from the hashed result.

Md5 是一种散列算法。有没有办法来从哈希处理的结果的原始输入。

If you want to add a "forgotten password?"feature, you could send your user an email with a temporarylink to create a new password.

如果要添加“忘记密码”?功能,您可以向您的用户发送一封带有临时链接的电子邮件以创建新密码。

Note:Sending passwords in plain text is a BAD idea:)

注意:以纯文本形式发送密码是一个坏主意:)

回答by Ocracoke

The idea of MD5 is that is a one-way hashing, so it can't be once the original value has been passed through the hashing algorithm (if at all).

MD5 的想法是一种单向散列,因此一旦原始值通过散列算法(如果有的话)就不能。

You could (potentially) create a database table with a pairing of the original and the MD5 values but I guess that's highly impractical and poses a major security risk.

您可以(可能)创建一个包含原始值和 MD5 值配对的数据库表,但我想这是非常不切实际的,并且会带来重大的安全风险

回答by Moustafa Maged

you can use this http://www.md5decrypt.org/or this http://md5.gromweb.com/it will decrypt your md5 code

您可以使用此http://www.md5decrypt.org/或此 http://md5.gromweb.com/它将解密您的 md5 代码

回答by Mathias Schwarz

I you send passwords to users in an email, you might as well have no passwords at all.

如果您通过电子邮件向用户发送密码,您也可能根本没有密码。

You cannot reverse the MD5 function, so your only option is to generate a new password and send that to the user (preferably over some secure channel).

您无法反转 MD5 功能,因此您唯一的选择是生成一个新密码并将其发送给用户(最好通过某个安全通道)。