Tool 5 of 8

Hybrid encryption

Symmetric encryption is fast but needs a shared key. Asymmetric encryption needs no shared secret but is slow and limited in size. Hybrid encryption uses each for what it does best.

Your challengeFollow a long message from Alice to Bob and name, for every step, which key is used and whether the operation is symmetric or asymmetric.
Colour code in this tool: Symmetric: session key Asymmetric: Bob's public key Asymmetric: Bob's private key
Visualise

The complete sequence

Genuine AES-GCM + RSA-OAEP Simulated network
Alice
sender
Network Simulated
Eve
sees the envelope
Nothing sent yet
Bob
receiver
Experiment

Hybrid encryption lab

Genuine
Generating Bob's key pair…

Eve intercepts the envelope

Why hybrid?

What happened

Experiment

Which key is used where?

OperationKey usedType
Explain

Key ideas

Session key

A fresh, random symmetric key generated for one message or one connection, then thrown away. Each message gets a new one.

Data: symmetric

The message itself, however large, is encrypted with the session key (AES-GCM): fast and with integrity protection.

Key: asymmetric

Only the small session key (32 bytes) is encrypted with Bob's public key. This is sometimes called key wrapping.

Best of both

No shared secret is needed in advance (asymmetric), and large data is encrypted quickly (symmetric).

Relation to HTTPS / TLS

HTTPS is also hybrid: a short handshake with asymmetric cryptography establishes symmetric session keys, which then encrypt all the data.

But this tool is a simplified model. Old TLS versions did encrypt the session secret with the server's RSA public key, as shown here. TLS 1.3 no longer does this: browser and server agree on the secret with an ephemeral Diffie-Hellman exchange (Tool 6), and the server proves its identity with a certificate and a signature (Tools 8 and 7). The real handshake has many more details not shown here.

Common misconceptions

"HTTPS encrypts all data with the server's public key."
All data is encrypted with symmetric session keys. Public-key cryptography is only used during the handshake.
"The session key is sent in clear text."
It is protected with Bob's public key (or, in TLS 1.3, never sent at all).
Apply

Where you meet hybrid encryption

Encrypted e-mail

PGP and S/MIME encrypt the e-mail with a random session key, then encrypt that key once for each recipient's public key.

Secure file exchange

Tools such as age or GPG encrypt files the same way, so large files stay fast to encrypt.

HTTPS, VPNs, messaging apps

All combine an asymmetric handshake with fast symmetric encryption of the data.

Challenges

1. Three recipients

Alice wants to send the same 10 MB file to Bob, Charlie and Dana. How many times must she encrypt the file? How many times must she encrypt the session key?

Show answer
The file is encrypted once with one session key. The session key is encrypted three times: once with each recipient's public key.
2. Eve's best target

Eve recorded the envelope. What single piece of information would let her read the message? Where is it stored?

Show answer
Bob's private key (it unwraps the session key) or the session key itself. The private key is stored only on Bob's device; the session key exists only briefly in memory.

Continue the journey