passwd encryption
From: Veera Prasad (VPrasad_at_OLF.COM)
Date: 12/30/04
- Next message: Taylor Lewick: "RE: passwd encryption"
- Previous message: Ron Reidy: "DBD::Oracle::db ora_lob_write failed"
- Next in thread: Taylor Lewick: "RE: passwd encryption"
- Maybe reply: Taylor Lewick: "RE: passwd encryption"
- Maybe reply: Veera Prasad: "RE: passwd encryption"
- Reply: Tim Bunce: "Re: passwd encryption"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
To: "'dbi-users@perl.org'" <dbi-users@perl.org> Date: Thu, 30 Dec 2004 11:29:51 -0500
Hi Guys,
I 've used below code to encrypt password using perl module (library) called
'Crypt::PasswdMD5"
and saved it to a file. e.g. "vprasad:$1$121154.6$CeoM.iep2C7nx0ePmUaW10".
use Crypt::PasswdMD5;
$password = 'CrapWork69'; #$ARGV[0];
$salt = rand(999999);
$cryptpasswd = unix_md5_crypt($password, $salt);
And I am using below code to validate the password, but no luck...
use Crypt::PasswdMD5;
$password = 'CrapWork69'; #$ARGV[0];
open (FILE,"<passwd.file") or die "Couldn't open file $!\n";
while ($line = <FILE>) {
chomp ($line);
($user,$cpasswd)=split (":",$line);
}
print "user: $user passwd: $cpasswd\n";
@paarts = split('$', $cpasswd);
$test_crypt = unix_md5_crypt($password, $paarts[2]);
if ($test_crypt eq $cpasswd) {
print "Password match $test_crypt $cpasswd\n";
} else {
print "Password does not match please try again\n";
}
Not sure where I am wrong because the password is not matching...
Can Anybody help me...Thanks in Advance...
Veera P Nallamilli
Ph no: 516-394-1295
© 2004 OpenLink Financial
Copyright in this message and any attachments remains with us. It is
confidential and may be legally privileged. If this message is not
intended for you it must not be read, copied or used by you or
disclosed to anyone else. Please advise the sender immediately if
you have received this message in error.
Although this message and any attachments are believed to be free of
any virus or other defect that might affect any computer system into
which it is received and opened, it is the responsibility of the
recipient to ensure that it is virus free and no responsibility
is accepted by Open Link Financial, Inc. for any loss or damage in any
way arising from its use.
- Next message: Taylor Lewick: "RE: passwd encryption"
- Previous message: Ron Reidy: "DBD::Oracle::db ora_lob_write failed"
- Next in thread: Taylor Lewick: "RE: passwd encryption"
- Maybe reply: Taylor Lewick: "RE: passwd encryption"
- Maybe reply: Veera Prasad: "RE: passwd encryption"
- Reply: Tim Bunce: "Re: passwd encryption"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|