Results 1 to 4 of 4

Thread: Generate an ASP page a password of 8 characters strong

  1. #1
    Join Date
    Jan 2009
    Posts
    37

    Generate an ASP page a password of 8 characters strong

    hi
    i am here to ask you question about asp. i am working on asp i am newly learning on this here i want to know how can i generate an ASP page a password of 8 characters strong.please tell me if someone knows thank you

  2. #2
    Join Date
    Jan 2008
    Posts
    1,521

    Re: Generate an ASP page a password of 8 characters strong

    Generate Random Password Function
    <%
    'Our Function generatePassword accepts one parameter 'passwordLength'
    'passwordLength will obviously determine the password length.
    'The aplhanumeric character set is assigned to the variable sDefaultChars
    Function generatePassword(passwordLength)
    'Declare variables
    Dim sDefaultChars
    Dim iCounter
    Dim sMyPassword
    Dim iPickedChar
    Dim iDefaultCharactersLength
    Dim iPasswordLength
    'Initialize variables
    sDefaultChars="abcdefghijklmnopqrstuvxyzABCDEFGHIJKLMNOPQRSTUVXYZ0123456789"
    iPasswordLength=passwordLength
    iDefaultCharactersLength = Len(sDefaultChars)
    Randomize'initialize the random number generator
    'Loop for the number of characters password is to have
    For iCounter = 1 To iPasswordLength
    'Next pick a number from 1 to length of character set
    iPickedChar = Int((iDefaultCharactersLength * Rnd) + 1)
    'Next pick a character from the character set using the random number iPickedChar
    'and Mid function
    sMyPassword = sMyPassword & Mid(sDefaultChars,iPickedChar,1)
    Next
    generatePassword = sMyPassword
    End Function
    Response.write generatePassword(6) 'Call the function & pass in 6 as the parameter
    %>

  3. #3
    Join Date
    Dec 2008
    Posts
    322

    Re: Generate an ASP page a password of 8 characters strong


  4. #4
    Join Date
    May 2008
    Posts
    2,389

    Re: Generate an ASP page a password of 8 characters strong

    How to generate an ASP page a password hard on 8 characters (a, A, 0)


    Source Code

    <%
    gen_password function ()
    word = ""
    er = 0

    for cpt = 1 to 8
    do while st <> 1

    randomize
    int x = ((122 - 48 +1) * Rnd + 48) '--- product of the integers between 48 and 122

    if x> 57 and x <65 then '--- test interval ds figure if unwanted
    er = 0
    else if x> 90 and x <97 then '--- test interval ds figure if unwanted
    er = 0
    else st = 1 '--- not figure unwanted interval ds
    end if
    end if
    loop

    y = chr (x) '--- convert a digit character
    word = word & y '--- create character concatenation
    er = 0
    next

    gen_password word = '--- returns the word password

    end function
    %>

Similar Threads

  1. Replies: 7
    Last Post: 31-07-2011, 10:55 PM
  2. How strong do i need to make my Windows password ?
    By $kRITIKa$ in forum Operating Systems
    Replies: 4
    Last Post: 23-05-2011, 04:19 PM
  3. Implementing strong password on internet
    By Virgilio in forum Networking & Security
    Replies: 6
    Last Post: 20-02-2010, 01:57 PM
  4. How to generate static html page with PHP?
    By Novino in forum Software Development
    Replies: 3
    Last Post: 21-07-2009, 09:33 PM
  5. How to create and use strong Password
    By James Afflek in forum Guides & Tutorials
    Replies: 4
    Last Post: 13-01-2009, 12:51 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,161,760.95100 seconds with 17 queries