When I need to set an initial password for someone at the office, I turn to this simple program:
use strict; use warnings; my @alphabet = ( '0' .. '9', 'a' .. 'z', 'A' .. 'Z' ); my $length = shift @ARGV || 8; my $out = ''; while ( length $out < $length ) { $out .= $alphabet[ rand @alphabet ]; } print "$out\n";
A coworker remarked recently, "you're really not trying to make this easy, are you." Well, no.
This evening I thought about golfing this down to a one liner to make it easier to paste into a chat, and this is what I came up with:
perl -E '@a=("0".."9","A".."Z","a".."z");$o.=$a[rand@a]while 8>length$ +o;say$o'
I don't doubt that this could be improved greatly. Any monk who wants to play along should try to generate passwords of 8–15 characters from an alphabet that includes letters and non-letters (/\w/ and /\W/). The more secure the results, the better.
I'd consider a side discussion of manual password selection methods also to be on topic. My personal favorite is to take the initials of some phrase that I can recall reliably, usually a quote from a movie or a song lyric ("happy birthday to you" would be "hb2U"). At a company I used to work for, we'd set root on all the machines using different parts of a single song. If I was caught without my password list, I could go through the song phrase by phrase and find the password to whatever I was trying to access. That didn't happen much since I had the most commonly used ones memorized in a day or two.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Golfing password creation
by moritz (Cardinal) on Jul 29, 2009 at 06:36 UTC | |
|
Re: Golfing password creation
by jdporter (Paladin) on Jul 29, 2009 at 18:07 UTC | |
|
Re: Golfing password creation
by locked_user sundialsvc4 (Abbot) on Jul 29, 2009 at 03:10 UTC | |
|
Re: Golfing password creation
by GrandFather (Saint) on Jul 29, 2009 at 03:13 UTC | |
|
Re: Golfing password creation
by shmem (Chancellor) on Jul 29, 2009 at 11:06 UTC | |
|
Re: Golfing password creation
by Porculus (Hermit) on Jul 29, 2009 at 21:10 UTC | |
|
Re: Golfing password creation
by fullermd (Vicar) on Jul 30, 2009 at 08:25 UTC | |
|
Re: Golfing password creation
by JavaFan (Canon) on Jul 29, 2009 at 12:00 UTC |