HTTPS Overview
Let's have an overview on HTTPS.
| HTTPS | / \ | HTTP SSL SET | \ / | PKI
HTTPS is based on HTTP protocal and SSL protocal.
SSL protocal is an implement of PKI standard.
What is PKI?
To discuss HTTTS, we are better to know what PKI is first. It's very important! Here's an article talking about PKI in detail.
PKI, Public Key Infrastructure, is attend to insure the data security transfered over Internet and identify the authentic user.
The public key for ones could be obtained by everyone on Internet, the private key is only kept by the owner. Signing with the public key will insure the data security. Signing with the private key will insure the undeniable.
So it requires both side have theire own keys for insuring secure communication on both direction. However in some situation, it's not easy to get keys on both side, such as B2C, you can't require each visiter getting their keys for using your website.
How does SSL work?
Is there a way to have secure communication both direction without requiring keys on the browser side? The answer is yes, there's SSL. Below's a section from the article Introduction to SSL that describes how SSL works very clearly.
The SSL protocol uses a combination of public-key and symmetric key encryption. Symmetric key encryption is much faster than public-key encryption, but public-key encryption provides better authentication techniques. An SSL session always begins with an exchange of messages called the SSL handshake. The handshake allows the server to authenticate itself to the client using public-key techniques, then allows the client and the server to cooperate in the creation of symmetric keys used for rapid encryption, decryption, and tamper detection during the session that follows. Optionally, the handshake also allows the client to authenticate itself to the server.
Below is brief steps for SSL Handshake(assume it's between Internet Browser and web server.)
Browser side (no keys) <-----> Server with SSL (keys based on PKI) -- B -> hello, wanna a secure connection -> S B -> my ssl version -> S B -> my encrypt type -> S B -> some random data -> S B -> hello done -> S -- B <- hello, yeah, i accept <- S B <- some random data <- S B <- my certificate including my pub-key <- S B <- hello done <- S -- B verify the certificate S B generate "premaster secret" S B -> "premaster secret" encrypted with server's pub-key -> S B generate "master secret" by "premaster secret" S B generate "session keys" by "master secret" S B -> I'll send data encrypted by "session keys" at next -> S B -> encrypted "I'm ready" -> S -- B decrypt "premaster secret" with server's priv-key S B generate "master secret" by "premaster secret" S B generate "session keys" by "master secret" S B <- I'll send data encrypted by "session keys" at next <- S B <- encrypted "I'm ready" <- S -- Handshake is finished.
For the steps above, it's not for the case of server reqests the client authenication. Here only discuss the case of none-keys on client side.
We know the keys on server side is only used for exchanging the session key. The session key is the symmetric key that is acctrually used to encrypt/decrypt data between client and server.
I'm not sure how related between the browser and server's random data at their first hello step. At browser generates "premaster secret", it might base on the random data from server. it's my guess. Anyone could give the steps more clear?
Reference
- Introduction to SSL
- PKI 基础
- 在Web中使用SSL
http://www.cnweblog.com/harryyang/archive/2005/06/03/12713.html
- How does ssl work?
http://www.ourshop.com/resources/ssl.html
- 文章信息
- 版权声明: 本文可以任意转载,转载时请务必以超链接形式标明文章原始出处和作者信息。
- 原文出处: http://www.aiview.com/
- 写于: 2007-03-02 [Edit]
- 作者: Alex (email &msn)

- 标签 Tags: https (2), ssl (1)


