Security Basics mailing list archives

Re: Password creating Theories


From: Justin <justinvinn () gmail com>
Date: Tue, 15 Nov 2005 17:04:13 -0500

Jennifer,

The following is the script that I use to generate random passwords. I
didn't write it, but it is quite useful:

#!/usr/bin/perl
# rand-pass.pl
use strict;
use warnings;

# All printable ascii characters
my @chars = (32..126);
my $num_chars = @chars;

# Passwords must be 50 chars long, unless specified otherwise
my $length=$ARGV[0] || 50;

while (1) {
        my $password;
        foreach (1..$length) {
                $password .= chr($chars[int(rand($num_chars))]);
        }

        # Password must have lower, upper, numeric, and 'other'
        if (    $password =~ /[a-z]/
            and $password =~ /[A-Z]/
            and $password =~ /[0-9]/
            and $password =~ /[^a-zA-Z0-9]/ ) {
                print $password, "\n";
                exit;
        }
}

# EOF

It makes good random passwords with a user specified length, or it
deafults to 50 if none is specified.

Hope that helps...

-- Justin

On 11/11/05, Jennifer Fountain <jfountain () rbinc com> wrote:
I am currently coming up with a new policy to create root/admin
passwords for windows and linux boxes and would like to know your
thoughts on the methods you use to create them.  Thanks for any input!


Kind Regards,

Jennifer Fountain
Systems Administrator/Security
R&B Distribution
3400 E Walnut Street
Colmar, PA  18915


*********************************************************************************
The information transmitted is intended only for the person or entity to which
it is addressed and may contain confidential and/or privileged material.  Any
review, retransmission, dissemination or other use of, or taking of any action
in reliance upon, this information by persons or entities other than the intended
recipient is prohibited. If you received this in error, please contact the sender
and delete the material from any computer






Current thread: