Go Back   Computer Forums > General Computing > Programming
Click Here to Login
Join Computer forums Today


Reply
 
Thread Tools Search this Thread Display Modes
 
Old 04-03-2007, 06:55 AM   #1
Site Team
 
root's Avatar
 
Join Date: Mar 2004
Posts: 8,007
Default Password generator

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
__________________

__________________
I didn’t fight my way to the top of the food chain to be a vegetarian…
Im sick of people saying 'dont waste paper'. If trees wanted to live, they'd all carry guns.
"The inherent vice of capitalism is the unequal sharing of blessings; The inherent vice of socialism is the equal sharing of miseries."
root is offline   Reply With Quote
Old 04-03-2007, 01:35 PM   #2
In Runtime
 
Daeva's Avatar
 
Join Date: Dec 2005
Posts: 407
Send a message via AIM to Daeva Send a message via MSN to Daeva Send a message via Yahoo to Daeva
Default Re: Password generator

That is excellent! +1
__________________

__________________
**Official Self-proclaimed glorified excessive (insert additional adjectives here) post editor/modifier.
Edit = Best feature ever
http://www.twitter.com/xDaevax
Daeva is offline   Reply With Quote
Old 04-04-2007, 08:43 AM   #3
Site Team
 
root's Avatar
 
Join Date: Mar 2004
Posts: 8,007
Default Re: Password generator

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"
__________________
I didn’t fight my way to the top of the food chain to be a vegetarian…
Im sick of people saying 'dont waste paper'. If trees wanted to live, they'd all carry guns.
"The inherent vice of capitalism is the unequal sharing of blessings; The inherent vice of socialism is the equal sharing of miseries."
root is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



All times are GMT -5. The time now is 09:57 AM.


Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0