php 密码文本框!

发布于 2024-10-09 03:41:22 字数 310 浏览 1 评论 0原文

alt text

<input type="password" value="<?php echo md5($row['password']);?>">
<input type="password" value="<?php echo $row['password'];?>">

我正在尝试从数据库中检索密码。 在输入框中,我希望它显示密码:12345,而不是 MD5 版本的 12345。

alt text

<input type="password" value="<?php echo md5($row['password']);?>">
<input type="password" value="<?php echo $row['password'];?>">

im trying to retrive the password from the database.
In input box, i want it show, let say password : 12345, instead of MD5 version of 12345.

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

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

发布评论

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

评论(4

别想她 2024-10-16 03:41:22

MD5 是不可逆的,出于安全原因,您不应自动填充密码字段。

它显示的时间更长,因为经过 MD5 处理的字符串始终为 32 个字符。

编辑:您也不应该使用可逆的密码存储方法。请参阅 Jeff Atwood 的“您可能正在存储密码”错误” 帖子了解详细信息。

MD5 is not reversible, and you shouldn't autofill a password field for security reasons.

It's showing longer because MD5ed strings are always 32 characters.

edit: You also shouldn't use a reversible password storage method. Please see Jeff Atwood's "You're Probably Storing Passwords Incorrectly" post for details.

偏爱你一生 2024-10-16 03:41:22

它输出 MD5 哈希值是因为您告诉它这样做:

echo md5($row['password']);

但是,更一般地说,请不要将密码输出到页面。永远、永远不要这样做。甚至不输出 MD5 哈希值。不要输出任何有关密码的内容。您实质上是在泄露密码供任何人查看。

另外,也不要以纯文本形式存储密码

It's outputting the MD5 hash because you're telling it to do just that:

echo md5($row['password']);

On a more general note, however, please do not output passwords to the page. Never, ever do this. Don't even output the MD5 hash. Don't output anything about the password. You are essentially giving away passwords for anybody to see.

Also, don't store passwords in plain text either.

泛滥成性 2024-10-16 03:41:22

如果您对输入字段的 value 属性中的密码进行 md5(),它将是 32 个字符的字符串。如果您不希望它成为值中经过 md5() 处理的字符串,则不要对其进行 md5() 处理。

您能否扩展您的代码以显示实际发生的情况以及您希望实现的目标?

If you md5() the password in the value attribute of the input field, it's going to be the 32-character string. If you don't want it to be the md5()'ed string in the value then don't md5() it.

Can you expand your code to show what's actually happening and what you're looking to achieve?

⒈起吃苦の倖褔 2024-10-16 03:41:22

这是不可能的,md5只是单向加密,除非暴力破解,否则无法解密。

It isnt possable, md5 is only one-way encryption, you cant decrypt it unless you bruteforce.

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