Password generator

root

Site Team
Staff member
Messages
8,185
Location
UK
Just thought I'd share this little gem with you.

faced with having to create a whole load of new accounts at work we thought it'd be a good idea to download a password generator, I thought it'd be a good idea to make one...

so here it is the 88byte password generator, (in vb script).

I think it's actually impossibly to create one that is smaller, (without restricting the characters...

it only allows characters that you could actually type...

Code:
l=8
while x<l
x=x+1
Randomize()
c=Int((122-49)*Rnd()+48)
p=p&Chr(c)
wend
msgbox p
change the first line l=?? to change the length of the password generated


actually got it down to 77 bytes now.

Code:
while x<8
x=x+1
Randomize()
c=Int(73*Rnd()+48)
p=p&Chr(c)
wend
msgbox p
 
well, I got bored of trying to tell people to open or close triangular brackets, or that the backslash was the one next to the Z key... so here's an improved version.

this time you can set three variables.
the amount of capitol letters, (which are at the beginning)
the amount of lower case letters (which are in the middles)
and the amount of numbers, (which are at the end).

currently it's set to 3, 3, 2 (and this meets the windows secure password demands).

anyway, here it is... (note the foot print is now much bigger!)

Code:
Randomize()
while x<3
x=x+1
c=int(26*rnd()+65)
p=p&" "&Chr(c)
wend
x=0
while x<3
x=x+1
c=int(26*rnd()+97)
p=p&" "&Chr(c)
wend
x=0
while x<2
x=x+1
c=int(10*rnd()+48)
p=p&" "&Chr(c)
wend

msgbox p, VBOKonly, "Password"
 
Back
Top Bottom