세미나 발표자료.pptx(676077) - 슬라이드 1

80
Introduction to Modern Cryptography 7.4~8.2 Cryptographic Applications of Number-Theoretic Assumptions 이이이 2009 이 9 이 5 이 [email protected]

description

 

Transcript of 세미나 발표자료.pptx(676077) - 슬라이드 1

Page 1: 세미나 발표자료.pptx(676077) - 슬라이드 1

Introduction to Modern Cryptog-raphy

7.4~8.2 Cryptographic Applications of Number-Theoretic Assumptions

이광우2009 년 9 월 5 일

[email protected]

Page 2: 세미나 발표자료.pptx(676077) - 슬라이드 1

Sungkyunkwan University Information Security Group

2009 Summer Seminar 2

목 차 7.4 Cryptographic Applications of Number-Theoretic Assumptions 7.4.1 One-Way Functions and Permutations 7.4.2 Constructing Collision-Resistant Hash Functions

8.1 Algorithms for Factoring 8.1.1 Pollard’s p-1 Method 8.2.2 Pollard’s Rho Method 8.2.3 The Quadratic Sieve Algorithm

8.2 Algorithms for Computing Discrete Loga-rithms

8.2.1 The Baby-Step/Giant-Step Algorithm 8.2.2 The Pohling-Hellman Algorithm 8.2.3 The Discrete Logarithm Problem in ZN

Page 3: 세미나 발표자료.pptx(676077) - 슬라이드 1

3

CRYPTOGRAPHIC APPLICATIONS OF NUMTER-THEORETIC ASSUMPTIONS

Chapter 7.4

Page 4: 세미나 발표자료.pptx(676077) - 슬라이드 1

Sungkyunkwan University Information Security Group

2009 Summer Seminar 4

Cryptographic Applications of Numter-Theoretic Assumptions

• One-way Functions and Permutations

– n-bit string 을 n-bit string 에 대응하는 함수– 단순히 을 의미하는 것은 아님nnF }1,0{}1,0{:

Page 5: 세미나 발표자료.pptx(676077) - 슬라이드 1

Sungkyunkwan University Information Security Group

2009 Summer Seminar 5

Cryptographic Applications of Numter-Theoretic Assumptions

• The inverting experiment InvertA,f (n) :– 1. Choose input x{0,1}n. Compute y:=f(x)– 2. A is given 1n and y as input, and outputs x’– 3. The output of the experiment is defined to be 1 if and

only if f(x’)=y.

Page 6: 세미나 발표자료.pptx(676077) - 슬라이드 1

Sungkyunkwan University Information Security Group

2009 Summer Seminar 6

Cryptographic Applications of Numter-Theoretic Assump-tions

• One-way

Definition 7.66 A function f : { 0, 1 }* → { 0, 1 }* is one-way if the follwing two conditions hold:

1. (Easy to compute: ) There exists a polynomial-time algorithm that on input x outputs f(x)

2. (Hard to invert: ) For all probabilistic polynomial-time algorithms A there exists a negligible function negl such that

Pr[InvertA,f (n)=1]≤negl(n).

Page 7: 세미나 발표자료.pptx(676077) - 슬라이드 1

Sungkyunkwan University Information Security Group

2009 Summer Seminar 7

• 알고리즘 7.67

Page 8: 세미나 발표자료.pptx(676077) - 슬라이드 1

Sungkyunkwan University Information Security Group

2009 Summer Seminar 8

Cryptographic Applications of Numter-Theoretic Assump-tions

• ???

Theorem 7.68 If the factoring problem is hard relative to Gen, then fGEN is a one-way function.

Page 9: 세미나 발표자료.pptx(676077) - 슬라이드 1

Sungkyunkwan University Information Security Group

2009 Summer Seminar 9

Cryptographic Applications of Numter-Theoretic Assumptions

• *One-Way Permutations

Page 10: 세미나 발표자료.pptx(676077) - 슬라이드 1

Sungkyunkwan University Information Security Group

2009 Summer Seminar 10

Cryptographic Applications of Numter-Theoretic Assump-tions

• Family of functionsDefinition 7.69 A tuple =(Gen, Samp, f) of probabilistic polynomial-time algorithms is a family of functions if the following hold:

1. The parameter generation algorithm Gen, on input 1n, outputs parameters I with | I | n. Each value of I output by Gen defines set DI and RI that consti-tute the domain and range, respectively, of a function fI defined below.

2. The sampling algorithm Samp, on input I, outputs a uniformly distributed element of DI (except possibly with probability negligible in |I | ) .

3. The deterministic evaluation algorithm f, on input I and xDI, outputs an el-ement yRI. We write this as y:=fI(x).

is a family of permutations if, for each value of I output by Gen(1n), it holds that DI=RI and the function fI : DI DI is a bijection.

Page 11: 세미나 발표자료.pptx(676077) - 슬라이드 1

Sungkyunkwan University Information Security Group

2009 Summer Seminar 11

Cryptographic Applications of Numter-Theoretic Assumptions

• The inverting experiment InvertA, (n) :– 1. Gen(1n) is run to obtain I, and then Samp(I) is run to

obtain a random x DI. Finally, y:=fI(x) is computed.– 2. A is given I and y as input, and output x’.– 3. The output of the experiment is defined to be 1 if

fI(x’)=y, and 0 otherwise.

Page 12: 세미나 발표자료.pptx(676077) - 슬라이드 1

Sungkyunkwan University Information Security Group

2009 Summer Seminar 12

Cryptographic Applications of Numter-Theoretic Assump-tions

• ???Definition 7.70 A family of functions/permutations =(Gen, Samp, f) is one-way if for all probabilistic polynomial-time algorithms A there exists a negligible function negl such that

Pr[InvertA, (n)=1] negl(n)

Page 13: 세미나 발표자료.pptx(676077) - 슬라이드 1

Sungkyunkwan University Information Security Group

2009 Summer Seminar 13

Cryptographic Applications of Numter-Theoretic Assump-tions

• A family of One-way permutations (assum-ing the RSA problem is hard relative to GenRSA)Construction 7.71

Let GenRSA be as in Section 7.2.4. Define a family of permutations as follows:

• Gen : on input 1n, run GenRSA(1n) to obtain (N, e, d) and output I=<N, e>. Set I = *

N .

• Samp: on input I=<N ,e>, choose a random element of *N.

• f : on input I = <N,e> and x *N, output [xe mod N].

Page 14: 세미나 발표자료.pptx(676077) - 슬라이드 1

Sungkyunkwan University Information Security Group

2009 Summer Seminar 14

Constructing Collision-Re-sistant Hash Functions

• ????

Page 15: 세미나 발표자료.pptx(676077) - 슬라이드 1

Sungkyunkwan University Information Security Group

2009 Summer Seminar 15

Constructing Collision-Resis-tant Hash Functions

• A Fiexed-length hash function

Construction 7.72Let be as described in the text. Define a fixed-length hash function (Gen, H) as fol-lows:

• Gen : on input 1n, run (1n) to obtain (, q, g) and then select h. Output s:=<, q, g, h> as the key.

• H : Given a key s=<, q, g, h> and input (x1, x2)qXq, output Hs(x1, x2):=gx1hx2

Page 16: 세미나 발표자료.pptx(676077) - 슬라이드 1

Sungkyunkwan University Information Security Group

2009 Summer Seminar 16

Constructing Collision-Resis-tant Hash Functions

• ???

– Proof : Let =(Gen, H) as in Construction 7.72, and let A be a probabilistic polynomial-time algorithm with

Theorem 7.23 If the discrete logarithm problem is hard relative to , then Construction 7.72 is a fixed-length colli-sion-resistant has function (subject to the discussion re-garding compression, above).

,( ) Pr[ ( ) 1]def

n n Ηash- collA

Page 17: 세미나 발표자료.pptx(676077) - 슬라이드 1

Sungkyunkwan University Information Security Group

2009 Summer Seminar 17

Constructing Collision-Re-sistant Hash Functions

• Algorithm’ :

• The algorithm is given , q, g, h as input.

– 1. Let s:=<,q,g,h>. Run A(s) and obtain output x and x’.

Page 18: 세미나 발표자료.pptx(676077) - 슬라이드 1

Sungkyunkwan University Information Security Group

2009 Summer Seminar 18

Constructing Collision-Resis-tant Hash Functions

• ???Theorem 7.24 If there exists a probabilistic polynomial-time algorithm relative to which the discrete logarithm problem is hard, then there exists a collision resistant has function.

Page 19: 세미나 발표자료.pptx(676077) - 슬라이드 1

19

ALGORITHMS FOR FAC-TORING

Chapter 8.1

Page 20: 세미나 발표자료.pptx(676077) - 슬라이드 1

Sungkyunkwan University Information Security Group

2009 Summer Seminar 20

Algorithm for factoring

• One-way Functions and Permutations

– n-bit string 을 n-bit string 에 대응하는 함수– 단순히 을 의미하는 것은 아님nnF }1,0{}1,0{:

Page 21: 세미나 발표자료.pptx(676077) - 슬라이드 1

Sungkyunkwan University Information Security Group

2009 Summer Seminar 21

Cryptographic Applications of Numter-Theoretic Assumptions

• One-way Functions and Permutations

– n-bit string 을 n-bit string 에 대응하는 함수– 단순히 을 의미하는 것은 아님nnF }1,0{}1,0{:

Page 22: 세미나 발표자료.pptx(676077) - 슬라이드 1

Sungkyunkwan University Information Security Group

2009 Summer Seminar 22

Cryptographic Applications of Numter-Theoretic Assumptions

• One-way Functions and Permutations

– n-bit string 을 n-bit string 에 대응하는 함수– 단순히 을 의미하는 것은 아님nnF }1,0{}1,0{:

Page 23: 세미나 발표자료.pptx(676077) - 슬라이드 1

Sungkyunkwan University Information Security Group

2009 Summer Seminar 23

Constructing CPA-Secure En-cryption Schemes

• Pseudorandom Function

– Keyed Function• • 두 개의 입력을 가지는 함수 (Two-Input Function)• 첫 번째 입력은 Key 를 나타내며 , 이후 k 로 표시• 두 번째 입력은 일반적인 입력값• 일반적으로 Key k 는 선택된 이후 고정되기 때문에 본 교재에서는 고정된 k 를 가진 , 하나의 입력값을 지닌 Keyed Function 에 초점을 맞춤 ; • 일반적으로 Keyed Function 은 Length-Preserving 을 가정함

*}1,0{}*1,0{*}1,0{: F

*}1,0{}*1,0{: kF

Page 24: 세미나 발표자료.pptx(676077) - 슬라이드 1

Sungkyunkwan University Information Security Group

2009 Summer Seminar 24

Constructing CPA-Secure En-cryption Schemes

• Pseudorandom Function

|||||)(| kxxFk

Length-Preserving

• 따라서 , 으로 고정하면 는 n-bit string 에서 n-bit string으로 대응하는 함수• k 와 x 가 주어졌을때 를 deterministic polynomial time 안에 계산할 수 있는 알고리즘이 존재할 때 , F 는 효율적이다고 정의하며 , 교재에서는 효율적인 F 만 다룸

nk }1,0{ )(xFk

),( xkF

Page 25: 세미나 발표자료.pptx(676077) - 슬라이드 1

Sungkyunkwan University Information Security Group

2009 Summer Seminar 25

Constructing CPA-Secure En-cryption Schemes

• Pseudorandom Function• 만약 Fk( 무작위로 선택한 key k) 와 f(n-bit string 에서 n-bit string 으로 대응하는 모든 함수의 집합에서 무작위로 추출한 함수 ) 를 polynomial-time ad-

versary 가 구별할 수 없을 때 , keyed function F 는 pseudorandom function이라 함

n-bit string 에서 n-bit string 에 대응하는 모든 함수 집합

무작위로 k 를 선택하여 결정한 함수 Fk 임의로 선택한 함수 fIndistinguish-

able

F( k, x ) 의 집합

Page 26: 세미나 발표자료.pptx(676077) - 슬라이드 1

Sungkyunkwan University Information Security Group

2009 Summer Seminar 26

Constructing CPA-Secure En-cryption Schemes

• Pseudorandom Function

– Distinguisher D

• Random function f 와 Random 하게 선택한 k 로 인해 결정되는 Function F 를 Distinguisher 가 구분할 수 없으면 , F 는 Pseudo-random Function

• D 는 오라클에 접근이 가능함– F 또는 f 에 대해서 모두 접근이 가능– 오라클은 Black-box 로 취급되며 , 공격자 A 에게도 오라클은 동일하게 제공됨– 오라클은 Deterministic Function 으로 동일한 입력에 대해서는 동일한 값을 출력

Page 27: 세미나 발표자료.pptx(676077) - 슬라이드 1

Sungkyunkwan University Information Security Group

2009 Summer Seminar 27

Constructing CPA-Secure En-cryption Schemes

• Pseudorandom Function

Definition 3.23 Let F : { 0, 1 }* X { 0, 1 }* → { 0, 1 }* be an ef -ficient, length-preserving, keyed function. We say that F is a pseu-dorandom function if for all probabilistic polynomial-time distin-guisher D, there exists a negligible function negl such that

| Pr[DFk(∙)(1n) = 1] – Pr[Df(∙)(1n) = 1 | ≤ negl(n),

where k ← { 0, 1 }n is chosen uniformly at random and f is chosen uniformly at random from the set of functions mapping n-bit strings to n-bit strings.

Page 28: 세미나 발표자료.pptx(676077) - 슬라이드 1

Sungkyunkwan University Information Security Group

2009 Summer Seminar 28

Constructing CPA-Secure En-cryption Schemes

• On the Existence of Pseudorandom Func-tions

– Pseudorandom Function 은 실존하는가 ?• 실제로 블록 암호 알고리즘이 Pseudorandom Function 과 유사하게 동작하는 것으로 여겨짐• 3.6.3 에서 블록 암호에 대해 간략히 다루며 더 상세한 내용은 5 장에서 다룸

Page 29: 세미나 발표자료.pptx(676077) - 슬라이드 1

Sungkyunkwan University Information Security Group

2009 Summer Seminar 29

Constructing CPA-Secure En-cryption Schemes

• Using Pseudorandom Function in Cryptography

– 암호의 구성 (Cryptographic Construction) 과 Pseudorandom Function

• Pseudorandom Function 은 암호문 블록을 구성하는데 매우 효율적인 방법임이 다양한 암호 구성을 통해 밝혀졌음• 본 절에서는 Pseudorandom Function 을 CPA-Secure 특성을 갖는 암호 구성에 적용하며 , 4 장에서는 MAC(Message Authentication

Code) 를 구성하는데 사용함• Pseudorandom Function 을 사용하는 가장 큰 이유 중 하나는 Pseudo-

random Function 을 사용한 구성은 깔끔하고 (Clean) 우아한 (Elegant) 분석이 가능하기 때문

Page 30: 세미나 발표자료.pptx(676077) - 슬라이드 1

Sungkyunkwan University Information Security Group

2009 Summer Seminar 30

Constructing CPA-Secure En-cryption Schemes

• Using Pseudorandom Function in Cryptog-raphy

• Pseudorandom Function 대신 실제 Random Func-tion 을 사용한다고 가정하고 암호의 안전성을 증명Step 1

• Random Function 대신 Pseudorandom Function 을 사용해도 공격자가 암호를 파괴 (break) 할 수 없음을 증명Step 1

It must implicitly be distinguishing the function from random !!

Page 31: 세미나 발표자료.pptx(676077) - 슬라이드 1

Sungkyunkwan University Information Security Group

2009 Summer Seminar 31

Constructing CPA-Secure En-cryption Schemes

• CPA-Secure Encryption Scheme from Pseu-dorandom Functions

– Pseudorandom Function 을 사용한 Encryption Scheme

• Enck(m) = Fk(m)• Pseudorandom Function 을 사용한 가장 단순한 Encryption

Scheme 은 위와 같이 Pseudorandom Function 을 그대로 암호화에 적용하는 방법• 그러나 Fk(m) 은 Deterministic Function 이기 때문에 CPA-Se-

cure 하지 않음 (3.5 절 참조 )

Page 32: 세미나 발표자료.pptx(676077) - 슬라이드 1

Sungkyunkwan University Information Security Group

2009 Summer Seminar 32

Constructing CPA-Secure En-cryption Schemes

• CPA-Secure Encryption Scheme from Pseu-dorandom Functions

Fresh random String r

Pseudorandom Function

Pad

XORPlaintext Ciphertext

• Random String R• Deterministic Function 을

Probabilistic 으로 변경하기 위해 사용• R 을 사용하면 , 매번 다른

Pad 값이 사용되기 때문에 Probabilistic Function

• 물론 , 확률적으로 같은 r 값이 여러 번 반복해서 사용될 수도 있음

Page 33: 세미나 발표자료.pptx(676077) - 슬라이드 1

Sungkyunkwan University Information Security Group

2009 Summer Seminar 33

Constructing CPA-Secure En-cryption Schemes

• CPA-Secure Encryption Scheme from Pseu-dorandom Functions

Construction 3.24Let F be a pseudorandom function. Define a private-key encryption scheme for mes-sage of length n as follows.

• Gen : on input 1n, choose k ← { 0, 1 }n uniformly at random and output it as the key

• Enc : on input a key k ∈ { 0, 1 }n and a message m ∈ { 0, 1 }n, choose r ← { 0, 1 }n uniformly at random and output the ciphertext

c := < r, Fk(r) XOR m >

• Dec : on input a key k ∈ { 0, 1 }n and a ciphertext c = < r, s >, output the plain-text message

m := Fk(r) XOR s

Page 34: 세미나 발표자료.pptx(676077) - 슬라이드 1

Sungkyunkwan University Information Security Group

2009 Summer Seminar 34

Constructing CPA-Secure En-cryption Schemes

• CPA-Secure Encryption Scheme from Pseu-dorandom Functions

• Construction 3.24 는 Pseudorandom Function 을 사용한 CPA-Secure Encryption Scheme 을 나타냄

• Construction 3.24 의 안전성은 Pseudorandom Function Fk(r) 와 Random Function f 를 공격자가 구별할 수 없음(Indistinguishable) 을 바탕으로 함

• Random value r 이 반복되어 사용되지 않는다고 가정하면 One-time Pad 와 유사함

Page 35: 세미나 발표자료.pptx(676077) - 슬라이드 1

Sungkyunkwan University Information Security Group

2009 Summer Seminar 35

Constructing CPA-Secure En-cryption Schemes

• CPA-Secure Encryption Scheme from Pseu-dorandom Functions

Theorem 3.25 If F is a pseudorandom function, then Construc-tion 3.24 is a fixed-length private-key encryption scheme for mes-sages of length n that has indistinguishable encryption under a chosen-plaintext attack.

Page 36: 세미나 발표자료.pptx(676077) - 슬라이드 1

Sungkyunkwan University Information Security Group

2009 Summer Seminar 36

Constructing CPA-Secure En-cryption Schemes

• CPA-Secure Encryption Scheme from Pseu-dorandom Functions

– Proof : • • Construction 3.24 에서 Pseudorandom Function 대신 실제

Random Function 을 사용하는 Encryption Scheme• q(n) 을 공격자가 오라클에 시도할 수 있는 최대 query 횟수라하면모든 공격자 A 에 대해 아래 식이 성립

( , , )GEN ENC DEC

(3.4) ,

1 ( )Pr[Pr ( ) 1]2 2

cpanA

q nivK n

Page 37: 세미나 발표자료.pptx(676077) - 슬라이드 1

Sungkyunkwan University Information Security Group

2009 Summer Seminar 37

Constructing CPA-Secure En-cryption Schemes

• CPA-Secure Encryption Scheme from Pseu-dorandom Functions

– Proof : • (3.4) 의 유도과정• 메시지 m 이 암호화 될 때에는 항상 임의의 r←{0, 1}n 을 선택하여 <

r, f(r) XOR m > 으로 암호화• c:= < rc, f(rc) XOR mb > 라 하면 , 두 가지 경우가 발생함

– Case 1: rc 가 A 의 query 에 대한 암호문을 생성할 때 한번 이상 반복되어 사용되는 경우 – Case 2: rc 가 A 의 query 에 대한 암호문을 생성할 때 한번도 반복되지 않는 경우

Page 38: 세미나 발표자료.pptx(676077) - 슬라이드 1

Sungkyunkwan University Information Security Group

2009 Summer Seminar 38

Constructing CPA-Secure En-cryption Schemes

• CPA-Secure Encryption Scheme from Pseu-dorandom Functions

– Proof : • Case 1

– 만약 , 이전에 사용된 rc 가 반복되어 사용되는 경우 공격자는 어떤 평문이 암호화되었는지 알 수 있음» 메시지 m 의 암호문 <r, s> 에서 < s XOR m > 을 통해 f(r) 을 알 수 있으므로 , 이 f(r) 을 바탕으로 암호화된 m 을 결정할 수 있음

– q(n) 을 공격자 A 에게 허용된 최대 query 횟수라고 하면 , 반복된 r 을 획득할 수 있는 최대 확률은 q(n)/2n

Page 39: 세미나 발표자료.pptx(676077) - 슬라이드 1

Sungkyunkwan University Information Security Group

2009 Summer Seminar 39

Constructing CPA-Secure En-cryption Schemes

• CPA-Secure Encryption Scheme from Pseu-dorandom Functions

– Proof : • Case 2

– rc 가 반복되어 사용되지 않는 경우 , 공격자 A 는 f(rc ) 값을 알 수 없기 때문에 , 공격에 성공할 확률 (b’=b) 은 정확히 ½

• Repeat 를 rc 가 오라클에서 한번 이상 사용되는 사건이라고 하면 , Repeat 가 발생할 최대 확률은 q(n)/2n

• Case 2 에서는 Repeat 가 한번도 발생하지 않으므로 발생할 확률은 0

Page 40: 세미나 발표자료.pptx(676077) - 슬라이드 1

Sungkyunkwan University Information Security Group

2009 Summer Seminar 40

Constructing CPA-Secure En-cryption Schemes

• CPA-Secure Encryption Scheme from Pseu-dorandom Functions

– Proof : • Case 1 과 Case 2 를 고려하여 (3.4) 를 유도

,

, ,

,

Pr[Pr ( ) 1]

Pr[Pr ( ) 1^ Re ] Pr[Pr ( ) 1^ Re ]

Pr[Re ] Pr[Pr ( ) 1| Re ]

( ) 12 2

cpaA

cpa cpaA A

cpaA

n

ivK n

ivK n peat ivK n peat

peat ivK n peat

q n

Page 41: 세미나 발표자료.pptx(676077) - 슬라이드 1

Sungkyunkwan University Information Security Group

2009 Summer Seminar 41

Constructing CPA-Secure En-cryption Schemes

• CPA-Secure Encryption Scheme from Pseu-dorandom Functions

– Proof :

• 이제 공격자를 PPT 에 한정하고 를 정의

(3.5) ,1Pr[Pr ( ) 1]2

defcpaAivK n

Page 42: 세미나 발표자료.pptx(676077) - 슬라이드 1

Sungkyunkwan University Information Security Group

2009 Summer Seminar 42

Constructing CPA-Secure En-cryption Schemes

• CPA-Secure Encryption Scheme from Pseu-dorandom Functions

– Proof : • 공격자 A 는 PPT 이므로 , 최대 query 횟수는 다항식 q(.) 로 표현가능• (3.4) 가 이를 반영하고 있으므로 , PPT 공격자 A 의 성공확률은 아래와 같이 나타낼 수 있음

• (3.5) 에 의해 아래 식도 유도 가능

,

1 ( )Pr[Pr ( ) 1]2 2

cpanA

q nivK n

,1Pr[Pr ( ) 1] ( )2

cpaAivK n n

Page 43: 세미나 발표자료.pptx(676077) - 슬라이드 1

Sungkyunkwan University Information Security Group

2009 Summer Seminar 43

Constructing CPA-Secure En-cryption Schemes

• CPA-Secure Encryption Scheme from Pseu-dorandom Functions

– Proof : • 만약 이 negligible 하지 않으면 , 두 수식의 차이 역시 negligible하지 않으므로 , 직관적으로 Pseudorandom Function 과 Random

Function 을 구별할 수 있음• 공격자 A 는 Pseudorandom Function 과 Random Function 을 구별하기 위해 Distinguisher D 를 사용

Page 44: 세미나 발표자료.pptx(676077) - 슬라이드 1

Sungkyunkwan University Information Security Group

2009 Summer Seminar 44

Constructing CPA-Secure En-cryption Schemes

• CPA-Secure Encryption Scheme from Pseu-dorandom FunctionsDistinguisher D:

D is given input 1n and access to an oracle O : {0, 1}n→{0, 1}n

1. Run A(1n). Whenever A queries its encryption oracle on a message m, answer this query in the following way:(a) Choose r←{0, 1}n uniformly at random.(b) Query O(r) and obtain response s’.(c) Return the ciphertext <r, s’ XOR m > to A.

2. When A outputs message m0, m1 ∈ {0, 1}n, choose a random bit b←{0, 1} and then:(a) Choose r←{0, 1}n uniformly at random.(b) Query O(r) and obtain response s’.(c) Return the ciphertext <r, s’ XOR mb > to A.

3. Continue Answering any encryption oracle queries of A as before. Eventually, A outputs a bit b’. Output 1 if b’=b, and ouput 0 otherwise.

Page 45: 세미나 발표자료.pptx(676077) - 슬라이드 1

Sungkyunkwan University Information Security Group

2009 Summer Seminar 45

Constructing CPA-Secure En-cryption Schemes

• CPA-Secure Encryption Scheme from Pseu-dorandom Functions

– Proof : • Case 1: D 의 오라클이 Pseudorandom Function 인 경우

– 이 경우 D 가 Pseudorandom Function 을 인지할 확률은 의 시험과 동일

• Case 2: D 의 오라클이 Random Function 인 경우– 이 경우 D 가 Pseudorandom Function 을 인지할 확률은 의 시험과 동일

,Pr ( )cpaAivK n

,Pr ( )cpaAivK n

(.),Pr[ (1 ) 1] Pr[Pr ( ) 1]kF n cpaAD ivK n

(.),Pr[ (1 ) 1] Pr[Pr ( ) 1]kF n cpaAD ivK n

Page 46: 세미나 발표자료.pptx(676077) - 슬라이드 1

Sungkyunkwan University Information Security Group

2009 Summer Seminar 46

Constructing CPA-Secure En-cryption Schemes

• CPA-Secure Encryption Scheme from Pseudo-random Functions

– Proof : • (3.4), (3.5) 및 위의 수식들을 연합하면 , 아래와 같음

• F 를 Pseudorandom Function 이라고 가정하였으므로 , 는 반드시 negligible 해야 함• q 는 다항식이므로 , 은 negligible• 따라서 는 CPA-Secure

(.) (.) ( )Pr[ (1 ) 1] Pr[ (1 ) 1] ( )2

kF n f nn

q nD D n

( )( )2nq nn

Page 47: 세미나 발표자료.pptx(676077) - 슬라이드 1

Sungkyunkwan University Information Security Group

2009 Summer Seminar 47

Constructing CPA-Secure En-cryption Schemes

• CPA-Secure Encryption Scheme from Pseu-dorandom Functions

– 임의의 길이의 m 에 대한 CPA-Secure• 앞서 3.5 절에서 언급했던 바와 같이 Fix-length m 에 대해 CPA-Se-

cure 한 scheme 은 임의의 길이에 대해서도 CPA-Secure• m = m1, m2, … , ml 이라고 하고 각 mi 는 n-bit block 이라고 하면 ,

< r1, Fk(r1) XOR m1, r2, Fk(r2) XOR m2, … , rl, Fk(rl) XOR ml > 로 나타낼 수 있음COROLLARY 3.26 If F is a pseudorandom function, then the scheme sketched above is a private-key encryption scheme for arbitrary-length messages that has indistinguishable encryption under a chosen-plaintext attack.

Page 48: 세미나 발표자료.pptx(676077) - 슬라이드 1

Sungkyunkwan University Information Security Group

2009 Summer Seminar 48

Constructing CPA-Secure En-cryption Schemes

• CPA-Secure Encryption Scheme from Pseu-dorandom Functions

– Efficiency of Construction 3.24

• Construction 3.24 에서 언급하고 있는 scheme 은 암호문의 길이가 평문의 길이의 두 배에 이르는 문제점을 지니고 있음• Section 3.6.4 에서 암호문의 길이를 획기적으로 줄이는 방법에 대해 소개함

Page 49: 세미나 발표자료.pptx(676077) - 슬라이드 1

Sungkyunkwan University Information Security Group

2009 Summer Seminar 49

Constructing CPA-Secure En-cryption Schemes

• Pseudorandom Permutation and Block Ciphers

– Keyed Permutation

• Keyed Function 이 모든 k 에 대해 일대일 대응인 경우– Keyed Function 은 Length-Preserving 이기 때문에 , Keyed Permutation 은 Keyed

Function 중 전단사 함수인 것을 의미• 일반적으로 Keyed Permutation 은 key, input, output 의 길이가 모두 동일하다고 가정

– 실제 구현상에서는 input 과 output 의 길이만 동일하고 (block size) key 는 이에 비해 짧아도 되고 길어도 됨

– Efficient Keyed Permutation

• k 와 x 가 주어졌을 때 , Fk(x) 와 Fk-1(x) 를 Polynomial Time 안에 계산할 수 있는 알고리즘이 존재하면 , Keyed Permutation 은 Efficient 하다고 함

Page 50: 세미나 발표자료.pptx(676077) - 슬라이드 1

Sungkyunkwan University Information Security Group

2009 Summer Seminar 50

Constructing CPA-Secure En-cryption Schemes

• Pseudorandom Permutation and Block Ciphers

– Pseudorandom Permutation & Pseudorandom Function

• Pseudorandom Function 의 정의에서 Random Function 대신 Random Permutation 을 사용하면 Pseudorandom Permutation 을 정의할 수 있음

• 직관적으로 Pseudorandom Function 과 Pseudorandom Permuta-tion 은 동일함– 만약 f(x) = f(y) 를 충족하는 쌍을 발견할 수 있다면 , Pseudorandom Func-

tion 과 Pseudorandom Permutation 을 구별할 수 있음– 그러나 , 이를 충족하는 x, y 를 Polynomial Time 안에 찾아낼 확률은 neg-

ligible 하기 때문에 , 직관적으로 Pseudorandom Function 과 Pseudo Permutation 은 동일함

Page 51: 세미나 발표자료.pptx(676077) - 슬라이드 1

Sungkyunkwan University Information Security Group

2009 Summer Seminar 51

Constructing CPA-Secure En-cryption Schemes

• Pseudorandom Permutation and Block Ci-phers

– 일대일 대응 함수 ( 전단사함수 )• 일대일 대응 함수의 가장 큰 특징은 바로 역함수를 정의할 수 있다는 것• 따라서 Permutation 을 사용한 암호 스킴의 설계에서는 암호화 뿐만 아니라 복호화 연산을 수행하는 또다른 신뢰된 구성원 (Trusted Party) 에 대한 고려가 필요

PROPOSITION 3.27 If F is a pseudorandom permutation then it is also a pseudorandom function.

Page 52: 세미나 발표자료.pptx(676077) - 슬라이드 1

Sungkyunkwan University Information Security Group

2009 Summer Seminar 52

Constructing CPA-Secure En-cryption Schemes

• Pseudorandom Permutation and Block Ci-phers

Definition 3.28 Let F : { 0, 1 }* X { 0, 1 }* → { 0, 1 }* be an ef -ficient, keyed permutation. We say that F is a strong pseudoran-dom function if for all probabilistic polynomial-time distinguisher D, there exists a negligible function negl such that

| Pr[DFk(∙)Fk-1(.)(1n) = 1] – Pr[Df(∙)f-1(.)(1n) = 1 | ≤ negl(n),

where k ← { 0, 1 }n is chosen uniformly at random and f is chosen uniformly at random from the set of permutation on n-bit strings.

Page 53: 세미나 발표자료.pptx(676077) - 슬라이드 1

Sungkyunkwan University Information Security Group

2009 Summer Seminar 53

Constructing CPA-Secure En-cryption Schemes

• Pseudorandom Permutation and Block Ciphers

– Block Cipher

• 앞서 pseudorandom generator 를 모델로 string cipher 가 설계될 수 있다고 언급한 것처럼 , pseudorandom permutation 은 block cipher로 설계될 수 있음– 불행히도 block cipher 는 pseudorandom permutation 을 기반으로 설계되지만 , 많은 책들이 이러한 사실을 언급하지 않음– Pseudorandom permutation 을 기반으로 하는 다양한 scheme 들은 이후 상세히 설명

• 실제 block cipher 는 strong pseudorandom permutation 을 기준으로 설계되지만 본 교재에서는 strong 의 조건인 복호화 부분은 제외하고 설명하기로 함

Page 54: 세미나 발표자료.pptx(676077) - 슬라이드 1

Sungkyunkwan University Information Security Group

2009 Summer Seminar 54

Constructing CPA-Secure En-cryption Schemes

• Pseudorandom Permutation and Block Ci-phers

– CPA-Secure

• Construction 3.24 를 기준으로 scheme 을 설계하면 CPA-Secure한 scheme 을 구성할 수 있음– 그러나 , c:= Fk(m) 으로 구성하는 암호는 Fk 가 strong pseudorandom

permutation 이라 할지라도 CPA-Secure 하다고 이야기할 수는 없음– Probabilistic Algorithm 이 아니라 Deterministic Algorithm 이 되기 때문– 이러한 특성은 매우 중요하지만 쉽게 망각하는 특성

Page 55: 세미나 발표자료.pptx(676077) - 슬라이드 1

Sungkyunkwan University Information Security Group

2009 Summer Seminar 55

Constructing CPA-Secure En-cryption Schemes

• Mode of Operation

– Mode of Operation

• 대표적인 운영모드 ECB, CBC, OFB, CTR 에 대해서 살펴봄• 가정사항

– 본 절에서는 임의의 길이 (arbitrary length) 의 메시지 m 에 대한 암호화를 가정하며 , 만약 m 의 길이가 block size l 의 배수가 아닐 때에는 1000….000 의 패딩을 붙여 길이를 배수로 맞춘다고 가정함

Page 56: 세미나 발표자료.pptx(676077) - 슬라이드 1

Sungkyunkwan University Information Security Group

2009 Summer Seminar 56

Constructing CPA-Secure En-cryption Schemes

• Mode of Operation

– ECB : Electronic Code Book

Fk Fk Fk

m1 m2 ml

c1 c2 cl

...

Page 57: 세미나 발표자료.pptx(676077) - 슬라이드 1

Sungkyunkwan University Information Security Group

2009 Summer Seminar 57

Constructing CPA-Secure En-cryption Schemes

• Mode of Operation

– ECB

• < Fk(m1), Fk(m2), … , Fk(ml) >• Deterministic 이기 때문에 CPA-Secure 하지 않음• 평문의 같은 블록은 암호문 역시 동일하게 생성되기 때문에 , 도청자

(eavesdropper) 에게도 안전하지 않음– 교재에서는 ECB 모드에 대해 아래와 같이 부연설명

ECB mode should therefore never be used.(We include it for its his-torical significance only.)

Page 58: 세미나 발표자료.pptx(676077) - 슬라이드 1

Sungkyunkwan University Information Security Group

2009 Summer Seminar 58

Constructing CPA-Secure En-cryption Schemes

• Mode of Operation

– CBC : Cipher Block Chaining

Fk Fk Fk

m1

IV

c1 c2 cl

m2 ml

Page 59: 세미나 발표자료.pptx(676077) - 슬라이드 1

Sungkyunkwan University Information Security Group

2009 Summer Seminar 59

Constructing CPA-Secure En-cryption Schemes

• Mode of Operation

– CBC

• c0 = IV, For i = 1 to l, set ci := Fk(ci-1 XOR mi)• CBC 는 Probabilistic 이므로 , F 가 pseudorandom permutation이면 , CBC-mode 는 CPA-Secure• CBC 모드의 단점은 이전 ci-1 이 현 block 의 암호화에 필요하기 때문에 병렬처리가 불가능하다는 것• 안전성을 위해서는 IV 역시 신중하게 선택되어야 함

Page 60: 세미나 발표자료.pptx(676077) - 슬라이드 1

Sungkyunkwan University Information Security Group

2009 Summer Seminar 60

Constructing CPA-Secure En-cryption Schemes

• Mode of Operation

– OFB : Output Feedback

Fk Fk Fk

IV

c1

m1

c2 cl

m2 ml

Page 61: 세미나 발표자료.pptx(676077) - 슬라이드 1

Sungkyunkwan University Information Security Group

2009 Summer Seminar 61

Constructing CPA-Secure En-cryption Schemes

• Mode of Operation

– OFB

• r0 = IV ( IV ←{0, 1}n ), ri = Fk( ri-1 )• ci = mi XOR ri

• OFB 모드는 Probabilistic 이므로 , F 가 pseudorandom permu-tation 이면 , OFB-mode 는 CPA-Secure– CBC 모드와는 달리 OFB 모드에서는 F 가 반드시 Permutation 일 필요는 없음

• IV 에 대한 연산을 미리 할 수 있기 때문에 (pre-computation) CBC 모드보다 성능이 좋음

Page 62: 세미나 발표자료.pptx(676077) - 슬라이드 1

Sungkyunkwan University Information Security Group

2009 Summer Seminar 62

Constructing CPA-Secure En-cryption Schemes

• Mode of Operation

– CTR : Counter

Fk Fk Fk

Ctr+1 Ctr+2 Ctr+l

c1

m1

c2 cl

m2 ml

...

Page 63: 세미나 발표자료.pptx(676077) - 슬라이드 1

Sungkyunkwan University Information Security Group

2009 Summer Seminar 63

Constructing CPA-Secure En-cryption Schemes

• Mode of Operation

– CTR

• IV ←{0, 1}n , 일반적으로 이 IV 를 ctr 로 표기함 • ri = Fk( ctr + i )

– ctr + i 는 modulo 2n 상에서의 덧셈• ci := ri XOR mi

• CTR 모드 역시 F 가 반드시 Permutation 일 필요는 없음• CTR 모드의 장점

– CTR 모드는 CPA-Secure– 암호화와 복호화의 병렬화가 가능함– 메시지 m 의 특정 block 에 대한 복호화가 가능

Page 64: 세미나 발표자료.pptx(676077) - 슬라이드 1

Sungkyunkwan University Information Security Group

2009 Summer Seminar 64

Constructing CPA-Secure En-cryption Schemes

• Mode of Operation

Theorem 3.29 If F is a pseudorandom function, then randomized counter mode(as described above) has indistinguishable encryp-tions under a chosen-plaintext attack.

Page 65: 세미나 발표자료.pptx(676077) - 슬라이드 1

Sungkyunkwan University Information Security Group

2009 Summer Seminar 65

Constructing CPA-Secure En-cryption Schemes

• Mode of Operation

– Proof

• • Randomized counter mode encryption 에서 pseudorandom

permutation 대신 random permutation 을 사용하는 scheme• q(n) 은 공격자가 오라클에 시도할 수 있는 최대 query 횟수• ctr* : challenge ciphertext 를 생성할 때 사용하는 ctr 값• ctri : i 번째 오라클 query 에 사용된 ctr 값

( , , )GEN ENC DEC

(3.6) ,

1Pr[Pr ( ) 1] ( )2

cpaAivK n negl n

Page 66: 세미나 발표자료.pptx(676077) - 슬라이드 1

Sungkyunkwan University Information Security Group

2009 Summer Seminar 66

Constructing CPA-Secure En-cryption Schemes

• Mode of Operation

– Proof

• ctr 값이 반복되어 사용되었는지 , 반복되어 사용되지 않았는지를 기준으로 두 가지 경우로 구분할 수 있음– Case 1 : 어떤 카운터 값도 challenge ciphertext 의 카운터값과 중첩되지 않는 경우– Case 2 : 카운터 값 일부 또는 전체가 challenge ciphertext 의 카운터값과 중첩되는 경우

» Overlapi : ctri 가 반복되는 사건» Overlap : Overlapi 이 발생하는 사건

(3.7) ( )

1

Pr[ ] Pr[ ]q n

ii

Overlap Overlap

Page 67: 세미나 발표자료.pptx(676077) - 슬라이드 1

Sungkyunkwan University Information Security Group

2009 Summer Seminar 67

Constructing CPA-Secure En-cryption Schemes

• Mode of Operation

– Proof

• ctr* 에 대해 Overlapi 가 발생하는 경우 , ctri 의 범위는 아래와 같음ctr* + 1 – q(n) ≤ ctri ≤ ctr* + q(n) – 1

• 이를 바탕으로 Overlapi 의 확률을 계산하면 ,2 ( ) 1Pr[ ]2i n

q nOverlap

Page 68: 세미나 발표자료.pptx(676077) - 슬라이드 1

Sungkyunkwan University Information Security Group

2009 Summer Seminar 68

Constructing CPA-Secure En-cryption Schemes

• Mode of Operation

– Proof

• Overlapi 와 (3.7) 을 연합하면 다음 수식을 얻음 ;• 주어진 식들을 바탕으로 공격자 A 의 공격성공 가능성을 계산하면 아래와 같음

22 ( )Pr[ ]2nq nOverlap

,

, ,

,

2

Pr[Pr ( ) 1]

Pr[Pr ( ) 1^ ] Pr[Pr ( ) 1^ ]

Pr[ ] Pr[Pr ( ) 1| ]

2 ( ) 12 2

cpaA

cpa cpaA A

cpaA

n

ivK n

ivK n Overlap ivK n Overlap

Overlap ivK n Overlap

q n

Page 69: 세미나 발표자료.pptx(676077) - 슬라이드 1

Sungkyunkwan University Information Security Group

2009 Summer Seminar 69

Constructing CPA-Secure En-cryption Schemes

• Mode of Operation

– Proof

• q(n) 은 다항식이기 때문에 따라서 2q(n)2/2n 은 negligible• 따라서 수식 (3.6) 이 성립하므로 , 은 CPA-Secure• 이제 Random Function 대신 Pseudorandom Function 을 고려

– 대신 를 사용한 것에 지나지 않으며 이는 PPT 공격자 A 에게 영향을 미치지 않으므로 , Pseudorandom Function 을 사용한 역시 CPA-Secure

,1Pr[Pr ( ) 1] '( )2

cpaAivK n negl n

Page 70: 세미나 발표자료.pptx(676077) - 슬라이드 1

Sungkyunkwan University Information Security Group

2009 Summer Seminar 70

Constructing CPA-Secure En-cryption Schemes

• Mode of Operation

– Block Length and Security

• 살펴본 운영모드는 모두 (ECB 모드는 안전하지 않으므로 제외 ) IV 를 사용하고 있음• IV 는 다음 block 의 입력값을 항상 , 이전에 사용되지 않은 새로운 값으로 유지하는데 일조

– 한번 사용된 값이 다시 사용되면 , block cipher 는 위험해짐• 즉 , 이는 block cipher 의 안전성은 key k 의 길이 뿐만 아니라

block length 에도 의존함을 의미

Page 71: 세미나 발표자료.pptx(676077) - 슬라이드 1

Sungkyunkwan University Information Security Group

2009 Summer Seminar 71

Constructing CPA-Secure En-cryption Schemes

• Mode of Operation

– Other Modes of Operation

• 근래 다양한 운영모드가 소개되었고 , 각기 나름의 장점을 지니고 있지만 , 일반적으로 , CBC, CFB, CTR 모드가 CPA-Secure 가 요구되는 응용 프로그램에서 가장 널리 사용되고 있음

Page 72: 세미나 발표자료.pptx(676077) - 슬라이드 1

Sungkyunkwan University Information Security Group

2009 Summer Seminar 72

Constructing CPA-Secure En-cryption Schemes

• Mode of Operation

– Mode of Encryption and Message Tampering

• 대부분의 교재에서는 운영모드와 함께 공격자가 암호문을 수정하는 것에 대한 대응책을 소개하는데 , 본 교재에서는 운영모드를 설명하며 이러한 부분들을 포함시키지 않았음• 해당 내용은 다음 장에서 다루는데 , 본 장에서 설명한 운영모드들은 본 교재에서 정의하는 message integrity 를 충족하지 않음

Page 73: 세미나 발표자료.pptx(676077) - 슬라이드 1

Sungkyunkwan University Information Security Group

2009 Summer Seminar 73

Constructing CPA-Secure En-cryption Schemes

• Mode of Operation

– Stream Cipher versus Block Cipher

• OFB 모드나 CTR 모드는 “ Stream Cipher Mode” 로 동작할 수 있음– Single stream 을 생성하는데 사용하면 되므로 가능함

• Q : Stream Cipher 와 Block Cipher 중 어떤 것이 더 적합한가 ?– Stream Cipher 의 장점은 효율성– 따라서 주로 PDA 나 휴대폰과 같이 제한된 성능을 지닌 장치에서 주로 사용됨

• Stream Cipher 에 문제점이 자주 발생하는 이유는 Stream Cipher를 잘못 적용하고 있기 때문

Page 74: 세미나 발표자료.pptx(676077) - 슬라이드 1

74

SECURITY AGAINST CHO-SEN-CIPHER ATTACK(CCA)

Chapter 3.7

Page 75: 세미나 발표자료.pptx(676077) - 슬라이드 1

Sungkyunkwan University Information Security Group

2009 Summer Seminar 75

Security Against Chosen-Ci-pher Attack(CCA)

• Chosen-Cipher Attack

The CCA indistinguishability experiment :

1. A key k is generated by running Gen(1n)2. The adversary A is given input 1n and oracle access to Enck(.) and

Deck(.). It outputs a pair of messages m0, m1 of the same length.3. A random bit b ← {0, 1} is chosen, and then a ciphertext c ←

Enck(mb) is computed and given to A. We call c the challenge cipher-text.

4. The adversary A continues to have oracle access to Enck(.) and Deck(.), but is not allowed to query the latter on the challenge ci-phertext itself. Eventually, A outputs a bit b’.

5. The output of the experiment is defined to be 1 if b’=b, and 0 oth-erwise.

,Pr ( )ccaAivK n

Page 76: 세미나 발표자료.pptx(676077) - 슬라이드 1

Sungkyunkwan University Information Security Group

2009 Summer Seminar 76

Security Against Chosen-Ci-pher Attack(CCA)

• Chosen-Cipher Attack

Definition 3.30 A private-key encryption scheme has indis-tinguishable encryption under a chosen-ciphertext attack(or is CCA-secure) if for all probabilistic polynomial-time adversaries A there exists a negligible function negl such that :

where the probability is taken over all random coins used in the experiment.

,1Pr[Pr ( ) 1] ( ),2

ccaAivK n negl n

Page 77: 세미나 발표자료.pptx(676077) - 슬라이드 1

Sungkyunkwan University Information Security Group

2009 Summer Seminar 77

Security Against Chosen-Ci-pher Attack(CCA)

• Chosen-Cipher Attack

– CCA 는 공격자가 암호화 오라클과 복호화 오라클에 모두 접근할 수 있다는 점에서 CPA보다 강력한 공격– 제약사항

• 공격자는 복호화 오라클에는 무한정 접근할 수 있으나 , Challenge ci-phertext 자체에 대한 복호화를 요청할 수는 없음

• 즉 , 신뢰된 구성원 (party) 가 공격자가 선택한 암호문을 복호화 해주는 것은 아님• 제약사항이 없다면 ?

– 3.5 절에서 미군은 Midway 에 물이 떨어졌다는 거짓 정보를 흘리는 대신 , 암호문을 그대로 일본에 전송한 후 , 복호화가 되기를 감시하고 있었을 것임

Page 78: 세미나 발표자료.pptx(676077) - 슬라이드 1

Sungkyunkwan University Information Security Group

2009 Summer Seminar 78

Security Against Chosen-Ci-pher Attack(CCA)

• Chosen-Cipher Attack

– CCA 의 필요성• 만약 은행과 고객의 거래가 암호화되어 진행되는데 , 인증이 없다면 , 공격자는 특정 암호문의 해독을 요청하여 , 부분정보를 획득할 수 있음• Scheme 이 암호화를 적용하여 구성원의 인증을 구현하고 있는 경우 , 신뢰된 구성원은 공격자에게 복호화 오라클처럼 동작할 수 있으므로 ,

CCA-Secure 가 필요함

Page 79: 세미나 발표자료.pptx(676077) - 슬라이드 1

Sungkyunkwan University Information Security Group

2009 Summer Seminar 79

• Chosen-Cipher Attack

– Insecurity of the Scheme we have studied

• 본 절에서 설명한 모든 scheme 은 CCA-Secure 하지 않음• 예 ) Construction 3.24 에 대해 CCA 공격자를 가정

• 따라서 CCA-Secure scheme 은 Non-malleability 를 충족해야 함• 공격자가 주어진 암호문을 수정했을때 , 원래 평문과 공격자가 수정한 암호문이 연관성을 지니지 않는

scheme 을 Non-malleable scheme 이라고 함

1. 공격자 A 가 m0=0n, m1=1n 으로 선택하고 암호화 오라클로부터 c=<r, s>를 받음2. 공격자는 c 의 첫 번째 bit 만 변형한 c’ 에 대해 복호화를 요청3. c’≠c 이므로 복호화 오라클은 복호화를 수행4. 복호화된 값이 10n-1 이면 , b=0 이고 , 01n-1 이면 b=1

Security Against Chosen-Ci-pher Attack(CCA)

Page 80: 세미나 발표자료.pptx(676077) - 슬라이드 1

Sungkyunkwan University Information Security Group

2009 Summer Seminar 80

Q & A