HTTPS组成及原理(对称加密的密钥用非对称加密算法来加密)
|
|-组成|--HTTP
| |--SSL / TLS : 处理加密信息的模块,服务端和客户端的信息传输都会通过TLS进行加密
| (传输层安全性协议(英语:Transport Layer Security,缩写作TLS),
| 及其前身安全套接层(Secure Sockets Layer,缩写作SSL)是一种安全协议,
| 目的是为互联网通信提供安全及数据完整性保障)
|
|-原理|-服务端通过非对称加密获取客户端的随机值key(传输过程中可以保证随机值key的安全)
| | |
| | |_____非对称加密|--公钥加密
| | |--私钥解密
| |
| |-通过客户端的key来对类容进行对称加密并传输
TLS工作流程图
Client Server
___________ ___________
| | | |
____| |----1.request https://www.domain.com/ ---?|Crt Private|-- 2
| | validate |?---3.response with crt public------------|Crt Public |
| | crt | | |
| | | | | |
| | valid---- No ---- display https warning | |
| | | | | |
4 --| YES | | |
| | ? | | |
| | generate | | |
| | random key| | |
| | ? | | decrypt |
| |crypt with |----5.transfer crypted random key--------? | with |-- 6
__|_|crt public | |private crt|
| | | | |
| | | ? |
| | | get key |
| | | | |
| | | ? |
| | | crypt |
| decrypt | | content |
8 --| content |?---7.response crypted with client key----| with key |
| with key | | |
|___________| |___________|
HTTPS一般使用的加密与HASH算法
|
|-非对称加密算法:RSA,DSA/DSS
|-对称加密算法 :AES,RC4,3DES
|-HASH算法 :MD5,SHA1,SHA256