Probailistic and Game based Security
Encryption. G e n ( 1 n ) → k ; E n c ( k , m ) → c ; D e c ( k , c ) → m ′ Gen(1^n)\rightarrow k;Enc(k,m)\rightarrow c;Dec(k,c)\rightarrow m' Gen(1n)→k;Enc(k,m)→c;Dec(k,c)→m′
Correct.
∀
m
∈
M
,
A
w
i
n
s
i
f
b
′
=
b
\forall m\in \mathcal{M},\mathcal{A} \;\mathrm{wins\; if\;} b'=b
∀m∈M,Awinsifb′=b
P
r
[
k
←
G
e
n
(
1
n
)
;
E
n
c
(
k
,
m
)
→
c
;
D
e
c
(
k
,
c
)
→
m
′
:
m
=
m
′
]
=
1
Pr[k\leftarrow Gen(1^n);Enc(k,m)\rightarrow c;Dec(k,c)\rightarrow m':m=m']=1
Pr[k←Gen(1n);Enc(k,m)→c;Dec(k,c)→m′:m=m′]=1
Security.
∀
P
P
T
A
,
∃
n
e
g
(
n
)
\forall PPT\; \mathcal{A},\exists\; neg(n)
∀PPTA,∃neg(n)
P
r
[
G
e
n
(
1
n
)
→
k
;
A
(
1
n
)
→
m
0
,
m
1
,
s
t
;
b
←
{
0
,
1
}
;
E
n
c
(
k
,
m
b
)
→
c
;
A
(
s
t
,
c
)
→
b
′
;
b
=
b
]
=
1
2
+
n
e
g
(
n
)
Pr[Gen(1^n)\rightarrow k;\mathcal{A}(1^n)\rightarrow m_0,m_1,st;b\leftarrow \{0,1\};Enc(k,m_b)\rightarrow c;\mathcal{A}(st,c)\rightarrow b';b=b]=\frac{1}{2}+neg(n)
Pr[Gen(1n)→k;A(1n)→m0,m1,st;b←{0,1};Enc(k,mb)→c;A(st,c)→b′;b=b]=21+neg(n)
Reduction Proofs- What are they?
Theorem. Y s e c u r e ⇒ X s e c u r e \mathrm{Y \;secure} \Rightarrow \mathrm{X\; secure} Ysecure⇒Xsecure
Proof. X n o t s e c u r e → Y n o t s e c u r e \mathrm{X\; not\; secure} \rightarrow \mathrm{Y\; not\; secure} Xnotsecure→Ynotsecure
如果
∃
P
P
T
A
\exists \mathrm{PPT}\; \mathcal{A}
∃PPTA 能够攻破
X
\mathrm{X}
X, 那我们可以构造
P
P
T
B
\mathrm{PPT}\; \mathcal{B}
PPTB 能够攻破
Y
\mathrm{Y}
Y,即:
∃
P
P
T
B
b
r
e
a
k
s
Y
⇒
∄
P
P
T
A
b
r
e
a
k
s
X
\exists \;\mathrm{PPT}\; \mathcal{B}\; \mathrm{breaks\; Y}\Rightarrow \nexists \;\mathrm{PPT}\; \mathcal{A} \;\mathrm{breaks}\; \mathrm{X}
∃PPTBbreaksY⇒∄PPTAbreaksX
归约的三条规则:
- PPT. 归约中构造 B \mathcal{B} B 是 PPT;
- Simulation. 对 A \mathcal{A} A 而言, B \mathcal{B} B 构造 X 方案的模拟者跟真实的挑战者一样, A \mathcal{A} A 不可区分;
- Probability. IF A \mathcal{A} A has non-neg advantage break X ⇒ \Rightarrow ⇒ B \mathcal{B} B has non-neg advantage break Y,那么就可以说明方案 X 是安全的。
Reduction Proof Example - PRF Family
Theorem. 如果 F F F 是一个安全的 PRF (Pseudorandom Function) 家族,那么 Z Z Z 是一个安全的 PRF 家族。其中 Z k ( x ) Z_k(x) Zk(x) 定义为:if x = k x=k x=k, return 0 0 0; else, return F k ( x ) F_k(x) Fk(x)。
Proof. 如果存在一个 PPT 敌手 A \mathcal{A} A, A \mathcal{A} A 可以以不可忽略的优势区分 Z k Z_k Zk 和一个随机函数,那么我可以构造一个 PPT 敌手 B \mathcal{B} B, B \mathcal{B} B 能够以不可忽略的优势区分 F k F_k Fk 和一个随机函数。
如果 A \mathcal{A} A 能够区分 y y y 是 Random 或 Pseudorandom,那么就可以区分 y ′ y' y′ 是 Random 或 Pseudorandom。
我们之前说明的要证明三个要素成立:
- PPT. 我们要使得敌手
B
\mathcal{B}
B 的算法是 PPT,假设
A
\mathcal{A}
A 询问
p
(
n
)
p(n)
p(n) 次询问以获取一个多项式
P
P
P,那么
B
\mathcal{B}
B 也向其自己的挑战者发起
p
(
n
)
p(n)
p(n) 次询问。那么
B
\mathcal{B}
B 的运行时间 =
p
(
n
)
p(n)
p(n) 个询问时间 +
A
\mathcal{A}
A 的运行时间:
p ( n ) × O ( 1 ) + q ( n ) ( A ′ s r u n n i n g t i m e i s P P T ) + p ( n ) + 2 ( s e c u r i t y p a r a m e t e r s a n d o u t p u t ) = p o l y ( n ) p(n)\times O(1)+q(n)(\mathrm{A's\; running\; time\; is\; PPT})+p(n)+2(\mathrm{security\; parameters\; and \;output})=poly(n) p(n)×O(1)+q(n)(A′srunningtimeisPPT)+p(n)+2(securityparametersandoutput)=poly(n) - Indistinguishable. 对于所有的真实挑战者来说,只有在
A
\mathcal{A}
A 询问
x
=
k
x=k
x=k 时,引起了差异,因为
Z
k
(
x
)
=
0
Z_k(x)=0
Zk(x)=0,而
B
\mathcal{B}
B 会返回
F
k
(
x
)
F_k(x)
Fk(x),但这个情况的概率是可忽略的:
∀ x ≠ k , B c o m p u t e s Z k ( x ) = F k ( x ) . F o r a r a n d o m k e y k , P r [ A q u e r i e s x = k ] = P ( n ) ∣ k ∣ = n e g ( n ) \forall x\ne k,B\; \mathrm{computes}\; Z_k(x)=F_k(x) .\; \mathrm{For\; a\; random\; key\;} k,\; Pr[A\; \mathrm{queries}\; x=k]=\frac{P(n)}{|k|}=neg(n) ∀x=k,BcomputesZk(x)=Fk(x).Forarandomkeyk,Pr[Aqueriesx=k]=∣k∣P(n)=neg(n) - Success Probability. P r [ B d i s t i n g u i s h e s ] = P r [ A d i s t i n g u i s h e s ] = ϵ ( n ) = n o n − n e g ( n ) Pr[\mathcal{B}\mathrm{\; distinguishes}]=Pr[\mathcal{A}\mathrm{ \;distinguishes}]=\epsilon(n)=non-neg(n) Pr[Bdistinguishes]=Pr[Adistinguishes]=ϵ(n)=non−neg(n)(这里的 non-neg 是我们的假设,假设 A , B \mathcal{A,B} A,B 能够以不可忽略的优势区分 F k , Z k F_k,Z_k Fk,Zk 函数与一个随机数函数的区别)
Random Oracle Model
随机预言机是一个映射函数,该函数要求如果有相同的输入,必须返回相同的输出。
Random Oracle: D → R D\rightarrow R D→R
我们可以将随机预言机视为查找表 (Lookup Table)
且随机预言机的算法是:
我们可以结合随机预言机来构造归约证明:
Thm.
π
1
⇒
R
O
π
2
\pi_1 \Rightarrow_{RO} \pi_2
π1⇒ROπ2
Proof.
¬
π
2
⇒
R
O
¬
π
1
\neg \pi_2 \Rightarrow_{RO} \neg \pi_1
¬π2⇒RO¬π1
要求:构造 ROM 的算法必须是多项式时间和多项式空间
RSA Encryption ROM Proof
G
e
n
(
1
n
)
:
p
,
q
→
p
r
i
m
e
(
l
e
n
g
t
h
=
n
)
;
N
=
p
⋅
q
;
ϕ
(
n
)
=
(
p
−
1
)
(
q
−
1
)
;
e
⋅
d
=
1
m
o
d
(
p
−
1
)
(
q
−
1
)
;
s
k
=
(
N
,
d
)
,
p
k
=
(
N
,
e
)
\mathrm{Gen}(1^n): p,q\rightarrow \mathrm{prime(length=n)}; N=p\cdot q; \phi(n)=(p-1)(q-1); e\cdot d=1 \mathrm{mod}\; (p-1)(q-1);sk=(N,d),pk=(N,e)
Gen(1n):p,q→prime(length=n);N=p⋅q;ϕ(n)=(p−1)(q−1);e⋅d=1mod(p−1)(q−1);sk=(N,d),pk=(N,e)
E
n
c
(
p
k
,
m
)
→
c
:
r
←
Z
N
∗
;
c
1
=
r
e
m
o
d
N
;
y
=
R
O
(
r
)
;
c
2
=
y
⊕
m
\mathrm{Enc}(pk,m)\rightarrow c: r\leftarrow Z_N^*;c_1=r^e \mathrm{mod}\; N;y=\mathrm{RO}(r);c_2=y\oplus m
Enc(pk,m)→c:r←ZN∗;c1=remodN;y=RO(r);c2=y⊕m
D e c ( s k , c ) → m : r = c 1 d m o d N = ( r e ) d = r e d m o d N ; y = R O ( r ) ; m = c 2 ⊕ y \mathrm{Dec}(sk,c)\rightarrow m: r=c_1^d \mathrm{mod}\; N=(r^e)^d=r^{ed} \mathrm{mod}\; N; y=\mathrm{RO}(r); m=c_2 \oplus y Dec(sk,c)→m:r=c1dmodN=(re)d=redmodN;y=RO(r);m=c2⊕y
C
o
r
r
e
c
t
n
e
s
s
:
e
d
=
k
ϕ
(
N
)
+
1
;
e
d
=
1
m
o
d
ϕ
(
n
)
;
r
e
d
m
o
d
N
→
r
k
ϕ
(
N
)
⋅
r
m
o
d
N
=
r
\mathrm{Correctness}:ed=k\phi(N)+1; ed=1 \mathrm{mod}\; \phi(n); r^{ed} \mathrm{mod}\; N\rightarrow r^{k\phi(N)}\cdot r \mathrm{mod}\; N=r
Correctness:ed=kϕ(N)+1;ed=1modϕ(n);redmodN→rkϕ(N)⋅rmodN=r
R
S
A
A
s
s
u
m
p
t
i
o
n
:
∀
P
P
T
A
,
∃
n
e
g
(
n
)
,
P
r
[
G
e
n
(
1
n
)
→
N
,
e
,
d
;
x
←
Z
N
∗
:
A
(
1
n
,
N
,
e
,
x
e
)
→
x
]
=
n
e
g
(
n
)
\mathrm{RSA\; Assumption}: \forall\; \mathrm{PPT} \mathcal{A}, \exists \mathrm{neg}(n),\; \mathrm{Pr}[\mathrm{Gen}(1^n)\rightarrow N,e,d;x\leftarrow Z_N^*: \mathcal{A}(1^n,N,e,x^e)\rightarrow x]=\mathrm{neg}(n)
RSAAssumption:∀PPTA,∃neg(n),Pr[Gen(1n)→N,e,d;x←ZN∗:A(1n,N,e,xe)→x]=neg(n)
Theorem.
R
S
A
A
s
s
u
m
p
t
i
o
n
S
e
c
u
r
e
⇒
R
O
π
i
s
C
P
A
\mathrm{RSA\; Assumption \; Secure\Rightarrow_{RO} \pi \; is \; CPA}
RSAAssumptionSecure⇒ROπisCPA
Proof.
A
b
r
e
a
k
s
π
⇒
R
O
B
b
r
e
a
k
s
R
S
A
A
s
s
u
m
p
t
i
o
n
\mathrm{\mathcal{A}\; breaks\; \pi\Rightarrow_{RO} \mathcal{B}\; breaks\; RSA \;Assumption}
Abreaksπ⇒ROBbreaksRSAAssumption
归约构造会出现两种情况:
- z : z e = x e m o d N , T h e n : A b r e a k s π , B b r e a k s R S A A s s u m p t i o n . z: z^e =x^e \mathrm{mod}\; N,\mathrm{Then: \mathcal{A}\; breaks\; \pi ,\;\mathcal{B}\; breaks\; RSA\; Assumption}. z:ze=xemodN,Then:Abreaksπ,BbreaksRSAAssumption.
- A n e v e r q u e r y z = z e = x e m o d N . T h e n : R S A A s s u m p t i o n S e c u r e ⇒ R O π i s C P A \mathcal{A}\; \mathrm{never \;query}\; z=z^e=x^e \;\mathrm{mod}\; N.\mathrm{Then: RSA\; Assumption \; Secure\Rightarrow_{RO} \pi \; is \; CPA} Aneverqueryz=ze=xemodN.Then:RSAAssumptionSecure⇒ROπisCPA
A \mathcal{A} A 只输出了一个 bit b ′ b' b′,那么 B \mathcal{B} B 如何才能输出 x x x 呢( B \mathcal{B} B 是不知道 x x x 的),如果 b ′ = b b'=b b′=b,那么意味着 A \mathcal{A} A 选择的是正确的 m b m_b mb,那么 y = c 2 ⊕ m b y=c_2 \oplus m_b y=c2⊕mb,可以在 ROM 的 Lookup Table 中查询对应的 z z z, z z z 也就是正确的 x x x。