Better passwords for new users.
|
|
By tneff , Section Code [] Posted on Fri Apr 26, 2002 at 12:00:00 PM PST
|
|
I hacked Scoop to send easier-reading initial passwords to new accounts.
|
One of my pet aversions is to ugly Alphabits passwords generated by mean old software. An example is Scoop which sends you a random startup pw like AeXgdJzo or something. You're almost forced to cut and paste it when you log in, and the first thing you do if you're smart is change it to your own favorite guessable word. I prefer to generate passwords using two legible English words with a punctuation symbol between them, e.g, table-happy .
So I patched Scoop.pm as follows. I have a big file of words 5 letters or less (/usr/share/dict/words5). I have a little utility called 'randlines' that takes a list of lines and spits them out in random order - it's really simple:
use Math::Random qw(random_permutation);
print random_permutation(random_permutation(grep(/^[a-zA-Z0-9]/, <>)));
Now I patched Scoop.pm itself to comment out the old password generation code and substitute mine:
###my $foo = new String::Random;
###$foo->{'A'} = [ 'A'..'Z', 'a'..'z' ];
###my $pass = $foo->randpattern("AAAAAAAA");
my $pass = `/usr/local/bin/randlines /usr/share/dict/words5 | head -2`;
$pass =~ s{\n}{-};
chomp($pass);
I could do it slightly more efficiently by hauling the random selection code into Scoop, but I already had the tool, and user accounts aren't created that often. tmn |
|
Story Views
|
31 Scoop users have viewed this story.
|
|