Introduction to Modern Cryptography Reading Notes
5 CCA-Security and Authenticated Encryption
这一章讨论的是如何保证 “secrecy in the presence of an active adversary”。
选择密文攻击和 CCA 安全
攻击者生成一段密文并使接收者对其进行解密,这样的攻击行为称为选择密文攻击(chosen-ciphertext attack)。
Padding-Oracle Attacks
对于使用 PKSC #7 标准(如果消息需要填充 \(b\) 个 byte,则在消息后填充 \(0\text{x}\overbrace{bb...b}^{b\text{ times}}\),其中 \(b>0\)) 的 CBC-mode 加密,如果接收者收到了一个不符合 PKSC #7 标准的消息,则会发出一个 “bad padding” 错误,如果攻击者能探知这个信息,就可以进行攻击。
比如,对于有两个 block 的 CBC,\(m_2=c_1\oplus F^{-1}_k(c_2)\),那么通过发送 \((c_1\oplus\Delta,c_2)\),解密后会得到 \((m_1',m_2\oplus \Delta)\),那么通过枚举 \(\Delta\) 的每一个 byte,可以破解出 \(b\) 的值,然后可以用类似的方式破解出 \(m_2\), \(m_1\) 的值。
下面定义 CCA-secure
The CCA indistinguishability experiment \(\text{PrivK}^{\text{cca}}_{\mathcal{A},\Pi(n)}\):
- A key \(k\) is generated by running \(\text{Gen}(1^n)\).
- \(\mathcal{A}\) is given input \(1^n\) and oracle access to \(\text{Enc}_k(\cdot)\) and \(\text{Dec}_k(\cdot)\).It outputs a pair of equal-length messages \(m_0, m_1\).
- A uniform bit \(b \in \{0, 1\}\) is chosen, and then a challenge ciphertext \(c \leftarrow \text{Enc}_k(m_b)\) is computed and given to \(\mathcal{A}\).
- The adversary \(\mathcal{A}\) continues to have oracle access to \(\text{Enc}_k(\cdot)\) and \(\text{Dec}_k(\cdot)\), but is not allowed to query the latter on the challenge ciphertext itself. Eventually, \(\mathcal{A}\) outputs a bit \(b'\).
- The output of the experiment is \(1\) if \(b' = b\), and \(0\) otherwise.If the output of the experiment is \(1\), we say that \(\mathcal{A}\) succeeds.