Chapter 9 Simple Authentication Protocols

56
Chapter 9 Simple Authentication Protocols Chapter 9 Simple Authentication protocols 1

description

Chapter 9 Simple Authentication Protocols. 프로토콜들. Human protocols  사람들의 상호 관계에서 따라야 할 규칙들 예 : 수업 중에 질문하기 Networking protocols  네트워크 시스템에서 따라야 할 규칙들 예 : HTTP, FTP, 등등 . Security protocols  보안 응용에서 따라야 할 ( 통신상의 ) 규칙들 예 : SSL, IPSec, Kerberos, 등등. Protocols. - PowerPoint PPT Presentation

Transcript of Chapter 9 Simple Authentication Protocols

Page 1: Chapter 9 Simple Authentication Protocols

Chapter 9Simple

Authentication Protocols

Chapter 9 Simple Authentication protocols

1

Page 2: Chapter 9 Simple Authentication Protocols

프로토콜들

Human protocols 사람들의 상호 관계에서 따라야 할 규칙들 예 : 수업 중에 질문하기

Networking protocols 네트워크 시스템에서 따라야 할 규칙들 예 : HTTP, FTP, 등등 .

Security protocols 보안 응용에서 따라야 할 ( 통신상의 ) 규칙들 예 : SSL, IPSec, Kerberos, 등등 .

Chapter 9 Simple Authentication protocols

2

Page 3: Chapter 9 Simple Authentication Protocols

Protocols

프로토콜 결함은 대단히 미묘한 문제이다 . 몇 가지 잘 알려진 보안 프로토콜은 심각한

오류를 갖고 있다 . 예 : IPSec, GSM, WEP

자주 , 구현을 할 때 에러가 발생된다 . IE 에서 SSL 의 구현

프로토콜이 올바른지 판단하는 것도 힘들고 프로토콜을 올바르게 사용하는 것도 힘들다 .

Chapter 9 Simple Authentication protocols

3

Page 4: Chapter 9 Simple Authentication Protocols

이상적인 보안 프로토콜

1. 보안 요구사항을 만족 요구사항이 분명해야 한다 .

2. 효율성 요구되는 계산을 최소화 특히 공개키 연산 지연과 대역 사용을 최소화

3. 견고성 공격자가 공격을 하는 중에도 동작해야 한다 . 환경이 변하더라도 동작해야 한다 .

4. 사용하기 용이 , 구현 용이 , 유연성 , 등등 . 이러한 모든 조건을 충족하기는 힘들다 !

Chapter 9 Simple Authentication protocols

4

Page 5: Chapter 9 Simple Authentication Protocols

Simple Security Protocols

Chapter 9 Simple Authentication protocols

5

Page 6: Chapter 9 Simple Authentication Protocols

NSA 에 들어가는 절차

1. 출입증을 판독기

(reader) 에 넣는다 .

2. PIN 을 입력한다 .

3. PIN 이 올바른가 ?

Yes? 입장

No? 경비원이

사살6

Page 7: Chapter 9 Simple Authentication Protocols

ATM 기계 프로토콜

1. ATM 카드를 넣는다 .

2. PIN 을 입력한다 .

3. PIN 이 올바른가 ?

Yes? 거래를

수행한다 .

No? 기계가

카드를 삼켜버린다 .

Chapter 9 Simple Authentication protocols

7

Page 8: Chapter 9 Simple Authentication Protocols

아군과 적군을 구별하기 (IFF)

Chapter 9 Simple Authentication protocols

Namibia

Angola

1. N

2. E(N,K)SAAFImpala

RussianMIG

8

군대는 많은특별한 프로토콜을 필요로 한다 .

많은 경우 적군을 아군으로 오인하거나 … .

Page 9: Chapter 9 Simple Authentication Protocols

MIG in the Middle

Chapter 9 Simple Authentication protocols

Namibia

Angola

1. N

2. N

3. N4. E(N,K)

5. E(N,K)

6. E(N,K)

SAAFImpala

RussianMiG

9

Page 10: Chapter 9 Simple Authentication Protocols

인증 프로토콜Authentication Protocols

Chapter 9 Simple Authentication protocols

10

Page 11: Chapter 9 Simple Authentication Protocols

인증 (Authentication)

Alice 는 Bob 에게 자신을 증명해야 한다 . Alice 와 Bob 은 사람일수도 혹은 기계일 수도 있다 .

Bob 도 역시 자신의 존재를 증명해야 할지도 모른다 . ( 상호 인증 )

세션 키 (session key) 를 설정할 필요가 있을 수 있다 .

다른 요구사항이 있을 수 있다 . 오직 공개키 만을 사용한다 . 오직 대칭키 만을 사용한다 . 오직 해시 함수 만을 사용한다 . 익명성 , 합리적인 부인 등등 .

Chapter 9 Simple Authentication protocols

11

Page 12: Chapter 9 Simple Authentication Protocols

인증 독립 (stand-alone) 컴퓨터에서의 인증은

비교적 쉽다 . “ 안전한 경로”가 주요한 이슈 주요 관심사는 인증 소프트웨어에 대한 공격이다 .

네트워크 상에서의 인증은 훨씬 복잡하다 . 공격자는 메시지를 관찰할 수 있다 . 공격자는 메시지를 재사용할 수 있다 . 적극적인 공격을 할 수 있다 . ( 삽입 , 삭제 , 내용

변경 )

Chapter 9 Simple Authentication protocols

12

Page 13: Chapter 9 Simple Authentication Protocols

단순한 인증

독립 (standalone) 시스템에서는 문제가 없을지 모른다 .

하지만 네트워크에서는 안전하지 않다 . 재사용 공격 (replay) 을 받을 수 있다 .( 다음 2 slides) Bob 은 Alice 의 암호를 알아야 한다 .

Chapter 9 Simple Authentication protocols

Alice Bob

“I’m Alice”

Prove it

My password is “frank”

13

Page 14: Chapter 9 Simple Authentication Protocols

인증 공격

Chapter 9 Simple Authentication protocols

Alice Bob

“I’m Alice”

Prove it

My password is “frank”

Trudy

14

Page 15: Chapter 9 Simple Authentication Protocols

인증 공격

재사용 (replay) 공격 어떻게 재사용 공격을 막을 수 있는가 ?

Chapter 9 Simple Authentication protocols

Bob

“I’m Alice”

Prove it

My password is “frank”Trudy

15

Page 16: Chapter 9 Simple Authentication Protocols

단순 인증

훨씬 효율적이다… 그러나 앞의 경우와 같은 문제가 생긴다 .

재사용 공격

Chapter 9 Simple Authentication protocols

Alice Bob

I’m Alice, My password is “frank”

16

Page 17: Chapter 9 Simple Authentication Protocols

더 나은 인증

Alice 의 암호를 숨길 수 있으므로 더 좋다 . 그러나 여전히 재사용 공격이 가능하다 .

Chapter 9 Simple Authentication protocols

Alice Bob

“I’m Alice”

Prove it

h(Alice’s password)

17

Page 18: Chapter 9 Simple Authentication Protocols

질문 - 응답 (Challenge-Response)

재사용을 막기 위해 , 질문 - 응답을 사용한다 . Bob 이 Alice 를 인증하려고 한다 .

Bob 은 Alice 에게 질문을 한다 . 오직 Alice 만이 올바른 답을 할 수 있다 . 질문은 재사용이 불가능하도록 해야 한다 .

어떻게 그것을 할 수 있는가 ? 암호는 Alice 만이 알고 있는 것이다 . 일회성을 보증하기 위해서 “nonce (number

used once)” 를 사용한다 .

Chapter 9 Simple Authentication protocols

18

Page 19: Chapter 9 Simple Authentication Protocols

질문 - 응답

Bob

“I’m Alice”

Nonce

h(Alice’s password, Nonce)

Nonce 가 challenge hash 가 response Nonce 는 재사용을 막아준다 . 오직 단 한번만

사용된다 . Password 는 Alice 가 알고 있는 것이다 .Bob 은 Alice 의 암호를 알고 있어야 한다 ( 검증

가능 ).

Alice

19

Page 20: Chapter 9 Simple Authentication Protocols

질문 - 응답

이것을 위해 무엇을 사용해야 하는가 ? 암호의 Hash 는 OK, 암호화는 더 좋다 . Symmetric key, Public key, 등에서 더

논의할 것이다 .

Chapter 9 Simple Authentication protocols

Bob

“I’m Alice”

Nonce

오직 Alice 만이 갖고 있는 것

Alice ( 그리고 Bob 이 검증할 수 있는 것 )

20

Page 21: Chapter 9 Simple Authentication Protocols

대칭키 표기법

평문 P 를 키 K 로 암호화 C = E(P,K)

암호문 C 를 K 로 복호화 P = D(C,K)

여기서 우리가 관심을 갖는 것은 프로토콜에 대한 공격이지 암호화 알고리즘에 대한 것은 아니다 .

암호화 알고리즘은 안전하다고 가정한다 .

Chapter 9 Simple Authentication protocols

21

Page 22: Chapter 9 Simple Authentication Protocols

대칭키를 사용한 인증

Alice 와 Bob 은 대칭키 KAB 를 공유한다 .

키 KAB 는 오직 Alice 와 Bob 만 알고 있다 .

대칭키를 알고 있다는 것으로 인증을 한다 . 어떻게 이것을 할 수 있나 ?

키를 남이 알게 해서는 안 된다 . 재사용 공격을 허용해서는 안 된다 .

Chapter 9 Simple Authentication protocols

22

Page 23: Chapter 9 Simple Authentication Protocols

대칭키를 사용한 인증

Chapter 9 Simple Authentication protocols

Alice, KABBob, KAB

“I’m Alice”

E(R,KAB)

Bob 이 Alice 를 인증하는 안전한 방법 Alice 는 Bob 을 인증하고 있지는 않다 . 상호 인증을 할 수 있을까 ?

R

23

Page 24: Chapter 9 Simple Authentication Protocols

상호 인증 ?

무엇이 잘못되었는가 ? 재사용 공격

“Alice” 는 Trudy 일 수 있다 ( 혹은 다른 누구 )!

Chapter 9 Simple Authentication protocols

Alice Bob

“I’m Alice”, R

E(R,KAB)

E(R,KAB)

24

Page 25: Chapter 9 Simple Authentication Protocols

상호 인증

안전한 단방향 (one-way) 인증 프로토콜을 갖고 있으므로…

단방향 프로토콜을 두 번 사용하는 것이다 . 한번은 Bob 이 Alice 를 인증하기 위해서 한번은 Alice 가 Bob 을 인증하기 위해서

이것은 성공할 수 있는가 ?

Chapter 9 Simple Authentication protocols

25

Page 26: Chapter 9 Simple Authentication Protocols

상호 인증

상호 인증이 가능하다 . 이것은 안전한가 ?

Chapter 9 Simple Authentication protocols

Alice Bob

“I’m Alice”, RA

RB, E(RA,KAB)

E(RB,KAB)

26

Page 27: Chapter 9 Simple Authentication Protocols

상호 인증 공격

Chapter 9 Simple Authentication protocols

Bob

1. “I’m Alice”, RA

2. RB, E(RA,KAB)

Trudy

Bob

3. “I’m Alice”, RB

4. RC, E(RB,KAB)

Trudy

5. E(RB,KAB)

27

Page 28: Chapter 9 Simple Authentication Protocols

상호 인증

지금의 단방향 인증 프로토콜은 상호 인증에는 안전하지 않다 .

프로토콜은 미묘하다 ! “ 명백하다” 고 안전한 것은 아니다 . 또한 , 가정이나 환경이 바뀌면 프로토콜은

성공하지 않을 수 있다 . 이것이 프로토콜이 실패하는 공통된 원인이다 .

Chapter 9 Simple Authentication protocols

28

Page 29: Chapter 9 Simple Authentication Protocols

대칭키를 사용한 상호 인증

이와같은 “사소한” 추가가 도움이 될까 ? Yes!

Chapter 9 Simple Authentication protocols

Alice Bob

“I’m Alice”, RA

RB, E(“Bob”,RA,KAB)

E(“Alice”,RB,KAB)

29

Page 30: Chapter 9 Simple Authentication Protocols

공개키 표기법

Alice 의 공개키로 M 을 암호화 : {M}Alice

Alice 의 개인키로 M 을 서명 ( 복호화 ) : [M]Alice

그러면 [{M}Alice ]Alice = M

{[M]Alice }Alice = M

누구도 공개키 연산을 할 수 있다 . 오직 Alice 만이 자신의 개인키를 사용할 수

있다 . (sign)

Chapter 9 Simple Authentication protocols

30

Page 31: Chapter 9 Simple Authentication Protocols

공개키를 사용한 인증

이것은 안전한가 ? Trudy 는 Alice 가 어떤 것이건 복호화하게 만들 수

있다 ! 암호화를 위해서 키를 사용해서는 안된다 . 두 개의 키 쌍을 사용해야 한다 .

Alice Bob

“I’m Alice”

{R}Alice

R

31

Page 32: Chapter 9 Simple Authentication Protocols

공개키를 사용한 인증

이것은 안전한가 ? Trudy 는 Alice 가 어떤 것이건 암호화하게 만들 수 있다 !

암호화를 위해서 키를 사용해서는 안된다 . 두 개의 키 쌍을 사용해야 한다 .

Alice Bob

“I’m Alice”

R

[R]Alice

32

Page 33: Chapter 9 Simple Authentication Protocols

공개키

암호화와 서명을 하는데 같은 키를 사용해서는 안 된다 . 암호화 /복호화를 위해서 하나의 키 쌍을

사용하고 또 다른 키 쌍은 서명과 증명을 위해서

사용한다 .

Chapter 9 Simple Authentication protocols

33

Page 34: Chapter 9 Simple Authentication Protocols

세션 키 (Session Key)

세션 키 : 일정 시간 동안 사용하는 임시적인 키

세션 키를 필요로 하는 이유 . 특정 세션을 위한 대칭키로 사용을 제한한다 . 세션키가 손상되더라도 피해를 줄일 수 있다 .

어떤 경우에는 완전 순방향 비밀성 (perfect forward secrecy (PFS)) 을 요구할 수도 있다 .

Chapter 9 Simple Authentication protocols

34

Page 35: Chapter 9 Simple Authentication Protocols

이것은 안전한가 ? 키에 대해서는 OK, 하지만 상호 인증은 아님

K 는 Bob 의 nonce 와 같은 역할 Alice 는 Bob 을 인증할 수 없다 .

Chapter 9 Simple Authentication protocols

“I’m Alice”, R

{R,K}Alice

{R +1,K}Bob

Alice Bob

35

공개키 인증과 세션 키 Alice 와 Bob 의 암호화를 사용

Page 36: Chapter 9 Simple Authentication Protocols

공개키 인증과 세션 키

이것은 안전한가 ? 상호 인증은 되나 키는 안전하지 않다 !

Chapter 9 Simple Authentication protocols

Alice Bob

“I’m Alice”, R

[R,K]Bob

[R +1,K]Alice

36

Alice 와 Bob 의 서명을 사용

Page 37: Chapter 9 Simple Authentication Protocols

공개키 인증과 세션 키

이것은 안전한가 ? 안전한 것처럼 보인다 . 상호 인증과 세션 키는 안전 !

Chapter 9 Simple Authentication protocols

Alice Bob

“I’m Alice”, R

{[R,K]Bob}Alice

{[R +1,K]Alice}Bob

37

먼저 서명 그리고 암호화

Page 38: Chapter 9 Simple Authentication Protocols

이것은 안전한가 ? 안전한 것처럼 보인다 .

모두 {R,K}Alice 와 {R +1,K}Bob 을 볼 수 있지만

Chapter 9 Simple Authentication protocols

Alice Bob

“I’m Alice”, R

[{R,K}Alice]Bob

[{R +1,K}Bob]Alice

38

공개키 인증과 세션 키 먼저 암호화하고 서명

Page 39: Chapter 9 Simple Authentication Protocols

완전 순방향 비밀성 (Forward Secrecy)

걱정 거리… Alice 는 공유키 KAB 로 암호화하고 암호문을 Bob

에게 보낸다 . Trudy 는 암호문을 보관하고 있다가 나중에 Alice

의 컴퓨터를 공격해서 키 KAB 를 찾아낸다 . 그리고 Trudy 는 보관했던 암호문을 해독한다 .

완전 순방향 비밀성 (PFS): 비록 Trudy 가 키를 알아냈다 하더라도 Trudy 는

나중에 암호문을 복호화할 수 없도록 하는 것이다 .

PFS 는 가능할까 ?

Chapter 9 Simple Authentication protocols

39

Page 40: Chapter 9 Simple Authentication Protocols

완전 순방향 비밀성

PFS 를 위해서 , Alice 와 Bob 은 KAB 을 사용하여 암호화해서는 안된다 .

대신 그들은 세션키 KS를 사용하고 사용한 후에는 세션키를 없애야 한다

문제 : 어떻게 Alice 와 Bob 은 세션키 KS를 합의하고 PFS 를 보장할 수 있을까 ?

Chapter 9 Simple Authentication protocols

40

Page 41: Chapter 9 Simple Authentication Protocols

순진한 세션키 프로토콜

Trudy 는 E(KS,KAB) 를 보관할 수 있다 . 만약 나중에 Trudy 가 KAB 을 찾아내면 , 그는

KS도 일 수 있다 .

Chapter 9 Simple Authentication protocols

Alice, KAB Bob, KAB

E(KS, KAB)

E(messages, KS)

41

Page 42: Chapter 9 Simple Authentication Protocols

완전 순방향 비밀성 Diffie-Hellman 을 사용한다 . Diffie-Hellman: g 와 p 는 공개됨

하지만 Diffie-Hellman 은 MiM 공격을 받을 수 있다 .

어떻게 MiM 을 막으면서 PFS 을 이룰 수 있나 ?

Alice, a Bob, b

ga mod p

gb mod p

42

Page 43: Chapter 9 Simple Authentication Protocols

완전 순방향 비밀성

세션 키 KS = gab mod p 를 구하고 Alice 는 a 를 , Bob 은 b 를 잊어버린다 . 일회성 (ephemeral) Diffie-Hellman Alice 와 Bob 조차도 KS 를 복구할 수 없다 . 다른 방법은 ?

Chapter 9 Simple Authentication protocols

Alice, a Bob, b

E(ga mod p, KAB)

E(gb mod p, KAB)

43

Page 44: Chapter 9 Simple Authentication Protocols

상호 인증 , 세션키와 PFS

Chapter 9 Simple Authentication protocols

Alice Bob

“I’m Alice”, RA

RB, [{RA, gb mod p}Alice]Bob

[{RB, ga mod p}Bob]Alice

세션키는 K = gab mod p Alice 는 a 를 , Bob 은 b 을 잊어버린다 . 만약 Trudy 가 나중에 Bob 과 Alice 의

비밀을 알아내더라도 , 세션키 K 를 복구할 수 없다 .

44

Page 45: Chapter 9 Simple Authentication Protocols

타임스탬프 (Timestamps)

타임스탬프 T 는 현재 시간 타임스탬프는 많은 프로토콜에서 사용된다 .

(Kerberos) 타임스탬프는 교환하는 메시지의 수를 줄일 수

있다 . 마치 둘이 미리 알고 있는 nonce 와 같다 .

그러나 타임스탬프틀 사용할 때 시간은 보안에 중요한 파라메터라는 것을 기억해야 한다 .

시간은 결코 같을 수 없다 , 항상 시간 오차가 존재한다 . – 재사용 공격의 위험이 있다 .

어느 정도 까지 시간 오차를 허용할 수 있을까 ?

Chapter 9 Simple Authentication protocols

45

Page 46: Chapter 9 Simple Authentication Protocols

타임스탬프 (T) 로 공개키 인증

Chapter 9 Simple Authentication protocols

Bob

“I’m Alice”, {[T,K]Alice}Bob

{[T +1,K]Bob}Alice

Alice

이것은 ( 서명 - 암호화 ) 안전한가 ? 괜찮아 보인다 .

46

Page 47: Chapter 9 Simple Authentication Protocols

Chapter 9 Simple Authentication protocols

Bob

“I’m Alice”, [{T,K}Bob]Alice

[{T +1,K}Alice]Bob

Alice

이것은 ( 암호화 - 서명 ) 안전한가 ? Trudy 는 {T,K}Bob 을 알기 위해서 Alice 의

공개키를 사용할 수 있다 .( 다음 slide)

47

타임스탬프 (T) 로 공개키 인증

Page 48: Chapter 9 Simple Authentication Protocols

Chapter 9 Simple Authentication protocols

Bob

“I’m Trudy”, [{T,K}Bob]Trudy

[{T +1,K}Trudy]Bob

Trudy

Trudy 는 {T,K}Bob 을 알 수 있다 . Trudy 는 Alice-Bob 의 세션키 K 를 알 수

있다 . 주의 : Trudy 는 반드시 시간 오차 안에

행동해야 한다 . 48

타임스탬프 (T) 로 공개키 인증

Page 49: Chapter 9 Simple Authentication Protocols

타임스탬프 (T) 로 공개키 인증

Chapter 9 Simple Authentication protocols

Bob

“I’m Alice”, [{T,K}Bob]Alice

[{T +1}Alice]Bob

Alice

앞의 프로토콜에서 Alice 는 굳이 세션키 (K)를 다시 보낼 필요가 없다 .

이렇게 간단히 수정을 한다면 안전한가 ? Yes, 괜찮아 보인다 . “ 서명하고 암호화”도 괜찮은가 ?

49

Page 50: Chapter 9 Simple Authentication Protocols

공개키 인증 Nonce 와 함께 서명하고 암호화…

안전 Nonce 와 함께 암호화하고 서명…

안전 타임스탬프와 함께 서명하고 암호화…

안전 타임스탬프와 함께 암호화하고 서명…

안전하지 않음

프로토콜은 미묘하다 !

Chapter 9 Simple Authentication protocols

50

Page 51: Chapter 9 Simple Authentication Protocols

Authentication and TCP

Chapter 9 Simple Authentication protocols

51

Page 52: Chapter 9 Simple Authentication Protocols

TCP-based Authentication

TCP 는 인증 프로토콜로 사용하기 위해서 만들어지지 않았다 .

하지만 TCP 연결에서 IP 주소는 자주 인증을 위해서 사용된다 .

Chapter 9 Simple Authentication protocols

52

Page 53: Chapter 9 Simple Authentication Protocols

TCP 3-way Handshake

Chapter 9 Simple Authentication protocols

Alice Bob

SYN, SEQ a

SYN, ACK a+1, SEQ b

ACK b+1, data

처음 SEQ 번호는 반드시 랜덤값이어야 한다 .

53

Page 54: Chapter 9 Simple Authentication Protocols

TCP Authentication Attack

Chapter 9 Simple Authentication protocols

Alice

BobTrudy

1. SYN, SEQ = t (as Trudy)2. SYN, ACK = t+1, SEQ = b13. SYN, SEQ = t (as Alice)

4. SYN, A

CK = t+1, S

EQ = b 2

5. ACK = b2+1, data

5.

5.

5.

5.

54

Page 55: Chapter 9 Simple Authentication Protocols

TCP Authentication Attack

Chapter 9 Simple Authentication protocols

Random SEQ numbers Initial SEQ numbersMac OS X

만약 초기 SEQ 번호가 랜덤하지 않으면… … 초기 SEQ 번호를 예측할 수도 있고… … 그러면 앞 슬라이드에서 보여준 공격이 가능하다 .

55

Page 56: Chapter 9 Simple Authentication Protocols

TCP Authentication Attack

Trudy 는 Bob 이 보내는 것을 볼 수는 없지만 , Alice 처럼 위장해서 Bob 에게 패킷을 보낼 수는 있다 .

Trudy 는 Alice 가 Bob 으로부터 패킷을 받는 것을 막아야 한다 . ( 그렇지않으면 연결이 끊어지게 된다 .)

만약 암호가 필요하면 , 이 공격은 실패한다 . 만약 TCP 연결 프로토콜을 인증에 사용한다면 이

공격은 가능하다 . TCP 를 인증에 사용하는 것은 나쁜 방법이다 .

Chapter 9 Simple Authentication protocols

56