https

https是http和ssl的结合,ssl在http层之下、ip层之上,所以https的url是被加密的,ip不会被加密,所以get请求参数看不到

常见加密方式

plaintext + public key -> ciphertext ciphertext + private key -> plaintext

https的加密方式

使用非对秒加密来传对称加密的密钥,然后用对称加密的密钥来传数据(非对称计算开销大)

browser                                             server
  |                                                    |                     
  |                                                    |
  |-------------------request------------------------->|
  |                                                    |
  |<-------------response(public key)------------------|
  |                                                    |
  |-------------+                                      |
  |             |                                      |
  |      create symmetric key                          |
  |             |                                      |
  |<------------+                                      |
  |                                                    |
  |-----------encrypted symmetric key----------------->|
  |                                                    |
  |-------send message with symmetric key ------------>|
  |                                                    |