![]() |
When you browse a secure website (the one with the padlock and the https:// prefix), the TLS (Transport Layer Security) protocol works in the background to ensure that no one can intercept or modify your data.
However, there is a fundamental detail about how TLS works that often goes unnoticed: TLS does not encrypt web traffic using public and private keys. Using asymmetric encryption for the entire session would make the web slow to the point of being unusable.
TLS solves this problem by using a hybrid strategy: it uses asymmetric encryption only to get to know each other, and immediately switches to symmetric encryption to talk.
This allows for a balance between security and performance:
- asymmetric encryption during the Handshake phase to authenticate endpoints and negotiate keys
- instant "switch" to symmetric encryption for the session cipher (Bulk Data Encryption).
The Problem: Encryption Performance
To understand why TLS performs this "switch", we need to compare the two encryption models:
Key differences between Symmetric and Asymmetric Encryption
- Asymmetric Encryption: Uses two distinct keys (public key to encrypt, private key to decrypt). It is extraordinary for security because it allows two strangers to establish a trusted connection without ever having met before. The price? It is mathematically heavy and requires complex calculations (e.g., operations on large prime numbers or elliptic curves).
- Symmetric Encryption: Uses a single shared key for both encryption and decryption (e.g., AES-GCM, ChaCha20). It is extremely fast and lightweight, so much so that it is accelerated directly via hardware in modern processors (AES-NI instructions). However, it has a critical limitation: how do you exchange that single key securely over an open network without getting intercepted?
The Hybrid Solution: The TLS Handshake
TLS takes the best of both worlds. The process is divided into two distinct phases during the initial handshake:
-
Authentication and Key Exchange (Asymmetric)
Initial phase
The client (browser) connects to the server. The server presents its digital certificate containing its public key.
Through key exchange algorithms (such as Elliptic-Curve Diffie-Hellman, ECDHE), the client and server negotiate a shared common secret (Pre-Master Secret). During this phase, asymmetric encryption guarantees the server's identity and prevents third parties from intercepting the secret. -
Session Key Generation
The turning point
Using the newly exchanged secret, both the client and the server independently calculate a temporary symmetric key (called a session key). -
The Switch to Symmetric Keys
Data streaming phase
At this point, the handshake is complete. For the rest of the session (page downloads, images, video streaming, form submissions), the channel transmits data exclusively via symmetric encryption (encryption and decryption with the same key).
What are the advantages of this approach?
In short: Asymmetric encryption solves the problem of trust, while symmetric encryption solves the problem of speed.
- Up to 1000x higher speed: Symmetric encryption requires significantly lower computational load for the CPU, drastically reducing latency in data transmission.
- Lower impact on servers: A web server handles thousands of simultaneous connections. If it had to run asymmetric algorithms for every data packet, hardware resources would be rapidly depleted.
- Forward Secrecy: Because symmetric keys are temporary and generated on the fly for that single session, if an attacker manages to steal the server's private key in the future, they still won't be able to decrypt past session traffic.
The Performance Gap: Asymmetric vs. Symmetric
To understand the need for the switch, it is sufficient to analyze the computational complexity and throughput of the two cryptographic paradigms:
| Feature | Asymmetric Encryption (e.g., RSA / ECDSA) | Symmetric Encryption (e.g., AES-GCM / ChaCha20) |
|---|---|---|
| CPU Work | Complex math on giant integers (e.g., 2048/4096-bit modular exponentiation) or elliptic curve operations. | Low-level logic operations (XOR, transpositions, S-Box substitutions). |
| Hardware Support | Limited; requires intensive generic math instructions. | Dedicated hardware instructions on modern processors (AES-NI, ARMv8 Crypto Extensions). |
| Typical Throughput (Single Core CPU) | ~0.5 MB/s - 5 MB/s (very slow) | ~2,000 MB/s - 8,000 MB/s (extremely fast with AES-NI) |
| Key Size | RSA: 2048-4096 bit / ECC: 256-384 bit | AES: 128 or 256 bit |
Performance Evidence: Hardware-accelerated AES-GCM symmetric encryption and decryption (AES-NI) is on average 100x to 1,000x faster compared to RSA-2048 decryption/signing operations at the same CPU clock cycles.
Real-World Impact and System Optimizations
The transition to symmetric encryption unlocks critical benefits for high-load infrastructures:
- Bandwidth Saturation (Gigabit/100GbE): Thanks to algorithms like AES-GCM (which combine Galois/Counter Mode encryption and integrity authentication) and CPU hardware acceleration, a single core of a modern server can encrypt traffic at speeds exceeding 10 Gbps. Achieving such speeds would be impossible if every packet required asymmetric operations.
- Data Center Efficiency: By reducing the use of clock cycles for application traffic encryption, web servers (Nginx, Envoy, Apache) can dedicate over 95% of memory and CPU to managing business logic and database queries.
- PFS (Perfect Forward Secrecy): By using ephemeral symmetric keys generated on the fly for each session via ECDHE, even if the server's private key were compromised in the future, attackers could not decrypt previously captured past session traffic.
In summary: Asymmetric encryption provides the foundation of Trust (guaranteeing server identity and secure secret exchange), while symmetric encryption provides Scalability, making full-web encryption sustainable on a global scale.
Follow me #techelopment
Official site: www.techelopment.it
facebook: Techelopment
instagram: @techelopment
X: techelopment
Bluesky: @techelopment
telegram: @techelopment_channel
whatsapp: Techelopment
youtube: @techelopment
