crx349 发表于 2014-2-26 11:23:56

UCenter authcode 解密


首先 只要$key正确 Discuz的authcode加密是可逆的

以X31为例 登录成功时
dsetcookie('auth', authcode("{$member['password']}\t{$member['uid']}", 'ENCODE'), $cookietime, 1, true);


此处省略了参数$key 则默认使用$_G['authkey']
function authcode($string, $operation = 'DECODE', $key = '', $expiry = 0) {
      $ckey_length = 4;
      $key = md5($key != '' ? $key : getglobal('authkey'));


$_G['authkey']在哪?source/class/discuz/discuz_application
$this->var['authkey'] = md5($this->var['config']['security']['authkey'].$this->var['cookie']['saltkey']);



如果想在外部解密这个串 写上Discuz里取得的authkey就O了
页: [1]
查看完整版本: UCenter authcode 解密