归约的概念

The Idea of Reduction.

For problem AA and BB, if there exists a computable function ff that for all instance x∈Ax\in A, A(x)=B(f(x))A(x)=B(f(x)), we say that AA could reduce to BB.

Reduction (or simulation) is a powerful idea in computer science. Especially in cryptography, we use the idea of reduction to prove security of some cryptographic primitives.

We will illustrate the idea of reduction with a concrete example.

Example: Pseudo One-time Pad

Pseudo OTP:

Pseudo OTP solves OTP's drawback that secret key kk needs to be as long as message mm.

For m∈{0,1}nm\in \{0,1\}^n, we expand a short key kk to the length nn with PRG: r:=G(k)r:=G(k). Pseudo OTP encrypts as c:=m⊕G(k)c:=m\oplus G(k).

Try to prove: Pseudo OTP Π\Pi is EAV-secure if GG is a PRG.

We reduce "Pseudo OTP Π\Pi is EAV-secure" to "GG is a PRG".

Construct a distinguisher DD for GG given A\mathscr{A} attacking Π\Pi as its subroutine.

  • DD runs A(1n)\mathscr{A}(1^n).
  • A\mathscr{A} outputs m0,m1m_0,m_1.
  • DD generates a random bit b∈{0,1}b\in\{0,1\} and obtain rr from PRG challenger.
  • DD sends mb⊕rm_b\oplus r back to A\mathscr{A}.
  • A\mathscr{A} finally outputs b′b'.
  • If b′=bb'=b, DD outputs 11, otherwise 00.
reduction flowchart
reduction flowchart

Considering the following 2 cases:

  • r←Unr\leftarrow U_{n} is truly random

    In this case, the view of A\mathscr{A} is distributed identically to that of a true OTP protocol Π~\widetilde{\Pi} which obeys perfect secrecy, therefore Pr⁡r←Un[D(r)=1]=Pr⁡[b=b′]=Pr⁡[PrivKA,Π~eav(n)=1]=12\Pr_{r\leftarrow U_{n}}[D(r)=1]=\Pr[b=b']=\Pr[\mathtt{PrivK}^{eav}_{\mathscr{A}, \widetilde{\Pi}}(n)=1]=\frac{1}{2}.

  • r:=G(s)r:=G(s) for some ss (rr is pseudorandom)

    In this case, the view of A\mathscr{A} when run as a subroutine of DD is that of the adversarial indistinguishability experiment of the Pseudo OTP Π\Pi, therefore Pr⁡s←Um[D(G(s))=1]=Pr⁡[b=b′]=Pr⁡[PrivKA,Πeav(n)=1]\Pr_{s\leftarrow U_m}[D(G(s))=1]=\Pr[b=b']=\Pr[\mathtt{PrivK}^{eav}_{\mathscr{A}, \Pi}(n)=1].

Reduction process:

Since GG is PRG: ∣Pr⁡r←Un[D(r)=1]−Pr⁡s←Um[D(G(s))=1]∣≤ε(n)|\Pr_{r\leftarrow U_{n}}[D(r)=1]-\Pr_{s\leftarrow U_m}[D(G(s))=1]|\leq \varepsilon(n).

From the 2 equality above: ∣Pr⁡[PrivKA,Πeav(n)=1]−Pr⁡[PrivKA,Π~eav(n)=1]∣≤ε(n)|\Pr[\mathtt{PrivK}^{eav}_{\mathscr{A}, \Pi}(n)=1]-\Pr[\mathtt{PrivK}^{eav}_{\mathscr{A}, \widetilde{\Pi}}(n)=1]|\leq \varepsilon(n).

Therefore Pr⁡[PrivKA,Πeav(n)=1]≤ε(n)+12\Pr[\mathtt{PrivK}^{eav}_{\mathscr{A}, \Pi}(n)=1]\leq \varepsilon(n)+\frac{1}{2}, which indicates that pseudo OTP is EAV-secure.

Reduction Logic

Reduction provides an abstraction.

Understand the abstraction is the key to understand reduction.

If we want to reduce the security of Π′\Pi' to the security of Π\Pi, we need to construct an adversary S\mathscr{S} for Π\Pi given the adversary A\mathscr{A} for Π′\Pi' as its subroutine, which is to say, S\mathscr{S} employs (runs) A\mathscr{A} as a black box abstraction function (Encapsulation).

The reduction involves 4 logic statements:

  • p:p: ∃ S\exists\ \mathscr{S} that is able to attack Π\Pi with non-negligible advantage.
  • q:q: ∃ A\exists \ \mathscr{A} that is able to attack Π′\Pi' with non-negligible advantage.
  • ¬p:\lnot p: Π\Pi is secure, which means S\mathscr{S} that could successfully attack Π\Pi is NOT exist.
  • ¬q:\lnot q: Π′\Pi' is secure, which means A\mathscr{A} that could successfully attack Π′\Pi' is NOT exist.

If S\mathscr{S} is constructed successfully, it will be able to attack Π\Pi with non-negligible advantage. Therefore we could conclude that if A\mathscr{A} could attack Π′\Pi' successfully, S\mathscr{S} (which takes A\mathscr{A} as its subroutine) could attack Π\Pi. The corresponding logic is q→pq\to p.

According to the contrapositive statement, we have ¬p→¬q\lnot p\to \lnot q, which implys that the security of Π\Pi guarantees the security of Π′\Pi'. Therefore, the reduction is completed: we reduce the security of Π′\Pi' to the security of Π\Pi.

Contrapositive argument:

The contrapositive of the conditional statement "If pp then qq. " is "If not qq then not pp".

The logical equivalence could be expressed by p→q  ⟺  ¬q→¬pp\to q \iff \lnot q\to \lnot p.

Eureka moment!

归约应该是整个密码学安全性证明中的核心思想之一。

第一次接触归约时 (即上文中提到的对伪一次性密码本安全性的证明) 真的思考了超级久才把整个逻辑捋清。但一旦想明白了就会觉得实在是巧妙:假设攻击方案 AA 的敌手存在,我们直接将该敌手封装 (encapsulate) 起来作为攻击已知安全的方案 BB 的敌手的子程序 (subroutine)。如果构建成功,根据逆否命题就能完成归约。

归约证明最难的地方应该在于 simulator S\mathscr{S} 的设计:其与子程序 A\mathscr{A} 的交互必须是黑盒式的,且无法让 A\mathscr{A} 察觉到与其互动的并不是 challenger C\mathscr{C},而是某个 simulator S\mathscr{S}。

在整个课程的学习中了解到了很多很妙的归约,例如 Pseudorandom function/permutation 构建的加密方案的 CPA 安全性证明,Hash-MAC 与 Hash-Sign 方案的安全性证明,Authenticate encryption 的安全性证明,RSA 硬核谓词 (Hard-core predicates) 的证明,RSA-FDH (Full-Domain Hash) signature 的不可伪造性证明,Fiat-Shamir transformation 的证明,Schnorr identification 的安全性证明……

光是写出来就有一大串,就不具体介绍了 (我有一个绝妙的证明.jpg)