You are here: Re: Lost password + MD5 ? « PHP Programming Language « IT news, forums, messages
Re: Lost password + MD5 ?

Posted by Alvaro G Vicario on 09/02/05 16:10

*** frizzle wrote/escribió (2 Sep 2005 05:53:34 -0700):
> 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?

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_password.php?id=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
--

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация