How do I implement password rules?
Does anyone know of any open source packages or techniques for implementing password rules. For instance, I need to implement the following rules for password in my application:
Passwords must be made up of at least three (3) of the four (4) following classes of characters: Lowercase letters, Uppercase letters, Numbers, Special Characters.
I can probably whip up some JavaScript for this, but I'd need server-side code to catch if JavaScript is disabled. I'm guessing this is not possible with regular expressions.


Posted by Erik Hatcher on April 04, 2003 at 05:54 PM MST #
Posted by Matt Raible on April 04, 2003 at 06:22 PM MST #
Posted by Anonymous on April 04, 2003 at 06:35 PM MST #
Posted by Vic on April 04, 2003 at 08:00 PM MST #
boolean foundLower = false; boolean foundUpper = false; boolean foundDigit = false; boolean foundSpecial = false; for (int i=0;i<string.length();i++) { char ch = string.charAt(i); if (Character.isLowerCase(ch)) foundLower = true; if (Character.isUpperCase(ch)) foundUpper = true; if (Character.isDigit(ch)) foundDigit = true; if (isSpecial(ch)) foundSpecial = true; } int count = 0; if (foundLower) count++; if (foundUpper) count++; if (foundDigit) count++; if (foundSpecial) count++; return (count >= 3);Posted by Dave on April 04, 2003 at 08:29 PM MST #
Posted by Sheldon Hearn on April 07, 2003 at 10:35 AM MDT #
Posted by Sheldon Hearn on April 07, 2003 at 10:54 AM MDT #