Home > Common Problem > body text

What is https encryption method?

Release: 2019-07-20 17:13:06
Original
13998 people have browsed it

What is https encryption method?

##Https encryption

Introduction

Http directly passes through plain text in Messages are passed between the browser and the server, and the communication content can easily be intercepted and captured.

Https uses a combination of symmetric encryption and asymmetric encryption to communicate.

Https is not a new protocol at the application layer, but the Http communication interface uses SSL and TLS to strengthen the encryption and authentication mechanism.

Encryption method

Symmetric encryption: Encryption and decryption use the same key.

Asymmetric encryption: Keys appear in pairs, divided into public keys and private keys. Public key encryption requires private key decryption, and private key encryption requires public key decryption.

The difference between the two

Symmetric encryption is fast, while asymmetric encryption is slow.

Symmetric encryption requires exposing the key, which is no different from plain text transmission.

Asymmetric encryption exposes the public key for client encryption, and the server uses the private key to decrypt.

Selection of Https encryption

Disadvantages of symmetric encryption

Symmetric encryption is fast and suitable for Https encryption algorithm, but the password is transmitted between the server and the browser. The key process was monitored and was transmitted in clear text.

Disadvantages of asymmetric encryption

The server only exposes the public key. The browser uses the public key to asymmetrically encrypt the message, and the server uses the private key to decrypt the message. But when the server replies to the browser, it can only use the private key to encrypt, and the browser can only use the public key to decrypt. However: the public key is known to everyone, and everyone can read the message replied by the server to decrypt it, so it cannot solve the problem of the server sending the message to the browser.

Https encryption

Combination of symmetric encryption and asymmetric encryption

The browser uses the HTTPS URL to access the server and establish an SSL link.

The server receives the SSL link and sends the asymmetrically encrypted public key A back to the browser

The browser generates a random number as the symmetric encryption key B

Browser Use public key A to encrypt the key B you generated to obtain key C

The browser sends key C to the server.

The server uses private key D to decrypt the received key C and obtains the symmetric encryption key B.

Key B can be used as a symmetric encryption key to communicate between the browser and the server.

Summary

In this way, the browser and the server share a symmetric encryption key B, and the important thing is that it will not be intercepted. Asymmetric encryption is only performed once when transmitting key B, and then symmetric encryption is used to transmit data.

The above is the detailed content of What is https encryption method?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!