Here's an hypothetical example of a simple instant messaging protocol that employs
Forward Secrecy :
- Alice and Bob each generate a pair of long-term, asymmetric public and private keys
- then verify public-key fingerprints in person or over an already-authenticated channel.
- Verification establishes with confidence that the claimed owner of a public key is the actual owner.
- Alice and Bob use a key exchange algorithm such as Diffie-Hellman, to securely agree on an ephemeral session key.
- They use the keys from step 1 only to authenticate one another during this process.
- Alice sends Bob a message, encrypting it with a symmetric cipher using the session key negotiated in step 2.
- Bob decrypts Alice's message using the key negotiated in step 2.
- The process repeats for each new message sent :
- starting from step 2
- and switching Alice and Bob's roles as sender/receiver as appropriate
- step 1 is never repeated
Forward Secrecy :
is achieved by generating a new session key for each message
ensures that past communications cannot be decrypted if one of the keys generated in an iteration of step 2 is compromised, since such a key is only used to encrypt a single message
also ensures that past communications cannot be decrypted if the long-term private keys from step 1 are compromised
- However, masquerading as Alice or Bob would be possible going forward if this occurred, possibly compromising all future messages.
if I get it right :
* the long-term secrets are used to authenticate each other ("//you are the one you pretend to be//") while negotiating the **session key** at step 2
* since a new session key is generated for each message :
* if a session key is leaked, it can be used to disclose a single message only
* no past nor future message can be read using this key
* if Alice's long-term private key from step 1 is compromised :
* someone can masquerade as Alice (or eavesdrop) during step 2, which means :
* this person has access to all future session keys
* all future messages are compromised