알아두면 유용한 데이터 암호화 이야기
(공인인증서, HTTPS)
▪ 목차
• 암호화?
✔ 암호화의 정의 및 역할
✔ 암호화 방법
✔ 암호화 종류
▪ 공인인증서
▪ HTTPS
▪ OTP
▪ 암호화의 정의및 역할
1. 정의
2. 역할
1. 기밀성(Confidentiality)
2. 무결성(Integrity)
3. 인증(Authentication)
4. 부인방지(Non-repudiation)
⊕ ⊕
원문(plain text) 암호문(cipher text)
암호화키(encryption key) 공개된 네트워크/시스템
(public network/system)
복호화키(decryption key)
암호화알고리즘
(Cryptography algorithm)
암호화(encryption) 복호화(decryption)
암호문(cipher text) 원문(plain text)
암호화알고리즘
(Cryptography algorithm)
?
▪ 암호화방법
1. 대체(substitution)
1. 비트, 문자 또는 문자의 블록을 다른 비트,문자 또는 블록으로 대체
Ci = E(Pi) = Pi+3
2. 치환(transposition/permutation)
1. 메시지의 문자를 재배치
평문 a b c d e f g h i j k l m n o p q r s t u v w x y z
암호문 D E F G H I J K L M N O P Q R S T U V W X Y Z A B C
혼돈(confusion )
Col1 Col2 Col3
Row1 a t t
Row2 a c K
Row3 x a T
Row4 x d A
row5 w n x
Col1 Col3 Col2
Row3 x a T
row5 w n x
Row1 a t t
Row4 x A d
Row2 a c K
확산(diffusion)
attacKxaTxdAwnx xaTwnxattxAdacK
▪ 암호화종류
암호화
양방향
(암호화/복호화)
일방향
(암호화)
대칭키(암호화키 = 복호화키)
(Symmetric key)
비대칭키(암호화키 ≠ 복호화키) : RSA, ECC, DG, Elgamal, DSA
(Asymmetric key)
MDC : SHA256, SHA1, MD5…
(Modification Detection Code)
MAC : HMAC, NMAC, CBC-MAC…
(Message Authentication Code)
스트리밍 : OTPad, Rc4…
(Stream Ciphers)
블록 (Block Ciphers)
DES,SEED,AES,ARIA
…
Feistel
SPN
알고리즘구조
ECB(Electric CodeBook mode)
CBC(Cipher Block Chaining mode)
암호모드
CFB(Cipher Feedback mode)
OFB(Output Feedback)
CTR(Counter)
기밀성(Confidentiality)
기밀성(Confidentiality)
인증(Authenticaiton)
부인방지(Non-repudiation)
인증(Authenticaiton)
무결성(Integrity)a
무결성(Integrity)
▪ PKI(Public Key Infrastructure)
CA(Cartification authority)
(Root)CA(Cartification authority)
RA(Registration authority) LDAP(lightweight directory access protocol)
OCSP(Online Certificate Status Protocol)
KICA : 한국정보인증
SignKorea : 코스콤
Yessign : 금융결제원
crossCert : 한국전자인증
TradeSign : 한국무역정보통신
User
한국인터넷진흥원
(KISA)
Other Country CA
USA : Verisign
TTP (Trusted Third Party)
- 인증서, CRL게시
- 타인증기관DS와의 연계
개인키, 공개키 생성
- 인증서, CRL 생성관리
- 등록관리, 정책관리, 가입자관리
- 신원정보확인/등록
▪ 공인인증서
공인인증서 : 공개키(public key)
개인키(private key)
데이터 규약 : ASN.1(ber/der)
PKCS5 : 패스워드기반 암호 표준
PKCS8 : 개인 키 정보 구문 표준
X.509 : 디지털 인증서 구조 표준
Counter(iterator)
salt
key
인증서 경로(certificate path)
개인키암호화방법
▪ PBE(Password Based Encryption)
• KEY DERIVATION → DECRYPTION
개인키(private key)
(Key Encryption Key)
(Random number generator
/ Pseudorandom number generator)
▪ 공인인증서 - 인증경로
▪ 공인인증서 - 유효성검사
주민등록번호/사업자번호
실명
▪ 전자서명
원문
(Plain text)
메세지다이제스트
(Message Digest)
해쉬
Hash function
전자서명
(Digital Signature)
암호화
Encryption
(개인키)
원문
(Plain text)
전자서명
(Digital Signature)
인증서 .
(cetification)
원문
(Plain text)
전자서명
(Digital Signature)
인증서 .
(cetification)
LDAP(lightweight directory access protocol)
OCSP(Online Certificate Status Protocol)
유효성확인
전자서명
(Digital Signature)
복호화
Encryption
메세지다이제스트
(Message Digest)
원문
(Plain text)
메세지다이제스트
(Message Digest)
해쉬
Hash function
비교
인증(Authenticaiton)
부인방지(Non-repudiation)
무결성(Integrity)
PKCS7 : 암호메시지구문표준
▪ HTTPS(SSL/TLS)
• https://member.ssg.com/member/login.ssg
클라이언트
(브라우저)
웹서버
클라이언트
(브라우저)
웹서버
client hello
server hello
server certification
Server key exchange
Certification Request
server hello done
client certification
Change cipher spec
finished
Change cipher spec
finished
Application data
client key exchange
server cetification verify
물리계층(Physical Layer)
데이타링크(Datalink Layer) : MAC
네트워크(Network Layer) : IP
전송(Transport Layer) : TCP
SSL(Secure Socket Layer)
응용(Application) : HTTP, FTP
Hand Shake Protocol Change ciper
Spec Protocol
Alert protocol Application protocol
▪Cipher suites
Clien Hello Server Hello
TLS_DHE_RSA_WITH_AES_128_CBC_S
HA
▪ OTP(One Time Password)
1. 도전/응답(Challenge/response)
2. 이벤트동기방식 – 권장안함
• 토큰-서버의 카운트가 동일할 경우 동일한 패스워드 추출
클라이언트 웹서버
클라이언트 웹서버
Request login
Random number
finished
CE = H(Secret value + R) MAC(CE) SE = H(Secret value + R)
CE = SE verify
▪ OTP(One Time Password)
3. 시간동기방식
• 핸드폰인증 ≠ OTP
• 핸드폰인증은 challenge/response 방식의 Two-Factor 인증
009117
10:00:00 10:00:30
secret keytime
OTP 인증센터
User
- 신원정보확인/등록
- OTP 확인
시간오차
009117009117
비교
time window
HMAC(time+secret key)
3 6 0 0 9 1 1 7 2 5 8 7 3 5 7 5 3 9 5 3
secret keytime
HMAC(time+secret key)
3 6 0 0 9 1 1 7 2 5 8 7 3 5 7 5 3 9 5 3
END

알아두면 유용한 데이터 암호화 이야기

  • 1.
    알아두면 유용한 데이터암호화 이야기 (공인인증서, HTTPS)
  • 2.
    ▪ 목차 • 암호화? ✔암호화의 정의 및 역할 ✔ 암호화 방법 ✔ 암호화 종류 ▪ 공인인증서 ▪ HTTPS ▪ OTP
  • 3.
    ▪ 암호화의 정의및역할 1. 정의 2. 역할 1. 기밀성(Confidentiality) 2. 무결성(Integrity) 3. 인증(Authentication) 4. 부인방지(Non-repudiation) ⊕ ⊕ 원문(plain text) 암호문(cipher text) 암호화키(encryption key) 공개된 네트워크/시스템 (public network/system) 복호화키(decryption key) 암호화알고리즘 (Cryptography algorithm) 암호화(encryption) 복호화(decryption) 암호문(cipher text) 원문(plain text) 암호화알고리즘 (Cryptography algorithm) ?
  • 4.
    ▪ 암호화방법 1. 대체(substitution) 1.비트, 문자 또는 문자의 블록을 다른 비트,문자 또는 블록으로 대체 Ci = E(Pi) = Pi+3 2. 치환(transposition/permutation) 1. 메시지의 문자를 재배치 평문 a b c d e f g h i j k l m n o p q r s t u v w x y z 암호문 D E F G H I J K L M N O P Q R S T U V W X Y Z A B C 혼돈(confusion ) Col1 Col2 Col3 Row1 a t t Row2 a c K Row3 x a T Row4 x d A row5 w n x Col1 Col3 Col2 Row3 x a T row5 w n x Row1 a t t Row4 x A d Row2 a c K 확산(diffusion) attacKxaTxdAwnx xaTwnxattxAdacK
  • 5.
    ▪ 암호화종류 암호화 양방향 (암호화/복호화) 일방향 (암호화) 대칭키(암호화키 =복호화키) (Symmetric key) 비대칭키(암호화키 ≠ 복호화키) : RSA, ECC, DG, Elgamal, DSA (Asymmetric key) MDC : SHA256, SHA1, MD5… (Modification Detection Code) MAC : HMAC, NMAC, CBC-MAC… (Message Authentication Code) 스트리밍 : OTPad, Rc4… (Stream Ciphers) 블록 (Block Ciphers) DES,SEED,AES,ARIA … Feistel SPN 알고리즘구조 ECB(Electric CodeBook mode) CBC(Cipher Block Chaining mode) 암호모드 CFB(Cipher Feedback mode) OFB(Output Feedback) CTR(Counter) 기밀성(Confidentiality) 기밀성(Confidentiality) 인증(Authenticaiton) 부인방지(Non-repudiation) 인증(Authenticaiton) 무결성(Integrity)a 무결성(Integrity)
  • 6.
    ▪ PKI(Public KeyInfrastructure) CA(Cartification authority) (Root)CA(Cartification authority) RA(Registration authority) LDAP(lightweight directory access protocol) OCSP(Online Certificate Status Protocol) KICA : 한국정보인증 SignKorea : 코스콤 Yessign : 금융결제원 crossCert : 한국전자인증 TradeSign : 한국무역정보통신 User 한국인터넷진흥원 (KISA) Other Country CA USA : Verisign TTP (Trusted Third Party) - 인증서, CRL게시 - 타인증기관DS와의 연계 개인키, 공개키 생성 - 인증서, CRL 생성관리 - 등록관리, 정책관리, 가입자관리 - 신원정보확인/등록
  • 7.
    ▪ 공인인증서 공인인증서 :공개키(public key) 개인키(private key) 데이터 규약 : ASN.1(ber/der) PKCS5 : 패스워드기반 암호 표준 PKCS8 : 개인 키 정보 구문 표준 X.509 : 디지털 인증서 구조 표준 Counter(iterator) salt key 인증서 경로(certificate path) 개인키암호화방법
  • 8.
    ▪ PBE(Password BasedEncryption) • KEY DERIVATION → DECRYPTION 개인키(private key) (Key Encryption Key) (Random number generator / Pseudorandom number generator)
  • 9.
  • 10.
    ▪ 공인인증서 -유효성검사 주민등록번호/사업자번호 실명
  • 11.
    ▪ 전자서명 원문 (Plain text) 메세지다이제스트 (MessageDigest) 해쉬 Hash function 전자서명 (Digital Signature) 암호화 Encryption (개인키) 원문 (Plain text) 전자서명 (Digital Signature) 인증서 . (cetification) 원문 (Plain text) 전자서명 (Digital Signature) 인증서 . (cetification) LDAP(lightweight directory access protocol) OCSP(Online Certificate Status Protocol) 유효성확인 전자서명 (Digital Signature) 복호화 Encryption 메세지다이제스트 (Message Digest) 원문 (Plain text) 메세지다이제스트 (Message Digest) 해쉬 Hash function 비교 인증(Authenticaiton) 부인방지(Non-repudiation) 무결성(Integrity) PKCS7 : 암호메시지구문표준
  • 12.
    ▪ HTTPS(SSL/TLS) • https://member.ssg.com/member/login.ssg 클라이언트 (브라우저) 웹서버 클라이언트 (브라우저) 웹서버 clienthello server hello server certification Server key exchange Certification Request server hello done client certification Change cipher spec finished Change cipher spec finished Application data client key exchange server cetification verify 물리계층(Physical Layer) 데이타링크(Datalink Layer) : MAC 네트워크(Network Layer) : IP 전송(Transport Layer) : TCP SSL(Secure Socket Layer) 응용(Application) : HTTP, FTP Hand Shake Protocol Change ciper Spec Protocol Alert protocol Application protocol
  • 13.
    ▪Cipher suites Clien HelloServer Hello TLS_DHE_RSA_WITH_AES_128_CBC_S HA
  • 14.
    ▪ OTP(One TimePassword) 1. 도전/응답(Challenge/response) 2. 이벤트동기방식 – 권장안함 • 토큰-서버의 카운트가 동일할 경우 동일한 패스워드 추출 클라이언트 웹서버 클라이언트 웹서버 Request login Random number finished CE = H(Secret value + R) MAC(CE) SE = H(Secret value + R) CE = SE verify
  • 15.
    ▪ OTP(One TimePassword) 3. 시간동기방식 • 핸드폰인증 ≠ OTP • 핸드폰인증은 challenge/response 방식의 Two-Factor 인증 009117 10:00:00 10:00:30 secret keytime OTP 인증센터 User - 신원정보확인/등록 - OTP 확인 시간오차 009117009117 비교 time window HMAC(time+secret key) 3 6 0 0 9 1 1 7 2 5 8 7 3 5 7 5 3 9 5 3 secret keytime HMAC(time+secret key) 3 6 0 0 9 1 1 7 2 5 8 7 3 5 7 5 3 9 5 3
  • 16.