完善保密性及其松弛

Perfect Secrecy and its Relaxation.

If an encryption scheme is perfectly secure, the ciphertext reveals NO additional information to the adversary about the underlying plaintext, even if the adversary has unbounded computational power.

Perfect secrecy is the strongest definition of security.

Probability Definition

  • Pr⁡[M=m∣C=c]=Pr⁡[M=m]\Pr[M=m|C=c]=\Pr[M=m] for all m,cm, c
  • (perfect indistinguishability) Pr⁡[M=m0∣C=c]=Pr⁡[M=m1∣C=c]\Pr[M=m_0|C=c]=\Pr[M=m_1|C=c] for all m0,m1,cm_0,m_1,c

Adversarial Indistinguishability Experiment

Encryption scheme Π=⟨Gen,Enc,Dec⟩\Pi=\langle Gen, Enc, Dec \rangle, EncEnc takes k,mk, m as input (in currying style EnckEnc_k), DecDec takes k,ck, c as input (in currying style DeckDec_k).

Threat model: adversary A\mathscr{A} with unbounded computational power

  • A\mathscr{A} selects 2 plaintexts m0,m1m_0, m_1.
  • Challenger C\mathscr{C} generates a random bit b∈{0,1}b\in\{0,1\}, and runs Enck(mb)→cEnc_k(m_b)\to c. cc is called the challenge ciphertext and is given back to A\mathscr{A}.
  • A\mathscr{A} finally outputs a bit b′b', indicating that cc corresponds to the plaintext mb′m_{b'}.
  • A\mathscr{A} successes if b′=bb'=b.

Perfect secrecy of Π\Pi indicates that NO adversary could success in the above experiment with probability greater than 12\frac{1}{2}. Pr⁡[PrivKA,Πeav(n)=1]=12\Pr[\mathtt{PrivK}^{eav}_{\mathscr{A}, \Pi}(n)=1]=\frac{1}{2}.

This means that adversary has NO better choice than simply outputting a random guess.

Shannon's Theorem

Shannon points out that an encryption scheme could be perfectly secure only when ∣K∣≥∣M∣|\mathscr{K}|\geq |\mathscr{M}| (K\mathscr{K} is key space, M\mathscr{M} is message space).

One-time pad is a typical perfectly secure scheme: adversary can never derive mm from a given cc if he does not know the secret key kk. In OTP, ∣K∣=∣M∣=2n|\mathscr{K}|=|\mathscr{M}|=2^n.

In real life, perfectly secure encryption scheme has little application value: If 2 parties have the ability to safely transmit a key of the same length as the plaintext, then obviously it is better to transmit the plaintext directly.

Relaxation: Computational Secrecy

The relaxed definition of perfect secrecy is more frequently used in reality:

  • Polynomial probabilisitic time (PPT) adversary (deprived of unbounded computational power)
  • adversary is allowed to success with negligible advantage

It is called asymptotic computational secrecy.

(Non-)Negligible advantage is an asymptotic concept.

ε(n)\varepsilon(n) denotes the negligible probability for a fixed security parameter 1n1^n. For example, the probablistic Pr⁡[PrivKA,Πeav(n)=1]≥12+ε(n)\Pr[\mathtt{PrivK}^{eav}_{\mathscr{A}, \Pi}(n)=1]\geq\frac{1}{2}+\varepsilon(n) indicates that adversary successes in the EAV experiment with non-negligible advantage: Π\Pi is EAV-secure.

Eureka moment!

相信学习过密码学的同学所接触的第一个加密方法都是一次性密码本 One-time pad,这也是最令我惊叹的加密方法之一:其操作是那样的简单优美,只需要将明文和密钥异或起来即可生成密文。

然而,就是这么简单的算法,居然满足完美安全的定义:也就是说,按照 OTP 算法生成的密文 cc,只要我将密钥 kk 彻底销毁,那么全宇宙就没人能够得到其对应的明文 mm. 即使是拥有无穷算力的超高级文明,也无法获取关于 mm 的任何信息,哪怕 11 bit 都不行!

这不禁让我的中二之魂熊熊燃烧……

P.S. 事后我想了想,如果 mm 是有意义的一段文字,那么超高级文明得到 mm 并不会很难。所以超高级文明永远无法得到我随便乱想的一段乱码 mm ! (骄傲)