Syborg78
Syborg78

Reputation: 21

Is there a perl module to validate passwords stored in "{crypt}hashedpassword" "{ssha}hashedpassword" "{md5}hashedpassword"

I have a table which stores user login infomration, which contains passwords in the below scheme:

Is there a Perl module that understands this scheme and is able to validate the password given the plain text password?

Something like

print "success!!\n" if validatePassword("helloworld",{CRYPT}r2sKInajXZ6Fk)

Upvotes: 2

Views: 868

Answers (1)

cjm
cjm

Reputation: 62099

Authen::Passphrase can do this:

use Authen::Passphrase;

print "success!!\n" 
  if Authen::Passphrase->from_rfc2307('{CRYPT}r2sKInajXZ6Fk')->match("helloworld");

Upvotes: 6

Related Questions