From d740c00c65237e8e34630d695b813375690581c9 Mon Sep 17 00:00:00 2001 From: Der-Jan Date: Sat, 19 Dec 2015 12:39:15 +0000 Subject: [PATCH] Added wbblite doublesalted --- plugin.rb | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/plugin.rb b/plugin.rb index 755e11b..724820b 100644 --- a/plugin.rb +++ b/plugin.rb @@ -12,6 +12,7 @@ # for Phorum #{password} md5(pass) # for Wordpress #{password} phpass(8).crypt(pass) # for SMF #{username}:#{password} sha1(user+pass) +# for WBBlite #{salt}:#{hash} sha1(salt+sha1(salt+sha1(pass))) gem 'bcrypt', '3.1.3' @@ -109,7 +110,8 @@ after_initialize do AlternativePassword::check_md5(password, crypted_pass) || AlternativePassword::check_wordpress(password, crypted_pass) || AlternativePassword::check_bcrypt(password, crypted_pass) || - AlternativePassword::check_sha256(password, crypted_pass) + AlternativePassword::check_sha256(password, crypted_pass) || + AlternativePassword::check_wbblite(password, crypted_pass) end def self.check_bcrypt(password, crypted_pass) @@ -150,7 +152,13 @@ after_initialize do sha256 = Digest::SHA256.new sha256.update password crypted_pass == sha256.hexdigest - end + end + + def self.check_wbblite(password, crypted_pass) + salt, hash = crypted_pass.split(':', 2) + sha1 = Digest::SHA1.hexdigest(salt + Digest::SHA1.hexdigest(salt + Digest::SHA1.hexdigest(password))) + hash == sha1 + end end class ::User