首先 只要$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了 
Discuz的代码可读性还是很好的 so 下次提问前先读一下吧   |