Skip to content

Instantly share code, notes, and snippets.

@mschmitt
Created March 22, 2012 14:33
Show Gist options
  • Save mschmitt/2158666 to your computer and use it in GitHub Desktop.
Save mschmitt/2158666 to your computer and use it in GitHub Desktop.
The user hater's password generator. Have a lot of fun!
#!/usr/bin/perl -w
use strict;
use diagnostics;
my @normal_chars = qw(I 1 l 0 O);
my @special_chars = qw(| [ ]);
my $length = 12;
print "The user hater's password generator. Have a lot of fun!\n";
print "-------------------------------------------------------\n";
my $quality_passwords = 0;
while(1){
my $out;
for (my $j = 1; $j <= $length; $j++){
my @chars = @normal_chars;
if (($j > 1) and ($j < $length)){
@chars = (@chars, @special_chars);
}
$out .= $chars[rand(@chars)];
}
if ( ($out =~ /[a-z]/) and ($out =~ /[A-Z]/) and ($out =~ /\d/) and ($out =~ /\W/)){
$quality_passwords++;
printf "%2.2i) %s\n", $quality_passwords, $out;
}
last if ($quality_passwords >= 10);
}
@mschmitt
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment