Re: password sanity checker

From: Date: Thu, 06 Sep 2001 17:51:39 +0000
Subject: Re: password sanity checker
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-66243@lists.php.net to get a copy of this message
A cheap and cheerful rule is to insist on at least one numeric. Then you don't have to bother with a dictionary check! The php to force only alphas and numerics (upper or lower case) and at least one numeric is something like : - if (!ereg("^[a-zA-Z0-9]*[0-9][a-zA-Z0-9]*$",$password)) { $message = "no good"; } and the Javascript : - var passwordPat=new RegExp("^[a-zA-Z0-9]*[0-9][a-zA-Z0-9]*$"); if ( password.match(passwordPat)==null) { alert("no good"); } Good Luck, George Chris Anderson wrote: > > Getting the size is easy, and if you had a small dictionary you could see if > the password existed in that by looping through it. Not sure about checking > if it is LIKE the username > ----- Original Message ----- > From: "Charles Sprickman" <spork@inch.com> > To: <php-general@lists.php.net> > Sent: Tuesday, July 03, 2001 12:18 PM > Subject: [PHP] password sanity checker > > > Hi, > > > > I've been digging around for a function to do a sanity check on > > user-supplied passwords when creating a new account. Haven't found > > anything yet... Any pointers appreciated. > > > > Ideally it should: > > > > -check for a min number of numerals > > -check for similarity against username (?) > > -check at least a small dictionary > > > > Although anything that could provide a starting point would be great. > > > > Thanks, > > > > Charles > > > > | Charles Sprickman | Internet Channel > > | INCH System Administration Team | (212)243-5200 > > | spork@inch.com | access@inch.com > > > > > > -- > > 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 > > > >

« previous php.general (#66243) next »