RE: [PHP-GENERAL] Random Password Generator
| From: | Ben Peter | Date: | Tue, 13 Jun 2000 19:26:25 +0000 |
| Subject: | RE: [PHP-GENERAL] Random Password Generator | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-1746@lists.php.net to get a copy of this message | ||
This is no good way to generate passwords if the generator runs regularly.
The scripts always reads all of the dictionary and takes ages to do so.
Ben
> Read this article.
>
> http://www.phpbuilder.com/columns/jesus19990502.php3
>
> Eduardo Jordán G.
> Webmaster
>
>
> -----Original Message-----
> From: Brian C. Doyle [SMTP:bcdoyle@mindspring.com]
> Sent: Tuesday, June 13, 2000 1:57 PM
> To: Svetlin Simeonov; PHP LIST
> Subject: Re: [PHP-GENERAL] Random Password Generator
>
> This is what I am using and it works rather well
>
> <?
> function password($length=8)
> {
> /*
> ** Set pool of possible characters
> */
> $Pool = "ABCDEFGHIJKLMNOPQRSTUVWXYZ123456789";
> $Pool .= "abcdefghijklmnopqrstuvwxyz";
>
> for($index = 0; $index < $length; $index++)
> {
> $sid .= substr($Pool,
> (rand()%(strlen($Pool))), 1);
> }
>
> return($sid);
> }
>
> // Seed the generator
> srand(time());
> $passwd = password(8);
> ?>
>
> I hope this helps
>
> At 09:49 PM 6/13/00 +0200, Svetlin Simeonov wrote:
> >Hi guys, is there anyone have a good solution for random password
> >generator ?
> >I think something about this
> >
> >$newpass = "";
> >$string = "ABCDabcd1234";
> >for ($i=0; $i<8; $i++ ) {
> >$newpass.= substr(rand(0,sizeof($string)),1,$string);
> >}
> >
> >--------------------------------------------------------
> >Unfortunatly no one can be told what the MATRIX is !
> >
> >
> >--
> >PHP General Mailing List (http://www.php.net/)
> >To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> >For additional commands, e-mail: php-general-help@lists.php.net
> >To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>
>
--
Benjamin Peter
Zentropy Partners GmbH
ph. +49-69-96244-395
pax +49-69-96244-244
http://www.zentropypartners.com
"Integrate the building and marketing of digital businesses"