丢失密码+ MD5? [英] Lost password + MD5 ?

查看:145
本文介绍了丢失密码+ MD5?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,


我已经在一些地方读过你应该*从不*

将原始密码存储在mySQL数据库中。

现在我想知道你是否对它进行加密(使用MD5?),应该如何创建一个丢失的密码功能,所以通行证可以是

发送到相应的电子邮件地址?


Greetings Frizzle。

Hi there,

I''ve read in a few places that you should *never*
store original passwords in a mySQL DB.
Now i wonder if you encrypt it (with MD5 ?), how should
i create a lost password function, so the pass could be
sent to a corresponding e-mail address?

Greetings Frizzle.

推荐答案

** * frizzle写道/escribió(2005年9月2日05:53:34 -0700):
*** frizzle wrote/escribió (2 Sep 2005 05:53:34 -0700):
我已经在一些地方读过你应该*从不*
存储原始密码mySQL DB。
现在我想知道你是否对它进行加密(使用MD5?),应该如何创建丢失的密码功能,这样可以将通行证发送到相应的电子邮件地址?
I''ve read in a few places that you should *never*
store original passwords in a mySQL DB.
Now i wonder if you encrypt it (with MD5 ?), how should
i create a lost password function, so the pass could be
sent to a corresponding e-mail address?




因为你不知道用户的密码(这就是重点)你不能发送它

返回。但是,您可以为用户提供一个临时URL,我们可以在这里设置一个新的。


步骤:


1)创建一个长随机ID。 md5()和uniqid()可以帮助

2)将其存储在数据库中

3)向用户发送一封ID为:

的邮件 http://www.example.com/reset_passwor...=xxxxxxxxxxxxx


4)在reset_password.php中测试DB中是否存在ID。如果是这样,允许设置

通过


您可以添加您能想到的所有安全功能:


*删除使用的ID

*过期旧的未使用的ID

*存储用户名或电子邮件并要求他们

-

- álvaroG。Vicario - 西班牙布尔戈斯

- http://bits.demogracia.com - Mi sitiosobreprogramaciónweb

- 请勿将您的问题通过电子邮件发送给我,并将其发布给小组

-



Since you don''t know user''s password (that''s the point) you cannot send it
back. You can however provide the user with a temporary URL where we can
set a new one.

Steps:

1) Create a long random ID. md5() and uniqid() may help
2) Store it in DB
3) Send user a mail message with the ID:

http://www.example.com/reset_passwor...=xxxxxxxxxxxxx

4) In reset_password.php test whether ID exists in DB. If so, allow to set
pass

You can add all security features you can think of:

* Remove used ID
* Expire old unused IDs
* Store username or e-mail and ask for them
--
-- álvaro G. Vicario - Burgos, Spain
-- http://bits.demogracia.com - Mi sitio sobre programación web
-- Don''t e-mail me your questions, post them to the group
--


这是正确的,绝不以明文形式存储密码。以上

的建议是正确的,不过我也会输入一些随机的

字符(将字符串分段并在另一端重建它)。

给他们一个登录链接,以便他们立即创建一个

新密码,如上所述。还要考虑使用安全性

问题。


也许也会在链接中传递某种加密的用户名

make检查功能更快,验证。 (即选择

,其中user =(decrypt)和pass =(decrypt)。

This is correct, never store password in plain text. The above
suggestion is correct, though I would also put in some random
characters (segment the string and rebuild it the other end).

Give them a link to log in so that they immediately have to create a
new password as suggested above. also think about using security
questions.

perhaps also pass some sort of encrypted username in the link also to
make the checking function that much quicker to validate. (i.e. select
where user= (decrypt) and pass=(decrypt).


ij ******** @ gmail.com 写道:
ij********@gmail.com wrote:
这是正确的,永远不会以明文形式存储密码。上面的建议是正确的,虽然我也会添加一些随机的
字符(将字符串分段并重新构建另一端)。

给他们一个登录链接,这样他们就可以立即创建一个如上所述的新密码。还要考虑使用安全性问题。

也许也会通过某种形式链接中加密的用户名也可以使检查功能更快地验证。(即选择
其中user =(decrypt)和pass =(decrypt)。
This is correct, never store password in plain text. The above
suggestion is correct, though I would also put in some random
characters (segment the string and rebuild it the other end).

Give them a link to log in so that they immediately have to create a
new password as suggested above. also think about using security
questions.

perhaps also pass some sort of encrypted username in the link also to
make the checking function that much quicker to validate. (i.e. select
where user= (decrypt) and pass=(decrypt).







我不想破坏这个派对,但如果你安全md5(密码)你可能会像

很好地存储它们的明文。

MD5已经有了最好的效果AYS。 : - (


一些非常聪明的Chineese人提出了一个产生

INPUTSTRINGS的算法,它提供与原始字符串相同的MD5哈希值。

这种效应称为collison:

MD5(StringA) - > blakjhdsafjkh

MD5(StringB) - > blakjhdsafjkh

MD5(StringC) - > blakjhdsafjkh




他们想出了一个产生一些字符串的算法(StringB和StringC

在上面的例子中)产生相同的哈希。


我也读了一些关于slashdot的smart @ ss改进了,现在它可以是
$ b $ 1 b在一台普通的PC上完成1秒钟。


所以:有效的MD5坏了。不要使用它。


同样适用于SHA1(不同的问题)。


如果您有兴趣,请阅读更多相关主题。

由最好的:Schneier撰写。 :-)

http://www.schneier.com/blog/archive...a1_broken.html


问候,

Erwin Moller



Hi,

I don''t want to ruin this party, but if you safe md5(password) you might as
well store them plaintext.
MD5 has had its best days. :-(

Some really smart Chineese guys came up with an algoritm that produces
INPUTSTRINGS that give the same MD5 hash as the original string.
That effect is called collison:
MD5(StringA) -> blakjhdsafjkh
MD5(StringB) -> blakjhdsafjkh
MD5(StringC) -> blakjhdsafjkh
etc.

They came up with an algoritm that produces some string (StringB and StringC
in the above example) that produce the same hash.

I also read some smart@ss at slashdot improved on this, and now it can be
done on a run-of-the-mill PC in 1 second.

So: effectively MD5 is broken. Do not use it.

Same goes for SHA1 (different problem).

If you are interested, read more on the topic.
Written by the best: Schneier. :-)

http://www.schneier.com/blog/archive...a1_broken.html

Regards,
Erwin Moller


这篇关于丢失密码+ MD5?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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