perlquestion
pmme
Hi all <br><br>
I have been using the following script to create passwords for user accounts, and just got my wrists slapped because it is not creating md5 passwords, instead, its just creating plain crypt passwords.<code>
my @chars = ('a'..'z', 'A'..'Z', 0..9);
my $password = do {{
local $_ = join "" => map {$chars [rand @chars]} 1..8;
redo unless /[a-z]/ && /[A-Z]/ && /\d/;
$_;
}};
my $salt = join '',
('.', '/', 0..9,
'A'..'Z', 'a'..'z')[rand 64, rand 64];
my $encrpass = crypt($password, $salt);</code>
I have looked into Digest::MD5, but i am lost on how to use it.<br><br>
Help would be much apprecaited.