View Full Version : Valid Password for VBscript

12-21-2007, 05:51 PM
I know this is an old question; however I cannot find code to do this.
And I know so little about vbscript.
My requirements are:
be generated by the user;
have at least eight characters;
have at least one alphabetic and one numeric character;
have at least one lower-case letter;
not contain many occurrences of the same character;
not be the same as the operator's profile name; and
not contain a long substring of the user's profile name.

If possible I would like to reuse the code. Can I put the vbscript in a library and just call the script as I need it? If so, how do I save the vbscript and how do I call the script within a web page to validate a password?:confused:

Whatever Jr.
12-22-2007, 10:22 AM

Show us what you have so far...


12-23-2007, 03:10 PM
There are probably some more checks you want to do too.

How long is the password field on your database? Your test should probably be for a minimum of 8 characters and also a maximum of...

Are there characters that you want to disallow in your passwords? Spaces, for instance?

A number of regular expression tests are probably your best bet.

For instance, use a pattern of "^[A-Za-z0-9]{8,16}$" to test for 8 to 16 characters, allowing only A-Z, a-z and 0-9.

Use "[A-Z]+" to test for at least one uppercase character.
Use "[a-z]+" to test for at least one lowercase character.
Use "[0-9]+" to test for at least one number.


Whatever Jr.
12-24-2007, 02:03 PM
Addition to SouthwaterDave:

And you have to decide the max substring from a username acceptable.
How's that? Enough info to create your function?

HTH, Tom