Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 03-04-2009
Member
 
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
Reply With Quote
  #2  
Old 03-04-2009
Member
 
Join Date: Jan 2008
Posts: 1,515
Re: Generate an ASP page a password of 8 characters strong

Generate Random Password Function
Quote:
<%
'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
%>
Reply With Quote
  #3  
Old 03-04-2009
Member
 
Join Date: Dec 2008
Posts: 322
Re: Generate an ASP page a password of 8 characters strong

read this How to create and use strong Password
Reply With Quote
  #4  
Old 03-04-2009
Member
 
Join Date: May 2008
Posts: 2,383
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

Quote:
<%
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
%>
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags:



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Generate an ASP page a password of 8 characters strong"
Thread Thread Starter Forum Replies Last Post
Resident Evil The Mercenaries 3D : Weak Vs. Strong Characters AnbuP Video Games 7 31-07-2011 10:55 PM
How strong do i need to make my Windows password ? $kRITIKa$ Operating Systems 4 23-05-2011 04:19 PM
Implementing strong password on internet Virgilio Networking & Security 6 20-02-2010 01:57 PM
How to generate static html page with PHP? Novino Software Development 3 21-07-2009 09:33 PM
How to create and use strong Password James Afflek Guides & Tutorials 4 13-01-2009 12:51 PM


All times are GMT +5.5. The time now is 05:26 PM.