HTTP协议是一种不安全的传输协议,所有数据在传输过程都是明文传输,很容易被第三方截获,造成数据不安全。

HTTPS使用混合加密协议对数据进行加密,即对称加密和非对称加密:

对称加密和非对称加密的优缺点:

  • 对称加密的加密和解密的速度快,效率高;非对称加密算法的加密和解密的速度满,效率低
  • 对称加密算法的加密和解密都是用的同一个密钥,密钥的传输成本较高;非对称加密算法的加密和解密采用的是不同的密钥,一个公钥一个私钥,公钥可以对外公开,密钥传输的成本较低。

https://jums.club/images/article2/bVbClUj.png

Hypertext Transfer Protocol Secure (HTTPS) is an extension of the Hypertext Transfer Protocol (HTTP). It is used for secure communication over a computer network, and is widely used on the Internet.[1][2] In HTTPS, the communication protocol is encrypted using Transport Layer Security (TLS) or, formerly, Secure Sockets Layer (SSL). The protocol is therefore also referred to as HTTP over TLS,[3] or HTTP over SSL.

The principal motivations for HTTPS are authentication of the accessed website, and protection of the privacy and integrity of the exchanged data while in transit. It protects against man-in-the-middle attacks, and the bidirectional encryption of communications between a client and server protects the communications against eavesdropping and tampering.[4][5] The authentication aspect of HTTPS requires a trusted third party to sign server-side digital certificates. This was historically an expensive operation, which meant fully authenticated HTTPS connections were usually found only on secured payment transaction services and other secured corporate information systems on the World Wide Web. In 2016, a campaign by the Electronic Frontier Foundation with the support of web browser developers led to the protocol becoming more prevalent.[6] HTTPS is now used more often by web users than the original non-secure HTTP, primarily to protect page authenticity on all types of websites; secure accounts; and to keep user communications, identity, and web browsing private.[7]

HTTPS=HTTP+TLS/SSL

数字正式在HTTPS中相当于非对称加密算法的私钥和公钥的分配这么一个工作。

Reference

写在最后

欢迎大家关注鄙人的公众号【麦田里的守望者zhg】,让我们一起成长,谢谢。
微信公众号