Joomla는 사용자가 로그인 할 때 'remember me'상자를 선택하면 로컬 쿠키 안에 암호를 저장합니다. 이 코드는 성공적인 로그인이 이루어질 때 실행됩니다.joomla 쿠키에서 암호를 암호화 해제 할 수 있습니까?
if (!in_array(false, $results, true))
{
// Set the remember me cookie if enabled.
if (isset($options['remember']) && $options['remember'])
{
// Create the encryption key, apply extra hardening using the user agent string.
$privateKey = self::getHash(@$_SERVER['HTTP_USER_AGENT']);
$key = new JCryptKey('simple', $privateKey, $privateKey);
$crypt = new JCrypt(new JCryptCipherSimple, $key);
$rcookie = $crypt->encrypt(serialize($credentials));
$lifetime = time() + 365 * 24 * 60 * 60;
// Use domain and path set in config for cookie if it exists.
$cookie_domain = $this->getCfg('cookie_domain', '');
$cookie_path = $this->getCfg('cookie_path', '/');
setcookie(self::getHash('JLOGIN_REMEMBER'), $rcookie, $lifetime, $cookie_path, $cookie_domain);
}
return true;
}
참고 $ 자격 증명에는 [ 'password'] 키 값이 있으며 로그인 양식의 암호가 포함되어 있습니다. 이렇게 암호화 된 경우 시스템이이를 역전하고 쿠키의 암호 필드를 채우는 2 가지 방법이어야합니다.
내 질문은 어떻게 할 수 있습니다. 진짜 분명 비밀 번호는 사용자 테이블에 저장되지 않지만 MD5는 해시 된 것입니다. 따라서 joomla가 암호를 저장할 수있는이 쿠키에 있어야합니다.
암호는 서버에서 php (플러그인이라고 말한 것처럼)하지만 모든 PHP는 확인합니다. 세션은 암호를 보유하지 않은 데이터베이스에서 작성되지만 기억하도록 선택하면 암호는 양방향으로 암호화 된대로 쿠키에 저장됩니다. 이것은 자동 인증을받을 유일한 시간입니다. – landed