31b67793e0a52ab3ead6b370cf7e7f87.ppt
- Количество слайдов: 34
SSL/TLS 군산대학교 전자정보공학부 보안 및 이동컴퓨팅 연구실
Agenda ▣ SSL (Secure Socket Layer) ▣ TLS (Transport Layer Security) P. 2
SSL / TLS ▣ SSL (Secure Socket Layer) ◈ 배경 : 1993년 웹 서버와 브라우저간의 안전한 통신을 위해 Netscape 社에 의해 개발 ◈ 특징 : 세션계층에서 적용되며, 응용계층의 FTP, TELNET, HTTP등의 프로 토콜의 안전성 보장 ◈ 서버 인증, 클라이언트 인증, 기밀성 보장 ◈ 현황 및 전망 : 현재 많은 전자 쇼핑 몰 업체에서 채택, 운영 ▣ TLS (Transport Layer Security) ◈ 배경 : SSL 3. 0 이 표준화된 이후 IETF는 1996년 6월부터 TLS 프로토콜에 대 한 표준화 (SSLv 3. 1) ◈ Backward compatible with SSLv 3 ◈ 특징 : SSL 3. 0을 기반으로 한 업그레이드 프로토콜 ◈ 현황 및 전망 : 현재 TLS 1. 0이 발표, 지속적 개발 예상 P. 3
SSL in USE P. 4
SSL 의 기능 ▣ 서버 인증 기능 ◈ 사용자는 서버의 신원을 확인 ◈ 서버의 certificate 와 public ID가 정당 확인 ◈ 클라이언트의 신뢰 된 인증 기관들의 목록에 서버의 인증 기관이 포함되었는지 를 확인 (표준 공개키 암호화 기술을 사용) ▣ 클라이언트 인증 ◈ 서버는 클라이언트의 신원을 확인 ◈ 클라이언트의 certificate 와 public ID가 정당 확인 ◈ 서버의 신뢰 된 인증기관 들의 목록에 클라이언트의 인증 기관이 포함되었는지 를 확인 (표준 공개키 암호화 기술을 사용) ▣ 암호화된 SSL 연결 ◈ 클라이언트와 서버 사이에 송/수신 되는 모든 정보는 암호화/복호화 + 무결성 P. 5
SSL Architecture ▣ connection ◈ Suitable type of service ◈ Peer-to-peer relationship ▣ session ◈ By handshake protocol P. 6
SSL의 구조 ▣ Management of SSL ◈ Handshake Protocol – Parameters (Session key, cryptography algorithm, authentication) ◈ Change Cipher Spec Protocol ◈ Alert Protocol ▣ Real security service ◈ SSL Record Protocol – Data encryption/decryption + Integrity P. 7
SSL 프로토콜 ▣ Handshake 프로토콜 ◈ 서버와 클라이언트간의 상호인증을 수행하고, 사용할 키 교환 방식, 대 칭키 암호 방식, HMAC 방식, 압축방식 등의 보안속성을 협상 ▣ Change Cipher Spec 프로토콜 ◈ Handshake 프로토콜에 의해 협상된 압축, MAC, 암호화 방식 등이 이후 부터 적용됨을 상대방에게 알림 ▣ Alert 프로토콜 ◈ 세션의 종료 또는 오류 발생시 이를 상대방에게 알림 ▣ Record 프로토콜 ◈ 상위계층 메시지들이 보안성이 유지되며 전송될 수 있도록 하기 위하여, 메시지 분할, 압축, 메시지 인증, 암호화 등의 작업을 수행 P. 8
SSL Record protocol P. 9
SSL Record protocol ▣ Confidentiality ◈ using symmetric encryption with a shared secret key defined by Handshake Protocol ◈ IDEA, RC 2 -40, DES, 3 DES, Fortezza, RC 4 -40, RC 4 -128 ◈ message is compressed before encryption ▣ Message integrity ◈ using a MAC with shared secret key ◈ similar to HMAC but with different padding P. 10
SSL Record protocol ▣ Fragmentation ◈ 2^14 byte(16348 byte) or less ▣ Compression ◈ Optional, lossless ◈ No compression in SSLv 3, TLS ▣ MAC ▣ Encryption ◈ IDEA, RC 2 -40, DES, 3 DES, Fortezza, RC 4 -40, RC 4 -128 P. 11
SSL Record protocol ▣ SSL record header ◈ Contents type(8 bits) ◈ Major Version(8 bits) ◈ Minor Version(8 bits) ◈ Compressed Length(16 bits) P. 12
Change Cipher Spec Protocol ▣ one of 3 SSL specific protocols which use the SSL Record protocol ▣ a single message ▣ causes pending state to become current ▣ hence updating the cipher suite in use P. 13
Alert Protocol ▣ convey SSL-related alert to peer entity ▣ 2 bytes : Fatal(5), alerts(7) § hand shake 과정에서 end-to-end 간 의 error 발생시 HTTP Prot: 21 Len: 2 Hand Shake Change Cipher Record Layer Version: 3. 0 Level Desc. Len: 0 Alert Warning : 1 Fatal : 2 TCP P. 14
Handshake Protocol ▣ 한 세션동안 이용되는 암호 매개변수 생성 ▣ 한 세션에서 사용되는 비밀정보를 공유 P. 15
Handshake Protocol ▣ Client Hello : 지원 가능한 {암호 방식, 키교환 방식, 서명 방식, 압축 방식}을 서버에게 알림. ▣ Server Hello : 수용 가능한 {암호 방식, 키교환 방식, 서명 방식, 압축 방식}을 응답. 이때 새로 운 세션 ID를 할당. ▣ Server Certificate (optional) : 서버측 공개키가 수납된 인증서를 보냄. ▣ Server Key Exchange (optional) : 서버가 직전에 송신한 Server Certificate 메시지에 수납된 인 증서의 내용만으로는 클라이언트가 premaster secret 값을 생성하기에 불충분한 경우에 추가 로 송신. ▣ Certificate Request (optional) : 클라이언트의 인증서를 요구. ▣ Server Hello Done : 서버의 hello 절차가 완료되었음을 알림. ▣ Client Certificate (optional) : 클라이언트측 공개키가 수납된 인증서를 보냄. ▣ Client Key Exchange : RSA 방식인 경우 클라이언트가 설정한 premaster secret 값을 서버의 공개키로 암호화 값이 수납됨. ▣ Certificate Verify (optional) : 클라이언트 자신이 Client Certificate에 수납된 공개키에 대응되 는 개인키를 ▣ 가지고 있음을 서명 값으로 서버에게 증명. ▣ Change Cipher Spec : 지금 암호화 방식이 변경되었으며, 이후 전송되는 것들은 모두 지금까지 협상되었던 Cipher. Spec과 키 값에 의해 암호화 및 압축되어 전송됨을 상대방에게 알림. ▣ Finished : 이 메시지는 지금까지의 협상 과정에서 설정된 암호화 알고리즘에 의해 암호화되어 송신되는 첫번째 메시지로서, 수신측은 이 메시지를 복호화하여 지금까지 협상절차가 정당한 지를 검사함 P. 16
Handshake Protocol Phase 1. Establish Security Capabilities protocol version, session ID, cipher suite, compression method, initial RN Phase 2. Server Authentication and Key Exchange key exchange, request certificate Phase 3. Client Authentication and Key Exchange client sends key exchange, certificate verificaiton Phase 4. Finish change cipher suite, finish P. 17
1 Client. Hello Server. Hello Certificate 3 Server. Key. Exchange Note: Optional or situation-dependent messages that are not always sent 2 4 클 Certificate. Request Server. Hello. Done 라 언 트 7 Client. Key. Exchange 9 6 Certificate 8 이 5 서 Certificate. Verify 10 Change. Cipher. Spec 11 Finished 버 Change. Cipher. Spec Finished 12 13 P. 18
Phase 1. Establish Security Capabilities 1. Client_Hello Message Prot: 22 …Length Version: 3. 0 Length… Type: 1 Length… Value Cipher Suite 0, 0 0, 1 Client. Random. Value (32 bit+28 bytes) ID len Session ID Cipher. Suite length Cipher. Suite 2 Cmp len Cmp 1 Cipher. Suite 1 … … Cipher. Suite n ……… Cmp n SSL_RSA_WITH_NULL_MD 5 0, 2 SSL_RSA_WITH_NULL_SHA 0, 4 SSL_RSA_WITH_RC 4_128_MD 5 0, 5 Version: 3. 0 SSL_NULL_WITH_NULL SSL_RSA_WITH_RC 4_128_SHA 0, 7 …Length SSL_RSA_WITH_IDEA_CBC_SHA : : 0, 30 SSL_FORTEZZA_DMS_WITH_RC 4_128_SHA P. 19
Cipher Suite (Netscape 7. 1) P. 20
Phase 1. Establish Security Capabilities (cont’d) 2. Server_Hello Message Prot: 22 …Length Version: 3. 0 Type: 2 …Length… Version: 3. 0 Client. Random. Value (32 bit+28 bytes) ID len Session ID(option) Cipher. Suite Cmp Client_Hello의 cipher suite list에서 한개를 선택한다 P. 21
1 Client. Hello Server. Hello Certificate 3 Server. Key. Exchange Note: Optional or situation-dependent messages that are not always sent 2 4 클 Certificate. Request Server. Hello. Done 라 언 트 7 Client. Key. Exchange 9 6 Certificate 8 이 5 서 Certificate. Verify 10 Change. Cipher. Spec 11 Finished 버 Change. Cipher. Spec Finished 12 13 P. 22
Phase 2. Server Authentication and Key Exchange 3. Certificate Message Prot: 22 …Length Version: 3. 0 Type: 11 Length… Certificate Chain Length Certificate 1 ……… Certificate n Length CA CA Certificate n CA P. 23
Phase 2. Server Authentication and Key Exchange (cont’d) 4. Server. Key. Exchange Message Prot: 22 …Length Version: 3. 0 Length… Type: 12 …Length… RSA mod length mod value RSA… RSA exp length RSA exp value Signed MD 5 hash (16 bytes) n값 § C = Me(mod n) e값 P. 24
Phase 2. Server Authentication and Key Exchange (cont’d) 5. Certificate. Request Message CT Value Certificate Type 1 2 …Length Type: 13 …Length CT length . . . Length… CT n CT 1 CT 2 DSS sign with fixed Diffie-Hellman 5 RSA sign with ephemeral 6 Length… RSA sign with fixed Diffie-Hellman 4 Version: 3. 0 DSS sign 3 Prot: 22 RSA sign DSA sign with ephemeral 20 Fortezza DMS CAs length CA 1 length DN(Distinguished Name) of CA 1 ……… Server가 받아들일 수 있는 인증기관 List P. 25
1 Client. Hello Server. Hello Certificate 3 Server. Key. Exchange Note: Optional or situation-dependent messages that are not always sent 2 4 클 Certificate. Request Server. Hello. Done 라 언 트 7 Client. Key. Exchange 9 6 Certificate 8 이 5 서 Certificate. Verify 10 Change. Cipher. Spec 11 Finished 버 Change. Cipher. Spec Finished 12 13 P. 26
Phase 3. Client Authentication and Key Exchange 7. Certificate Message ◈ If the server has requested a certificate, – The client sends a certificate message P. 27
Phase 3. Client Authentication and Key Exchange (cont’d) 8. Client. Key. Exchange Message Prot: 22 …Length Version: 3. 0 Type: 16 Length… Encrypted Premaster Secret Server의 공개키로 암호화 48 bytes random value P. 28
Master Secret Generation Procedure ‘A’ SHA Premaster Secret ‘BB’ Client Random Premaster Secret ‘CCC’ SHA Server Random Client Random Premaster Secret Server Random Client Random Server Random SHA Premaster Secret MD 5 Hash Premaster Secret Hash MD 5 Hash Master Secret ( 48 bytes ) P. 29
Key Material generation procedure ‘A’ SHA Master Secret ‘BB’ Server Random Master Secret ‘CCC’ SHA Client Random Server Random Master Secret Client Random Server Random Client Random SHA Master Secret MD 5 Hash . . . Master Secret MD 5 Hash Master Secret Hash MD 5 Hash Key Material Hash . . . P. 30
1 Client. Hello Server. Hello Certificate 3 Server. Key. Exchange Note: Optional or situation-dependent messages that are not always sent 2 4 클 Certificate. Request Server. Hello. Done 라 언 트 7 Client. Key. Exchange 9 6 Certificate 8 이 5 서 Certificate. Verify 10 Change. Cipher. Spec 11 Finished 버 Change. Cipher. Spec Finished 12 13 P. 31
Phase 4. Finish 10. Change. Cipher. Spec Message ◈ Pending Cipher. Spec into the current one ◈ Record Layer에서 테이터 암호화 때 클라이언트와 서버간 서로 약속한 암호화 알고리즘 사용한다는 것을 통보 P. 32
Phase 4. Finish (cont’d) 11. Finished Message Prot: 22 56 36 Version: 3. 0 Type: 20 Len: 0 MD 5 hash (16 bytes) Len: 0 0 Handshake message SHA hash (20 bytes) MD 5 Message Authentication Code (16 bytes) Encrypted MAC P. 33
Transport Layer Security (TLS) ▣ IETF standard RFC 4346 similar to SSLv 3 ▣ with minor differences ◈ in record format version number – Major : 3, minor : 1 ◈ uses HMAC for MAC ◈ has additional alert codes ◈ some changes in supported ciphers – With except of Fortezza ◈ changes in certificate negotiations ◈ changes in use of padding(1, 9, 17…. , 249 bytes) P. 34
31b67793e0a52ab3ead6b370cf7e7f87.ppt