Support >
  About cybersecurity >
  How does the SSL security protocol achieve data encryption? A complete analysis of the handshake to session process.

How does the SSL security protocol achieve data encryption? A complete analysis of the handshake to session process.

Time : 2026-04-08 15:42:09
Edit : DNS.COM

When a user enters a URL in their browser and presses Enter, the first thing this action triggers isn't immediate data encryption, but rather a carefully designed "handshake" ceremony between the client and server. The purpose of this handshake isn't to transmit the actual webpage content, but to securely negotiate a temporary encryption key that both parties can use, and to verify that the other party is indeed the server it claims to be, and not a fake website impersonated by an eavesdropper.

The client first sends a message packet called "Client Hello." This packet contains the SSL/TLS version number that the client supports (e.g., TLS 1.2 or TLS 1.3), a randomly generated 32-byte data (called Client Random), and a list of cipher suites. While cipher suites sound technical, they are simply a list of "acceptable encryption combinations" from which the client can choose, such as ECDHE for key exchange, RSA for authentication, AES-256-GCM for symmetric encryption, and SHA-384 for hash verification. The browser will list its preferred suites first, allowing the server to choose from them. This step is transmitted entirely in plaintext, but there's no need to worry, as no sensitive information is exposed at this stage.

After receiving the Client Hello message, the server selects a set of cipher suites it also supports from the list and replies with a "Server Hello" message. Similarly, the server also includes its own random number (Server Random) in this message. At this point, both the client and server possess a random number, but these two random numbers are currently in plaintext and are not secure enough on their own; a stronger key is needed in subsequent steps.

Next, the server sends its digital certificate to the client. This certificate is like the server's "identity card," containing the server's public key, domain name, information about the issuing CA (Certificate Authority), and the certificate's validity period. Upon receiving the certificate, the client verifies its authenticity using the CA root certificate built into its operating system or browser.

After successful certificate verification, the client obtains the server's public key. Note that this public key is the public key for an asymmetric encryption algorithm (usually RSA or ECC). It is a pair with the private key; data encrypted with the public key can only be decrypted with the private key, and vice versa. Asymmetric encryption is very secure, but its computation speed is slow, making it unsuitable for encrypting large amounts of web page data. Therefore, the SSL protocol does not directly use asymmetric encryption to transmit web page content, but rather uses it to securely transmit the keys required for subsequent symmetric encryption.

Next, the client generates another random number called the Pre-master Secret. This Pre-master Secret is typically 48 bytes long and is used together with the previous Client Random and Server Random to derive the final session key. The client encrypts this Pre-master Secret using the public key obtained from the server's certificate and then sends it to the server. Since only the server possesses the corresponding private key, even if this encrypted data is intercepted over the network, an attacker cannot decrypt it because the private key has never been transmitted over the network. Symmetric encryption is characterized by using the same key for encryption and decryption, making it extremely fast and well-suited for encrypting large amounts of data.

In TLS 1.2 and earlier versions, the above key exchange and generation method is sufficiently secure, but some potential vulnerabilities remain. For example, certain insecure encryption suites may lead to a lack of forward secrecy. Forward secrecy means that even if an attacker steals the server's private key in the future, they cannot decrypt previously recorded encrypted sessions. To achieve forward secrecy, modern servers almost universally employ ECDHE or DHE key exchange algorithms, rather than directly encrypting the pre-master key with an RSA public key.

After generating a session key, the client sends a "Change Cipher Spec" message, informing the server, "I will now communicate with you using our agreed-upon symmetric encryption algorithm." The client then encrypts a "Finished" message using the session key and sends it back. Upon receiving this, the server similarly sends its own "Change Cipher Spec" and its encrypted "Finished" message. Once the client verifies the server's Finished message, the handshake phase officially ends.

After the handshake, actual business data transmission begins. At this point, user-submitted forms, viewed webpage content, and JSON data returned by the API are all segmented into data blocks. Each data block is symmetrically encrypted using the session key (e.g., AES-GCM mode), and also includes a Message Authentication Code (MAC) or directly uses AEAD authentication encryption to ensure that the data is neither viewed nor tampered with during transmission. If an attacker attempts to modify any byte, the receiving end will encounter authentication failure during decryption, and the connection will be immediately terminated.

TLS 1.3 significantly simplified the process compared to 1.2, reducing the handshake from two round trips to one (or even zero round trips to resume the session). It also removed all insecure cipher suites and mandated forward secrecy and AEAD authentication encryption. In TLS 1.3, the client directly carries the supported key exchange parameters when sending the Client Hello message. The server can immediately calculate the session key and send encrypted data, resulting in faster handshake speeds and higher security. However, regardless of the version evolution, the core idea remains unchanged: securely negotiate a temporary symmetric session key using asymmetric encryption, and then efficiently encrypt the actual transmitted data using symmetric encryption.

Returning to the initial questionhow does the SSL security protocol achieve data encryption? The answer can be summarized in four interconnected steps: authentication (verifying the server's identity through a digital certificate), key negotiation (securely exchanging a pre-master key using asymmetric encryption or ECDHE algorithm), session key derivation (generating an independent temporary key by combining random numbers from both parties), and symmetric encrypted transmission (fastly encrypting large amounts of business data using algorithms such as AES and ChaCha20). These four steps are completed automatically in every HTTPS connection, and users experience no delays while enjoying bank-level data protection. 

DNS Luna
DNS Amy
DNS Becky
DNS NOC
Title
Email Address
Type
Information
Code
Submit