select * from wp_options where option_name = 'secret'; ################################################ define('SECRET_KEY',''); # ��������� ���� �������� � �������. ���� ������ ����� ���� ����, ���� ����� ������� #define('SECRET_KEY','put your unique phrase here'); ################################################ $wp_default_secret_key='asdfghj'; # ��������� ����������. �� ��������� �� ������. list($username, $expiration, $hmac) = explode('|', $cookie); $key = wp_hash($username . $expiration); $hash = hash_hmac('md5', $username . $expiration, $key); die(urlencode("$username|9999999999|$hash")); ################################################ function get_option() { global $option_secret; return $option_secret; } function wp_hash($data) { $salt = wp_salt(); if ( function_exists('hash_hmac') ) { return hash_hmac('md5', $data, $salt); } else { return md5($data . $salt); } } function wp_salt() { global $wp_default_secret_key; $secret_key = ''; if ( defined('SECRET_KEY') && ('' != SECRET_KEY) && ( $wp_default_secret_key != SECRET_KEY) ) $secret_key = SECRET_KEY; if ( defined('SECRET_SALT') ) { $salt = SECRET_SALT; } else { $salt = get_option('secret'); if ( empty($salt) ) { $salt = wp_generate_password(); update_option('secret', $salt); } } return $secret_key . $salt; } if ( ! function_exists('hash_hmac') ): function hash_hmac($algo, $data, $key, $raw_output = false) { $packs = array('md5' => 'H32', 'sha1' => 'H40'); if ( !isset($packs[$algo]) ) return false; $pack = $packs[$algo]; if (strlen($key) > 64) $key = pack($pack, $algo($key)); else if (strlen($key) < 64) $key = str_pad($key, 64, chr(0)); $ipad = (substr($key, 0, 64) ^ str_repeat(chr(0x36), 64)); $opad = (substr($key, 0, 64) ^ str_repeat(chr(0x5C), 64)); return $algo($opad . pack($pack, $algo($ipad . $data))); } endif; ?>