Forward Secrecy
What you'll learn: How forward secrecy protects your past encrypted communications even when your long-term keys get stolen.
The Problem with Static Keys
Imagine you use the same RSA or ECDSA key pair for years to encrypt communications. If an attacker records all your encrypted traffic and later steals your private key, they can retroactively decrypt every message you ever sent. That's catastrophic for privacy.
What Is Forward Secrecy?
Forward secrecy (also called perfect forward secrecy or PFS) is a cryptographic property that ensures each session uses ephemeral (temporary) keys. Even if your long-term private key is compromised later, past sessions remain secure because they used different, now-destroyed keys.
How It Works
Forward secrecy typically combines:
- Long-term keys for authentication (proving who you are)
- Ephemeral keys for encryption (protecting the actual data)
You use protocols like Diffie-Hellman or ECDH to generate fresh session keys for each communication. After the session ends, these ephemeral keys are deleted. Your long-term key only signs the exchange—it doesn't encrypt the data itself.
An Analogy
Think of a hotel: your passport (long-term key) proves your identity at check-in, but you get a unique room key card (ephemeral key) that expires at checkout. If someone steals your passport next year, they can't use it to unlock last year's hotel room—that key card was destroyed.
Why It Matters
Without forward secrecy, one key compromise means all past and future communications are exposed. With forward secrecy, each conversation stands alone—breaking one session doesn't cascade into breaking them all.
Key Takeaway: Forward secrecy uses ephemeral session keys to isolate each conversation, ensuring that compromising long-term keys doesn't retroactively expose past encrypted communications.