#70904 - 2002-10-16 07:29 PM
Creating random Passwords
|
kncowans
Getting the hang of it
Registered: 2000-11-11
Posts: 98
Loc: Doncaster, UK
|
Hello
I am trying to create a script that will create a random password based on the following:
2 Letters followed by 4 digits, i.e. QQ4763.
Preferably the created password should be unique, i.e. the created password should be unique within every 200 created passwords.
Any suggestions how I could achieve this from within KiXtart?
Thanks in advance
Kevin
_________________________
Kevin Cowans
Senior ICT Technician
The Armthorpe School
|
|
Top
|
|
|
|
#70909 - 2002-10-16 11:37 PM
Re: Creating random Passwords
|
NTDOC
Administrator
   
Registered: 2000-07-28
Posts: 11629
Loc: CA
|
And if you want to convert it to KiXtart...
Incrementing an Alpha-Numeric Number http://www.15seconds.com/howto/pg001041.htm
|
|
Top
|
|
|
|
#70911 - 2002-10-18 02:03 AM
Re: Creating random Passwords
|
NTDOC
Administrator
   
Registered: 2000-07-28
Posts: 11629
Loc: CA
|
Howard,
Did you try this one from Bryce?
Windows NT-2000 Strong Random Password Generator
It DOES NOT allow numbers at the front or end of the value (as these are very easy for crackers like lopht to crack). It also only allows characters that can be typed on the keyboard (Dec 0 to Dec 127 of ASCII)
You can select how many passwords you want, and how long they should be as well.
Actually a pretty good algorithm.
Does your code follow a similar pattern constraint?
Here is a sample of the output from the script when set to get 50 passwords of 10 character length.
code:
Pkn}y9n-eG Ja~iwwCC-f u>@Ey6O)2y |uX!|KQMM% %]qV~HS[#a i)He(CUvt# ^zJb#?W0[# Y:_CI<-)Hr (<\BC7a`Iz b>FR\3&@>I b@6SN.pHE] lnvde}R46H QJYDO&d!St sA#.n"p^L\ C7CgSX&'i\ 'fkbB2CD*, &k,q^=x=TL Cxv>7Ip|d} B!$+ZT[j,% CWR6g`B*!] '@WbQ&)XbO ]o8^@wZg'e uX#[B~#UXl LlP\D_#oDO po=[^?#k"U zhz1>X,ThS !yGr,p_w&! #10?&PXT4c b!Ro:1Q4vg L=kYlvs:(? nP;{8g"Kuo S4T>8YXy[f !E.~=J},kG )D9g\6of,. P2K<q'_cKB -AU9udfuT" hLfDrcc25H ,??qv;Uo(# !@4DIf&a@Z z,h=&[SR5n /Y.B?2CzTZ H:4=[{RT6? ip)NmRGsMA B7yx69(-H" H!R.R1kf2e *,x*#8va5z .9.PVSKGxP nJ>tW^Nx^s FB\Y[6Q_;~ ]V5wWiX\./
[ 18. October 2002, 02:04: Message edited by: NTDOC ]
|
|
Top
|
|
|
|
#70913 - 2002-10-18 02:25 AM
Re: Creating random Passwords
|
NTDOC
Administrator
   
Registered: 2000-07-28
Posts: 11629
Loc: CA
|
hmmm... by not using @ # $ % ^ & * () + - | \ = _ ‘ ; . , / ? ] [ } { ~ ` "
That leaves the password NOT as secure as it could be. Allows a much smaller subset of values to crack.
I'm sure Bryce might be able to modify it "fairly" easily to disallow those characters (not sure, as Bryce wrote it, not me.)
Then remove the no "double" requirement and you have what you're looking for, or your AS400 folks are looking for. ![[Eek!]](images/icons/shocked.gif) [ 18. October 2002, 02:27: Message edited by: NTDOC ]
|
|
Top
|
|
|
|
#70914 - 2002-10-18 02:27 AM
Re: Creating random Passwords
|
Howard Bullock
KiX Supporter
   
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
NTDOC, I use: 'A'..'H', 'K', 'M', 'N', 'P'..'R', 'T'..'Y', '!', '@', '#', '$', '%', '&', '*', 2..9, 'a'..'h', 'k', 'm', 'n', 'p'..'z'
Certain troublesome items like "O" and "0", "1" and "l" have been left out so that user confusion can be minimized.
The password length is specified as a parameter to the DLL function. If the length is 4 or greater then the password must be composed of at least 3 of the 4 character classes.
This should be sufficient for most applications. [ 18. October 2002, 02:28: Message edited by: Howard Bullock ]
|
|
Top
|
|
|
|
#70918 - 2002-10-18 02:34 AM
Re: Creating random Passwords
|
Howard Bullock
KiX Supporter
   
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
We have turned on strong passwords on our W2K infrastructure. No problems. We just told them that it was stronger security in the new Microsoft operating system.
|
|
Top
|
|
|
|
#70921 - 2002-10-18 03:01 AM
Re: Creating random Passwords
|
Howard Bullock
KiX Supporter
   
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
I also have code that generates passwords like Compuserve used to give out.
Car@dog1 cat!jet9 etc...
This code has an internal word file which can be superceded by an externally defined word file.
I was considering adding this to the GenRandomPW function of Win32Admin.DLL and permitting the user to specify the type of password desired.
|
|
Top
|
|
|
|
#70923 - 2002-10-18 07:26 PM
Re: Creating random Passwords
|
Howard Bullock
KiX Supporter
   
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
code:
#------------------------------------------------------------------------------------------------------------ # Initialize @word for password generation #------------------------------------------------------------------------------------------------------------ my @words; &InitGenWordPW (\@words);
sub InitGenWordPW (\@words) { # This subroutine populates an array of words from an external file. # The array will be used by &GenWordPW to build an easier to remember PW # This subroutine is called once per program execution to minimize IO. my $WordsArrayRef = shift;
my $wordfile = $RootPath . "\\..\\pwdata\\wordlist.txt"; if (-e $wordfile) { &LogText($LogFile, "Password word list file found."); if (open (WORDFILE, $wordfile)) { local $/; my $text = <WORDFILE>; $text =~ s/\W+/\n/g; @$WordsArrayRef = split /\n/,$text; close INFILE; } else { &LogText($LogFile, "Error opening $wordfile: $^E"); } } else { &LogText($LogFile, "Password word list file NOT found: $wordfile"); } }
sub GenWordPW (\@words) { # This subroutine generates a password that is easier to remember than GenRandomPW. # The format of the password is word1, punctuation, word2, number Ex: cat@dog1 # The subroutine will first attempt to use an array that was populate externally by # &InitGenWordPW. If the array is empty then the subroutine will populate the array using # the words contained within the subroutine definition.
my $WordsArrayRef = shift; my $password; if (scalar @$WordsArrayRef == 0) { &LogText($LogFile, "PW word array not populated. Using default word list."); @$WordsArrayRef = ('bird', 'cat' , 'dog', 'egg', 'pup', 'gas', 'pear', 'kiwi', 'bag', 'cap', 'oil', 'box', 'cup', 'jet', 'car', 'bus', 'zoo'); } my @punc = ('!', '@', '#', '$', '%', '&', '*'); my @num = (2..9);
my $word1 = $$WordsArrayRef [rand (scalar @$WordsArrayRef)]; my $punc = @punc [rand (scalar @punc)]; my $word2 = $$WordsArrayRef [rand (scalar @$WordsArrayRef)]; my $num = @num [rand (scalar @num)];
if (($word1 && $punc && $word2 && $num) and (length($word1 . $punc . $word2 . $num) >= 8)) { $password = "$word1$punc$word2$num"; } else { &LogText($LogFile, "GenWordPW failed to provide an acceptable PW (" . $word1 . $punc . $word2 . $num . ") Generating random PW."); $password = &GenRandomPW(6); } return $password; }
|
|
Top
|
|
|
|
Moderator: Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 671 anonymous users online.
|
|
|