예제 #1
0
파일: 17.php 프로젝트: jjc224/Matasano
function valid_padding($key, $enc, $iv)
{
    $plain = decrypt_aes_cbc($key, $enc, $iv);
    $len = strlen($plain);
    $pad = ord($plain[$len - 1]);
    return substr($plain, $len - $pad) == str_repeat(chr($pad), $pad);
}
예제 #2
0
파일: 16.php 프로젝트: jjc224/Matasano
function check_cookie($enc, $key)
{
    return strpos(decrypt_aes_cbc($key, $enc, 'YELLOW SUBMARINE'), ';admin=true;') !== false;
}