What is the difference between http and https by only one s? This article will take you to understand

HTTP and HTTPS are two protocols that we often come into contact with in our daily life, and they are both protocols used to transmit data on the network. However, there is a big difference between them. This article will describe the difference between HTTP and HTTPS in detail from many aspects, including definition, working principle, security, performance, SEO and so on.

1. Definition

HTTP (Hypertext Transfer Protocol) is a protocol for transferring hypertext, which is the basic protocol of the Web, and it defines the communication rules between the client and the server. HTTP uses TCP as a transmission protocol, which is a plaintext transmission protocol, and data is not encrypted during transmission, so it is easy to be eavesdropped and tampered with.

HTTPS (Hypertext Transfer Protocol Secure) is a secure version of HTTP. It uses the SSL/TLS protocol to encrypt and authenticate data to ensure data security during transmission. The port number used by HTTPS is 443 and the port number used by HTTP is 80.

2. Working principle

The working principle of HTTP is very simple, the client sends a request to the server, the server receives the request and returns a response. Both requests and responses are transmitted in clear text, making them vulnerable to eavesdropping and tampering.

The working principle of HTTPS is similar to HTTP, but it will perform SSL/TLS handshake before transmitting data to establish a secure channel. The SSL/TLS handshake process includes the following steps:

1. The client sends information such as an encryption protocol version number, encryption algorithm list, and random numbers to the server.

2. The server sends information such as an encryption protocol version number, encryption algorithm list, server certificate, and random numbers to the client.

3. The client verifies the legitimacy of the server certificate and generates a random number.

4. The client uses the public key in the server certificate to encrypt the random number and sends it to the server.

5. The server uses the private key to decrypt the encrypted random number and generates a symmetric key using the random numbers generated by the client and the server.

6. The client and server encrypt and decrypt data using the symmetric key.

3. Security

HTTP is a clear text transmission protocol, and data is not encrypted during transmission, so it is easy to be eavesdropped and tampered with. Attackers can obtain sensitive user information such as usernames, passwords, and credit card numbers by eavesdropping on network traffic.

HTTPS uses the SSL/TLS protocol to encrypt and authenticate data to ensure the security of data during transmission. The SSL/TLS protocol uses public key encryption and private key decryption to ensure data confidentiality, and uses digital certificates to ensure data authenticity and integrity.

4. Performance

HTTP is a lightweight protocol, and its requests and responses are transmitted in clear text, so the transmission speed is relatively fast. However, HTTP has performance issues when transferring large amounts of data because it does not have the ability to compress data.

HTTPS needs to perform encryption and decryption operations when transmitting data, so the transmission speed is slower than HTTP. However, with the continuous upgrading of hardware and software, the performance of HTTPS has been greatly improved.

5. SEO

HTTPS has a certain impact on SEO. Google announced in 2014 that HTTPS is a factor in search rankings. Therefore, using HTTPS can improve the search ranking of the website, thereby attracting more traffic.

Summarize

HTTP and HTTPS are two different protocols with a big difference between them. HTTP is a clear text transmission protocol, and data is not encrypted during transmission, so it is easy to be eavesdropped and tampered with. HTTPS uses the SSL/TLS protocol to encrypt and authenticate data to ensure the security of data during transmission. The performance of HTTPS is slower than that of HTTP, but with the continuous upgrading of hardware and software, the performance of HTTPS has been greatly improved. Using HTTPS can improve your website's search rankings and thus attract more traffic.

Guess you like

Origin blog.csdn.net/weixin_74021557/article/details/131252417