summaryrefslogtreecommitdiff
path: root/inc/PassHash.class.php
diff options
context:
space:
mode:
Diffstat (limited to 'inc/PassHash.class.php')
-rw-r--r--inc/PassHash.class.php15
1 files changed, 15 insertions, 0 deletions
diff --git a/inc/PassHash.class.php b/inc/PassHash.class.php
index 31493c022..c13cf4a54 100644
--- a/inc/PassHash.class.php
+++ b/inc/PassHash.class.php
@@ -50,6 +50,9 @@ class PassHash {
}elseif(substr($hash,0,6) == '{SSHA}'){
$method = 'ssha';
$salt = substr(base64_decode(substr($hash, 6)),20);
+ }elseif(substr($hash,0,6) == '{SMD5}'){
+ $method = 'smd6';
+ $salt = substr(base64_decode(substr($hash, 6)),16);
}elseif($len == 32){
$method = 'md5';
}elseif($len == 40){
@@ -130,6 +133,18 @@ class PassHash {
}
}
+
+ /**
+ * Password hashing method 'smd6'
+ *
+ * Uses salted MD5 hashs. Salt is 8 bytes long. Yes, really 8 bytes...
+ */
+ public function hash_smd6($clear, $salt=null){
+ $this->init_salt($salt,8);
+ return "{SMD5}".base64_encode(md5($clear.$salt, true).$salt);
+ }
+
+
/**
* Password hashing method 'apr1'
*