2011-04-28 43 views
2

中存儲的密碼我有一個表存儲用戶登錄信息,其中包含以下方案中的密碼是否有一個perl模塊來驗證存儲在「{crypt} hashedpassword」「{ssha} hashedpassword」「{md5} hashedpassword」

  • {}隱窩hashedpassword
  • {SSHA} hashedpasswordsalted
  • {} MD5 hashedpassword
  • .....

是療法e一個perl模塊明白這個方案,並能夠驗證密碼給明文密碼?

喜歡的東西

打印 「成功!\ n」 如果validatePassword( 「HelloWorld」 的,{CRYPT} r2sKInajXZ6Fk)

感謝。

回答

6

Authen::Passphrase可以這樣做:

use Authen::Passphrase; 

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