Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Aug 2007
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Valid Password for VBscript

    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?

  • #2
    Regular Coder
    Join Date
    Sep 2007
    Posts
    120
    Thanks
    0
    Thanked 3 Times in 3 Posts
    Hi,

    Show us what you have so far...

    Tom

  • #3
    Regular Coder
    Join Date
    May 2007
    Location
    UK
    Posts
    180
    Thanks
    0
    Thanked 18 Times in 18 Posts
    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.

    etc...

  • #4
    Regular Coder
    Join Date
    Sep 2007
    Posts
    120
    Thanks
    0
    Thanked 3 Times in 3 Posts
    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


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •