Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TLS/SSL的工作原理【热度: 499】 #405

Open
yanlele opened this issue Jun 4, 2023 · 0 comments
Open

TLS/SSL的工作原理【热度: 499】 #405

yanlele opened this issue Jun 4, 2023 · 0 comments
Labels
网络 web 网络相关
Milestone

Comments

@yanlele
Copy link
Member

yanlele commented Jun 4, 2023

关键词:SSL的工作原理、TLS的工作原理、密钥交换阶段

TLS(Transport Layer Security)和SSL(Secure Sockets Layer)是用于在网络上提供安全通信的协议。TLS是SSL的继任者,但两者通常被混合使用。

TLS/SSL的工作原理如下:

  1. 握手阶段(Handshake):

    • 客户端发送一个用于协商加密算法和通信参数的"客户端Hello"消息给服务器。
    • 服务器回应一个"服务器Hello"消息,其中包含服务器选择的加密算法和数字证书(包含公钥)。
    • 客户端验证服务器的数字证书的合法性,包括验证证书的颁发机构和有效期。
    • 客户端生成一个随机的对称加密密钥,使用服务器的公钥进行加密,发送给服务器。
    • 服务器使用自己的私钥解密客户端发送的加密密钥。
    • 客户端和服务器协商确定加密算法和密钥长度,生成用于后续通信的对称加密密钥。
  2. 密钥交换阶段(Key Exchange):

    • 客户端和服务器使用协商好的对称加密密钥进行通信。
    • 客户端和服务器之间的数据使用对称加密算法进行加密和解密。
  3. 数据传输阶段:

    • 客户端和服务器使用协商好的对称加密密钥进行数据传输,确保数据的保密性和完整性。

TLS/SSL的工作原理基于非对称加密和对称加密两种加密算法的结合。非对称加密用于安全地协商对称加密密钥,而对称加密用于实际的数据传输。通过使用数字证书对服务器进行身份验证,并对通信进行加密和认证,TLS/SSL确保了通信的安全性和可靠性。

需要注意的是,TLS/SSL的具体实现可能因应用程序、配置和版本而有所不同,但基本的工作原理和流程是相似的。

@yanlele yanlele added the 网络 web 网络相关 label Jun 4, 2023
@yanlele yanlele added this to the milestone Jun 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
网络 web 网络相关
Projects
None yet
Development

No branches or pull requests

1 participant