Title: PRPs and PRFs
1PRPs and PRFs
- Abstract ciphers PRPs and PRFs,
- Security models for encryption,
- Analysis of CBC and counter mode
Dan Boneh, Stanford University
2PRPs and PRFs
- Pseudo Random Function (PRF) defined over
(K,X,Y) - F K ? X ? Y
- such that exists efficient algorithm to eval.
F(k,x) - Pseudo Random Permutation (PRP) defined over
(K,X) - E K ? X ? X
- such that 1. Exists efficient algorithm to
eval. E(k,x) - 2. The func E( k, ? ) is one-to-one
- 3. Exists efficient algorithm for inverse
D(k,x)
3Running example
- Example PRPs 3DES, AES,
- AES K ? X ? X where K X
0,1128 - Functionally, any PRP is also a PRF.
- A PRP is a PRF where XY and is efficiently
invertible.
4Secure PRFs
- Let F K ? X ? Y be a PRF
- FunsX,Y the set of all functions from X
to Y - SF F(k,?) s.t. k ? K ?
FunsX,Y - Intuition a PRF is secure if a random
function in FunsX,Y is indistinguishable from
a random function in SF
SF
Size K
5Secure PRF defintion
- For b0,1 define experiment EXP(b) as
- Def F is a secure PRF if for all efficient
A PRF AdvA,F PrEXP(0)1
PrEXP(1)1 - is negligible.
b
b0 k?K, f ?F(k,?) b1 f?FunsX,Y
Chal.
Adv. A
6Secure PRP
- For b0,1 define experiment EXP(b) as
- Def E is a secure PRP if for all efficient
A PRP AdvA,E PrEXP(0)1
PrEXP(1)1 - is negligible.
b
b0 k?K, f ?E(k,?) b1 f?PermsX
Chal.
Adv. A
b ? 0,1
7Example secure PRPs
- Example secure PRPs 3DES, AES,
- AES K ? X ? X where K X
0,1128 - AES PRP Assumption
- All 280time algs A have PRP AdvA, AES
lt 2-40
8PRF Switching Lemma
- Any secure PRP is also a secure PRF.
- Lemma Let E be a PRP over (K,X) Then
for any q-query adversary A - PRF AdvA,E - PRP AdvA,E lt
q2 / 2X - ? Suppose X is large so that q2 / 2X
is negligible - Then
- PRP AdvA,E negligible ? PRF AdvA,E
negligible
9Using PRPs and PRFs
- Goal build secure encryption from a PRP.
- Security is always defined using two parameters
- 1. What power does adversary have?
examples - Adv sees only one ciphertext (one-time key)
- Adv sees many PT/CT pairs (many-time key,
CPA) - 2. What goal is adversary trying to achieve?
examples - Fully decrypt a challenge ciphertext.
- Learn info about PT from CT (semantic security)
10Modes of Operation for One-time Use Key
- Example application
- Encrypted email. New key for every message.
11Semantic Security for one-time key
- E (E,D) a cipher defined over (K,M,C)
- For b0,1 define EXP(b) as
- Def E is sem. sec. for one-time key if for all
efficient A SS AdvA,E
PrEXP(0)1 PrEXP(1)1 - is negligible.
b
Chal.
Adv. A
k?K
12Semantic security (cont.)
- Sem. Sec. ? no efficient adversary learns info
about PT from a single CT. - Example suppose efficient A can deduce LSB of
PT from CT. Then E (E,D) is not
semantically secure.
b?0,1
Adv. B (us)
Chal.
k?K
Adv. A (given)
- Then SS AdvB, E 1 ? E is not sem.
sec.
13Note ECB is not Sem. Sec.
- Electronic Code Book (ECB)
- Not semantically secure for messages that contain
more than one block.
b?0,1
Chal.
Adv. A
m0 Hello World m1 Hello Hello
k?K
(C1,C2) ? E(k, mb)
If C1C2 output 0, else output 1
14Secure Constructions
- Examples of sem. sec. systems
- 1. SS AdvA, OTP 0 for all A
- 2. Deterministic counter mode from a PRF F
- EDETCTR (k,m)
- Stream cipher built from PRF (e.g. AES, 3DES)
15Det. counter-mode security
- Theorem For any Lgt0. If F is a secure PRF over
(K,X,X) then EDETCTR is sem. sec. cipher over
(K,XL,XL). - In particular, for any adversary A attacking
EDETCTR there exists a PRF adversary B s.t. - SS AdvA, EDETCTR 2?PRF AdvB, F
- PRF AdvB, F is negligible (since F is a
secure PRF)Hence, SS AdvA, EDETCTR must be
negligible.
16Proof (as a reduction)
b?0,1
PRF Chal
SS Adv A (given)
PRF Adv B (us)
Choose f
b0 k?K, f ?F(k,?) b1
f?FunsX,Y
r ? 0,1
r ? 0,1
If rr output 0, else output 1
b1 f?FunsX,X ? PrEXP(1)0 Prrr
½ b0 f?F(k,?) ? PrEXP(0)0 ½ ? ½
?SS AdvA, EDETCTR
Hence, PRF AdvF, B ½ ?SS AdvA, DETCTR
17Modes of Operation for Many-time Key
- Example applications
- 1. File systems Same AES key used to encrypt
many files. - 2. IPsec Same AES key used to encrypt many
packets.
18Semantic Security for many-time key
- E (E,D) a cipher defined over (K,M,C)
- For b0,1 define EXP(b) as
(simplified CPA) - Def E is sem. sec. under CPA if for all
efficient A SSCPA AdvA,E
PrEXP(0)1 PrEXP(1)1 - is negligible.
b
Chal.
Adv.
k?K
m0 , m1 ? M m0 m1
b ? 0,1
19Randomized Encryption
- Fact stream ciphers are insecure under CPA.
- Fact No deterministic encryption can be
secure under CPA. - If secret key is to be used multiple times ?
- encryption algorithm must be randomized !!
20Construction 1 CBC
- Cipher block chaining with a random IV.
-
m0
m1
m3
m4
IV
?
?
?
?
E(k,?)
E(k,?)
E(k,?)
E(k,?)
c0
c1
c3
c4
IV
ciphertext
21CBC CPA Analysis
- CBC Theorem For any Lgt0, If E is a secure
PRP over (K,X) then ECBC is a sem. sec. under
CPA over (K, XL, XL1). - In particular, for a q-query adversary A
attacking ECBC there exists a PRP adversary B
s.t. - SSCPA AdvA, ECBC ? 2?PRP AdvB, E 2
q2 L2 / X - Note CBC is only secure as long as q2L2 ltlt
X
22Construction 2 rand ctr-mode
msg
m0
m1
mL
IV
?
F(k,IV)
F(k,IV1)
F(k,IVL)
c0
c1
cL
IV
ciphertext
IV - Picked fresh at random for every encryption
23rand ctr-mode CPA analysis
- Randomized counter mode random IV.
- Counter-mode Theorem For any Lgt0, If F is a
secure PRF over (K,X,X) then ECTR is a sem.
sec. under CPA over (K,XL,XL1). - In particular, for a q-query adversary A
attacking ECTR there exists a PRF adversary B
s.t. - SSCPA AdvA, ECTR ? 2?PRF AdvB, F 2
q2 L / X - Note ctr-mode only secure as long as q2L
ltlt X - Better then CBC !
24Summary
- PRPs and PRFs a useful abstraction of block
ciphers. - We examined two security notions
- Semantic security against one-time CPA.
- Semantic security against many-time CPA.
- Note neither mode ensures data integrity.
- Stated security results summarized in the
following table
one-time key Many-time key (CPA) CPA andCT integrity
Sem. Sec. Steam-ciphersDet. ctr-mode rand CBCrand ctr-mode Later
Power
Goal