in reply to Creating random passwords for users.
But then, I wouldn't use your snippet, if only for the fact it can generate passwords not longer than 5 characters. Your number of possible salts is also low, 676 instead of the 4096 possibilities most systems allow for.my @words; INIT { open my $wh, "<", "/usr/share/dict/linux.words" or die; @words = grep {6 > length} <$wh>; close $wh or die; } sub select_a_word {lc $words[rand @words]}
Finally, I'd use 'crypt' to generate both sets of passwords, as my system knows whether to use DES or MD5 based on the salt being used. (DES takes a 2 character salt, MD5 an 8 character salt, preceeded with '$1$', and (optionally) followed by a '$', giving 11 or 12 characters to pass into 'crypt'). But not every system will do so.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Creating random passwords for users.
by blue_cowdawg (Monsignor) on Nov 04, 2005 at 13:22 UTC |