Hybrid encryption
7.3 · Combining public-key and symmetric schemes- Public-key encryption is slow and limited to short messages; symmetric encryption is fast but needs a shared key.
- Hybrid: pick a fresh session key k, encrypt the message with AES-256-GCM under k, then encrypt k itself with RSA-OAEP under Bob’s public key.
- Send the pair (c₁, c₂): c₁ = RSA-OAEP(pkB, k), c₂ = AES-GCM(k, N, M) with tag T.
- Bob recovers k from c₁ with skB, then decrypts c₂ and verifies T.
AAlice
k ← randomc₁ ‖ N ‖ c₂ ‖ T
BBob
Key pointThe session key k never crosses the channel in the clear.