Scoop -- the swiss army chainsaw of content management
Front Page · Everything · News · Code · Help! · Wishlist · Project · Scoop Sites · Dev Notes · Latest CVS changes · Development Activities
Better passwords for new users. New Code
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
< Ads on this site. | Come get your fresh Chron >

Menu
· create account
· faq
· search
· report bugs
· Scoop Administrators Guide
· Scoop Box Exchange

Login
Make a new account
Username:
Password:

Related Links
· Scoop
· More on New Code
· Also by tneff

Story Views
  26 Scoop users have viewed this story.

Display: Sort:
Better passwords for new users. | 0 comments ( topical, 0 hidden)
Display: Sort:

Hosted by ScoopHost.com Powered by Scoop
All trademarks and copyrights on this page are owned by their respective companies. Comments are owned by the Poster. The Rest © 1999 The Management

create account | faq | search