Coursera 笔记

Module 02 · Introduction to Automated Build Tools (Webpack)自动化构建工具(Webpack)简介

Reading: HTTPS & SSL Certificates阅读:HTTPS 与 SSL 证书

Coursera ↗

What is HTTPS? 什么是 HTTPS?

Hypertext transfer protocol secure (HTTPS) is the secure version of HTTP, which is the primary protocol used to send data between a web browser and a website. HTTPS is encrypted in order to increase the security of data transfer. This is particularly important when users transmit sensitive data by logging into a bank account, email service, or health insurance provider.
超文本传输协议安全(HTTPS)是 HTTP 的安全版本,HTTP 是用于在网页浏览器和网站之间发送数据的主要协议。HTTPS 通过加密来提高数据传输的安全性。这在用户通过登录银行账户、电子邮件服务或健康保险提供商传输敏感数据时尤为重要。

Any website, especially those that require login credentials, should use HTTPS. In modern web browsers such as Chrome, websites that do not use HTTPS are marked differently than those that are.
任何网站,尤其是需要登录凭证的网站,都应该使用 HTTPS。在现代浏览器如 Chrome 中,未使用 HTTPS 的网站与使用 HTTPS 的网站在标记上有所不同。

Look for a padlock in the URL bar to signify that the webpage is secure. Web browsers take HTTPS seriously; Google Chrome and other browsers flag all non-HTTPS websites as not secure.
查找 URL 栏中的锁形图标以表示网页安全。网络浏览器对 HTTPS 非常重视;Google Chrome 和其他浏览器将所有非 HTTPS 网站标记为不安全。

How does HTTPS work? HTTPS 是如何工作的?

HTTPS uses an encryption protocol to encrypt communications. The protocol is called Transport Layer Security (TLS), formerly known as Secure Sockets Layer (SSL). This protocol secures communications by using what’s known as an asymmetric public key infrastructure. This type of security system uses two different keys to encrypt communications between two parties:
HTTPS 使用加密协议来加密通信。该协议称为传输层安全性(TLS),之前被称为安全套接字层(SSL)。此协议通过使用所谓的非对称公钥基础设施来确保通信安全。这种安全系统使用两个不同的密钥来加密双方之间的通信:

The private key - this key is controlled by the owner of a website, and it’s kept, as the reader may have speculated, private. This key lives on a web server and is used to decrypt information encrypted by the public key.
私钥 - 这把钥匙由网站所有者控制,正如读者可能推测的那样,它是保密的。这把钥匙存在于网络服务器上,用于解密由公钥加密的信息。

The public key - this key is available to everyone who wants to interact with the server in a way that’s secure. Information that’s encrypted by the public key can only be decrypted by the private key.
公钥 - 这个密钥可供任何希望以安全方式与服务器交互的人使用。通过公钥加密的信息只能由私钥解密。

How does a website start using HTTPS? 如何让网站开始使用 HTTPS?

Many website hosting providers and other services will offer TLS/SSL certificates for a fee. These certificates will often be shared amongst many customers. More expensive certificates are available, which can be individually registered to particular web properties.
许多网站托管提供商和其他服务将提供付费的 TLS/SSL 证书。这些证书通常会被许多客户共享。更昂贵的证书可供选择,可以单独注册到特定的网站属性。

What is an SSL Certificate? SSL 证书是什么?

SSL stands for Secure Sockets Layer, and, in short, it's the standard technology for keeping an internet connection secure and safeguarding any sensitive data that is being sent between two systems, preventing criminals from reading and modifying any information transferred, including potential personal details. The two systems can be a server and a client (for example, a shopping website and browser) or server to server (for example, an application with personal identifiable information or with payroll information).
SSL 代表安全套接字层,简而言之,它是保持互联网连接安全并保护两个系统之间传输的任何敏感数据的标准技术,防止犯罪分子读取和修改传输的任何信息,包括潜在的个人详细信息。这两个系统可以是服务器和客户端(例如,购物网站和浏览器)或服务器到服务器(例如,包含个人可识别信息或工资信息的应用程序)。

It does this by making sure that any data transferred between users and sites or between two systems remain impossible to read. It uses encryption algorithms to scramble data in transit, preventing hackers from reading it as it is sent over the connection. This information could be anything sensitive or personal which can include credit card numbers and other financial information, names, and addresses.
通过确保用户和网站之间或两个系统之间的任何数据传输都保持无法读取,它做到这一点。它使用加密算法对传输中的数据进行加密,防止黑客在数据通过连接发送时读取它。这些信息可能是任何敏感或个人信息,包括信用卡号码和其他财务信息、姓名和地址。

TLS (Transport Layer Security) is just an updated, more secure version of SSL.
TLS(传输层安全性)只是 SSL(安全套接字层)的一个更新、更安全的版本。

How Does an SSL Certificate Work? SSL 证书是如何工作的?

SSL certificates protect data transfer using two different encryption techniques: asymmetric and symmetric.
SSL 证书使用两种不同的加密技术来保护数据传输:非对称和对称加密。

Asymmetric encryption uses two separate keys: a public and a private key. The public key is used to encrypt the message, which can only be decrypted by the private key, and vice versa. On the other hand, symmetric encryption uses one shared key, or a pair of keys, to encrypt and decrypt the message.
非对称加密使用两个不同的密钥:一个公钥和一个私钥。公钥用于加密消息,只能由私钥解密,反之亦然。另一方面,对称加密使用一个共享密钥或一对密钥来加密和解密消息。

To give a better understanding of how those encryption techniques work, here’s an overview of the process:
为了更好地理解这些加密技术的工作原理,以下是该过程的概述:

  • First, a website owner purchases an SSL certificate from a Certificate Authority (CA) and installs it on their site.
    首先,网站所有者从证书颁发机构(CA)购买 SSL 证书并将其安装在他们的网站上。
  • When a visitor navigates through the website, the browser and the web server establish an SSL connection using a method called SSL handshake
    当访客浏览网站时,浏览器和网站服务器通过称为 SSL 握手的方 式建立 SSL 连接.
  • During the SSL handshake, the browser asks the server for its SSL certificate and public key to prove its validity.
    在 SSL 握手过程中,浏览器请求服务器提供其 SSL 证书和公钥以证明其有效性。
  • Once the certificate is verified, the browser and web server exchange private and public keys to create a symmetric session key.
    一旦证书验证通过,浏览器和 Web 服务器交换公钥和私钥以创建对称会话密钥。
  • Both parties then use this symmetric key to encrypt all communications. This key will remain valid for a limited time and only for that particular session.
    双方随后使用此对称密钥加密所有通信。此密钥仅在该特定会话期间有效,并有一定期限。