R&D/보안

SSL 관련

sunshout 2016. 8. 4. 13:08

SSL 동작 방식



암호화 방식 

 

 

 대칭키

des3 

 

 공개키

 

 



SSL 동작방식

- 실제 데이터: 대칭키

- 대칭키의 키: 공개키


SSL 과정

1) 송신자가 수신자에게 공개키를 요청

2) 수신자가 공개키, 비밀키 쌍을 만들어서, 공개키를 송신자에게 전달

3) 송신자는 데이터를 암호화할 때 사용할 대칭키를 만들고, 대칭키를 전달받은 공개키로 암호화하여, 수신자에게 전달

4) 수신자는 대칭키를 복호화해서 저장

5) 송,수신자는 데이터를 대칭키로 암복호화해서 주고 받음





사이트 인증서 생성 및 배포 과정


4. SSL 인증서? CA 인증기관?

  - 자신의 웹사이트가 안전한 웹사이트라는 것을 인증 받아야 한다. 그래서 CA인증기관에 자신의 웹사이트 정보와 웹사이트 공개키, 비밀키 쌍을 생성하여 웹사이트 공개키를 CA에 제출한다.
  - CA는 전달받은 웹사이트 정보를 검사해서 안전한 웹사이트라고 판단 되면 CA의 공개키, 비밀키 쌍을 생성하고 CA의 비밀키로 인증서를 암호화 한다.(인증서에는 웹사이트 정보 + 웹사이트 공개키가 포함된다.) 그리고 인증서를 웹사이트에 발급한다.
  - 웹사이트는 인증서를 웹 브라우저가 다운받을 수 있는 곳에 저장해 놓는다.
  - 웹 브라우저는 해당 웹사이트에 접속해서 인증서를 다운받고, CA에 접속한 웹사이트에 해당하는 CA의 공개키를 전달 받는다. CA의 공개키로 인증서를 복호화 해서 웹사이트의 정보와 웹사이트 공개키를 얻는다. 웹사이트 정보를 이용해 신뢰할 수 있는 웹사이트에 등록해 놓는다. 그리고 대칭키를 생성해고 대칭키를 웹사이트 공개키로 암호화 해서 웹사이트에 전달한다.
  - 웹사이트는 웹사이트 비밀키로 대칭키를 복호화 해서 저장해 놓는다.
  - 웹사이트와 웹 브라우저는 데이터를 대칭키로 암복호화해서 주고 받음.



인증서는 보통 X.509 형식을 따름




CSR : Certificate Signing Request

- Block of encrypted text that is generated on the server that the certificate will be used on.


What is contained in a CSR?

NAMEEXPLANATIONEXAMPLES
Common NameThe fully qualified domain name (FQDN) of your server. This must match exactly what you type in your web browser or you will receive a name mismatch error.

*.google.com
mail.google.com

OrganizationThe legal name of your organization. This should not be abbreviated and should include suffixes such as Inc, Corp, or LLC.Google Inc.
Organizational UnitThe division of your organization handling the certificate.Information Technology
IT Department
City/LocalityThe city where your organization is located.Mountain View
State/County/RegionThe state/region where your organization is located. This shouldn't be abbreviated.California
CountryThe two-letter ISO code for the country where your organization is location.US
GB
Email addressAn email address used to contact your organization.webmaster@google.com
Public KeyThe public key that will go into the certificate.The public key is created automatically



How do I generate a CSR and private key?

openssl req -new -keyout server.key -out server.csr



CA

CA는 사용자의 certificate 를 인증해주는 역할을 한다.


Self signed 의 문제점




Terms

CA: certificate authority




p12 만들기 관련

http://m.blog.daum.net/wetet/1813


참조:

https://www.sslshopper.com/what-is-a-csr-certificate-signing-request.html

http://blog.naver.com/taekgu04/220954118235

http://hsg2510.tistory.com/48

http://wndrlf2003.blog.me/220534654431

http://blog.naver.com/nttkak/20130245553


SSL 통신 상세 설명: 

http://blog.naver.com/nttkak/20130246586

http://blog.naver.com/nttkak/20130246706