2

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

  • {crypt}hashedpassword
  • {ssha}hashedpasswordsalted
  • {md5}hashedpassword
  • .....

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)

brian d foy
  • 129,424
  • 31
  • 207
  • 592
Syborg78
  • 21
  • 1

1 Answers1

6

Authen::Passphrase can do this:

use Authen::Passphrase;

print "success!!\n" 
  if Authen::Passphrase->from_rfc2307('{CRYPT}r2sKInajXZ6Fk')->match("helloworld");
cjm
  • 61,471
  • 9
  • 126
  • 175