/* * Function: _encode * Modified for DX_Auth * Original Author: FreakAuth_light 1.1 */ function _encode($password) { $majorsalt = $this->ci->config->item('DX_salt'); // if PHP5 if (function_exists('str_split')) { $_pass = str_split($password); } // if PHP4 else { $_pass = array(); if (is_string($password)) { for ($i = 0; $i < strlen($password); $i++) { array_push($_pass, $password[$i]); } } } // encrypts every single letter of the password foreach ($_pass as $_hashpass) { $majorsalt .= md5($_hashpass); } // encrypts the string combinations of every single encrypted letter // and finally returns the encrypted password return md5($majorsalt); }