joomla password encryption

前端 未结 9 1785
借酒劲吻你
借酒劲吻你 2020-11-27 14:13

I need to access the joomla user table jos_users for login checking from external php script [codeignitor].

joomla storing password like this

         


        
9条回答
  •  [愿得一人]
    2020-11-27 14:41

    From the joomla source file libraries/joomla/crypt/password/simple.php there are multiple ways they get stored, and some do not have a ':' character.

        switch ($type)
        {
            case '$2a$':
            case JCryptPassword::BLOWFISH:
                if (JCrypt::hasStrongPasswordSupport())
                {
                    $type = '$2y$';
                }
                else
                {
                    $type = '$2a$';
                }
    
                $salt = $type . str_pad($this->cost, 2, '0', STR_PAD_LEFT) . '$' . $this->getSalt(22);
    
                return crypt($password, $salt);
    
            case JCryptPassword::MD5:
                $salt = $this->getSalt(12);
    
                $salt = '$1$' . $salt;
    
                return crypt($password, $salt);
    
            case JCryptPassword::JOOMLA:
                $salt = $this->getSalt(32);
    
                return md5($password . $salt) . ':' . $salt;
    
    
        }
    }
    

提交回复
热议问题