> 1); $key[] = ($tmp[1] << 6) | ($tmp[2] >> 2); $key[] = ($tmp[2] << 5) | ($tmp[3] >> 3); $key[] = ($tmp[3] << 4) | ($tmp[4] >> 4); $key[] = ($tmp[4] << 3) | ($tmp[5] >> 5); $key[] = ($tmp[5] << 2) | ($tmp[6] >> 6); $key[] = $tmp[6] << 1; $is = mcrypt_get_iv_size (MCRYPT_DES, MCRYPT_MODE_ECB); $iv = mcrypt_create_iv ($is, MCRYPT_RAND); $key0 = ''; foreach ($key as $trash => $k) $key0 .= chr($k); $crypt = mcrypt_encrypt (MCRYPT_DES, $key0, 'KGS!@#$%', MCRYPT_MODE_ECB, $iv); return bin2hex ($crypt); } static protected function ntHash ($str) { $str = iconv ('UTF-8', 'UTF-16LE', $str); return strtoupper (hash ('md4', $str)); } } ?>