Thursday, 21 May 2009

Another Password Generator

So I wrote a password generator, why not?!

I had some free time recently, I was about to reset someone's password for a site I administer, and I thought it would be nice to have a small script generate semi easy to remember but semi secure passwords.

Firstly, I usually use either of these two one liners:
$ for ((n=0;n<10;n++)); if="/dev/urandom" count="1"> /dev/null | uuencode -m -| head -n 2 | tail -n 1 | cut -c-8; done

$ for ((n=0;n<10;n++)); if="/dev/urandom" count="1" bs="8">/dev/null | uuencode -m - | tail -n 2 | head -n 1 | cut -c -8; done


The results are similar. You get a bunch of passwords looking like this:
zZqTqB23
Fh0qKx05
skhDDXPN
GmToF0H0
yWieCLfu
6lmrPOm5
Tq+Tz/G/
ybYWDvXp
u018CGWA
9FyV1zJq

Which is handy for setting up lots of accounts, which I do occasionally. However, people hate them because 9FyV1zJq is harder to remember than their cat's name.

The script I just wrote (in Perl) uses word lists and random numbers to generate passwords like this:
kagu757elf
matt37spif
hiss378gyro
err410eyed
zest957pirn
twin452road
czar210mum
mors720cops
floc684wok
odor384hymn


Sure, these aren't as secure, but they're better than "tiggles".

Oh, and my wordlists come from wordlist.sourceforge.net

#!/usr/bin/perl -w

# A utility to create reasonable strength and semi-easy to remember passwords
# out of word lists and random characters.
#
# Copyright 2009 Iain Buchanan. Freely redistributable and modifiable.

use strict;

my @lists = ('/home/iain/personal/ispell-enwl-3.1.20/altamer.0',
'/home/iain/personal/ispell-enwl-3.1.20/altamer.1',
'/home/iain/personal/ispell-enwl-3.1.20/altamer.2',
'/home/iain/personal/ispell-enwl-3.1.20/american.0',
'/home/iain/personal/ispell-enwl-3.1.20/american.1',
'/home/iain/personal/ispell-enwl-3.1.20/american.2',
'/home/iain/personal/ispell-enwl-3.1.20/british.0',
'/home/iain/personal/ispell-enwl-3.1.20/british.1',
'/home/iain/personal/ispell-enwl-3.1.20/british.2',
'/home/iain/personal/ispell-enwl-3.1.20/english.0',
'/home/iain/personal/ispell-enwl-3.1.20/english.1',
'/home/iain/personal/ispell-enwl-3.1.20/english.2',
'/home/iain/personal/ispell-enwl-3.1.20/english.3');

my @wordlist;

foreach my $list (@lists) {
open (WL, "$list") or print "Couldn't open wordlist '$list': '$!', skipping.\n";

while () {
chomp;

next if (length >= 5); # ignore long words
next if /^[A-Z]/; # ignore Nouns & abbvs.

push @wordlist, $_;
}
close (WL);
}

for (1..10) {
print $wordlist[int (rand ($#wordlist))];
print int (rand (999));
print $wordlist[int (rand ($#wordlist))];
print "\n";
}

Tuesday, 12 May 2009

The results are in: It's Apathy by a landslide!

Thanks to everyone who took part in my recent poll "What would you like me to post more about?" That is, all 6 of you, including myself. The results are as follows:


























































Votes%Post
3(50%)IT related technical articles
3 (50%)
Linux howto's, tips & tricks
3 (50%)Renewable energy power station bio's
2 (33%)Reviews of my electronics (phone, set top box, espresso machine, etc)
2 (33%)Random thoughts & musings on anything
1 (16%)Personal & Family events
0 (0%)Dell Precision M6300 howto's for running Linux
0 (0%)I can't stand reading anything you write!



There were 6 unique voters, including myself. The poll ran for most of April, 2009. Voters could select multiple entries.

Conclusions

So what? Well, there were nowhere near enough votes for me to make any drastic changes. Most of my visits are for the ever-popular Vmware keyboard page. I can safely say that the results can be completely ignored!

If you don't agree, comment!
 
Copyright 2009 Another Blog. Powered by Blogger Blogger Templates create by Deluxe Templates. WP by Masterplan