13.1 Introduction
13.1.1 Some Terminology
- Key Establishment: Process of creating a shared secret between parties.
- Key Transport: One party creates a secret and securely sends it to others.
- Key Agreement: All parties contribute to deriving a shared secret. No single party determines the key. (e.g., Diffie-Hellman)
13.1.2 Key Freshness and Key Derivation
-
Session Key / Ephemeral Key (): Key used for a limited time (e.g., one session).
- Advantage: Limits damage if key is compromised; less ciphertext per key aids security.
-
Key Derivation Function (KDF): Derives session keys () from a long-term shared secret () and often a non-secret parameter ().
- Goal: Efficiently generate fresh keys without costly re-establishment.
- Property: Should be a one-way function (hard to find from ).
k_{ses} = KDF(K_{AB}, r)
KDF Examples (Alice and Bob share )
-
Nonce-based: One party (e.g., Bob) generates a nonce (, number used once) and sends it. Both compute .
- Formula (using encryption):
- Example:
- Bob generates random nonce .
- Bob sends to Alice.
- Alice computes .
- Bob computes .
-
Counter-based: Use a synchronized counter ().
- Formula (using encryption):
- Example (assuming for the first session key):
- Alice computes .
- Bob computes .
- For next key, both increment to 2 and compute .
- Advantage: No value needs to be transmitted if perfectly synchronized.
-
HMAC-based: Use HMAC with nonce or counter.
- Formula (using nonce ):
- Example (using ):
- Bob generates .
- Bob sends to Alice.
- Alice computes .
- Bob computes .
13.1.3 The Key Distribution Problem (Symmetric Keys)
- Problem with pre-distributing unique symmetric keys between all pairs of users.
- Each user stores: keys.
- Total symmetric key pairs needed:
- Total keys distributed/stored across system: .
- Adding a new user requires establishing new secure channels to distribute keys to all existing users.
- Example ( users: A, B, C, D):
- Keys needed: .
- Total pairs: .
- Alice stores: (3 keys = ).
- Example ( users):
- Total pairs: . Scalability issue.
13.2 Key Establishment Using Symmetric-Key Techniques
Relies on a trusted third party: Key Distribution Center (KDC).
13.2.1 Key Establishment with a KDC
- Prerequisite: Each user shares a unique long-term Key Encryption Key (KEK) with the KDC (e.g., for Alice, for Bob). KEKs distributed via secure channel initially.
- Goal: KDC generates a short-term session key () for Alice and Bob and distributes it securely using KEKs.
Basic Protocol (Conceptual)
- Alice requests session key for Bob from KDC: .
- KDC generates random .
- KDC encrypts for Alice and Bob using their respective KEKs:
- KDC sends to Alice, to Bob (conceptually, via separate secure channels formed by KEKs).
- Alice decrypts: .
- Bob decrypts: .
Modified Protocol (More Practical)
- Alice KDC: .
- KDC generates . Computes and .
- KDC Alice: . (Sends Bob’s encrypted key to Alice).
- Alice decrypts .
- Alice Bob: , (Sends Bob his encrypted key plus the first message encrypted with ).
- Bob decrypts .
- Bob decrypts message .
- Advantage over : Only KEKs needed ().
Security Issues
- Replay Attack: Attacker (Oscar) records old (or just in modified protocol) and replays them later. Alice/Bob might unknowingly reuse a compromised old . Needs mechanism for freshness (timestamps, nonces).
- Key Confirmation Attack (on basic/modified protocols): Alice doesn’t know if Bob actually received . Oscar (malicious user with KEK ) can trick Alice into using a key shared with him instead of Bob.
- Alice KDC: .
- Oscar intercepts, changes request to KDC: .
- KDC Oscar (intended for Alice): , .
- Oscar intercepts, decrypts . Forwards to Alice (maybe along with disguised as ).
- Alice decrypts , believes she shares it with Bob.
- Alice Oscar (thinking it’s Bob): .
- Oscar decrypts .
13.2.2 Kerberos (Simplified)
- Solves Replay and Key Confirmation issues. Uses KDC (called Authentication Server).
- Includes mechanisms for Timeliness and Key Confirmation.
Protocol Steps (Simplified)
- Alice KDC: (Includes a nonce ).
- KDC generates , Lifetime . Creates:
- (Ticket for Alice: includes , verified nonce , lifetime , Bob’s ID ).
- (Ticket for Bob: includes , Alice’s ID , lifetime ).
- KDC Alice: .
- Alice decrypts with .
- Verifies (confirms KDC response is fresh and for her request).
- Verifies (confirms key is intended for Bob).
- Extracts and .
- Alice generates Timestamp . Creates Authenticator:
- .
- Alice Bob: , (Ticket for Bob + Authenticator).
- Bob decrypts with .
- Verifies (confirms key is for session with Alice).
- Extracts and .
- Bob decrypts with .
- Verifies (confirms authenticator is from Alice).
- Verifies (checks if timestamp is recent, prevents replay of ).
Security Features
- Timeliness: Lifetime limits key validity. Timestamp ensures freshness of Alice’s contact with Bob. Requires loosely synchronized clocks.
- Key Confirmation:
- Alice confirms KDC via . Confirms key is for Bob via in .
- Bob confirms key is for Alice via in . Confirms current message is from Alice via in (authenticator).
13.2.3 Remaining Problems with Symmetric-Key Distribution (KDC/Kerberos)
- Communication Requirements: KDC must be online and contacted for new sessions.
- Secure Channel for Initialization: Initial KEK distribution requires a secure channel.
- Single Point of Failure: KDC database compromise reveals all KEKs. System unusable.
- No Perfect Forward Secrecy (PFS):
- Definition 13.1 (PFS): Compromise of long-term keys (KEKs) does not compromise past session keys ().
- KDC/Kerberos lack PFS. If KEK is compromised, attacker can decrypt past session keys by decrypting stored messages.
13.3 Key Establishment Using Asymmetric Techniques
- Can provide Key Transport (e.g., RSA/Elgamal encryption) or Key Agreement (e.g., DHKE).
- Doesn’t require secure channel for key distribution, but requires authenticated channel.
13.3.1 Man-in-the-Middle (MIM) Attack
- Major threat to asymmetric schemes if public keys are not authenticated.
- Attacker (Oscar) sits between Alice and Bob, intercepts and replaces public keys with his own.
Attack on Diffie-Hellman Key Exchange (DHKE)
-
Normal DHKE:
- Public parameters: prime , generator .
- Alice: chooses private , computes public .
- Bob: chooses private , computes public .
- Alice sends to Bob. Bob sends to Alice.
- Alice computes .
- Bob computes .
-
MIM Attack Steps:
- Alice (Oscar intercepts): .
- Oscar Bob: (Oscar’s public key, pretending it’s Alice’s). Oscar chose private .
- Bob (Oscar intercepts): .
- Oscar Alice: (Oscar’s public key, pretending it’s Bob’s).
-
Keys Established:
- Alice computes (thinks it’s with Bob):
- Bob computes (thinks it’s with Alice):
- Oscar computes (with Alice):
- Oscar computes (with Bob):
-
Result: Alice shares with Oscar. Bob shares with Oscar. Alice and Bob think they share . Oscar can decrypt, read, modify, and re-encrypt all traffic.
13.3.2 Certificates
- Solution to MIM: Authenticate public keys. Bind an identity () to a public key ().
- Mechanism: Digital Signature by a trusted Certification Authority (CA).
- Certificate Structure (Basic):
- is the CA’s private signing key.
- Verification: Anyone knowing the CA’s public verification key () can verify the signature. If valid, they trust that belongs to .
- Requires: Receiver must have the authentic public key of the CA ().
Certificate Generation
- User-Provided Keys: Alice generates . Sends to CA via authenticated channel. CA verifies Alice’s identity, signs, returns .
- CA-Generated Keys: Alice requests certificate for via authenticated channel. CA verifies identity, generates , signs , returns and via authenticated and secure channel.
DHKE with Certificates
- Alice sends and (containing or signed ).
- Bob sends and (containing or signed ).
- Alice verifies using . If valid, computes .
- Bob verifies using . If valid, computes .
- MIM prevented: Oscar cannot fake or without . If Oscar replaces with and with , Bob’s verification of would show the identity , not .
Trust
- Transfer of Trust: Users trust the CA’s public key (). By verifying certificates, they extend trust to the public keys within those certificates.
- Authenticated Channel needed only once: For initially obtaining the trusted . Often pre-installed in software (browsers, OS).
- Chain of Trust: If CA1 signs CA2’s public key, and Alice trusts CA1, she can verify CA2’s certificate, obtain trusted , and then verify certificates issued by CA2.
13.3.3 Public-Key Infrastructures (PKI) and CAs
- PKI: The entire system of hardware, software, policies, CAs, certificates to manage public keys.
- Complex issues: CA hierarchies, certificate revocation, policy.
X.509 Certificates
- A standard format for public key certificates (used in TLS/SSL, S/MIME, etc.).
- Key Fields:
- Version
- Serial Number (unique from issuer)
- Signature Algorithm ID (e.g., sha256WithRSAEncryption)
- Issuer (CA’s distinguished name)
- Validity Period (Not Before, Not After dates)
- Subject (Owner’s distinguished name - )
- Subject Public Key Info (Algorithm ID, Parameters, The key )
- Issuer Unique ID (optional)
- Subject Unique ID (optional)
- Extensions (optional, e.g., key usage constraints)
- CA’s Signature on all above fields.
Chain of Certificate Authorities (CAs)
- Reality: Multiple CAs exist. Users may not directly trust the CA that issued a specific certificate.
- CAs can issue certificates for other CAs (cross-certification or hierarchical).
- Example: Alice trusts Root CA. Root CA certifies Intermediate CA1. Intermediate CA1 certifies Bob’s Leaf CA. Bob’s Leaf CA certifies Bob’s certificate . Alice verifies the chain: Root CA1 Leaf CA Bob.