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 )

  1. Nonce-based: One party (e.g., Bob) generates a nonce (, number used once) and sends it. Both compute .

    • Formula (using encryption):
    • Example:
      1. Bob generates random nonce .
      2. Bob sends to Alice.
      3. Alice computes .
      4. Bob computes .
  2. Counter-based: Use a synchronized counter ().

    • Formula (using encryption):
    • Example (assuming for the first session key):
      1. Alice computes .
      2. Bob computes .
      3. For next key, both increment to 2 and compute .
    • Advantage: No value needs to be transmitted if perfectly synchronized.
  3. HMAC-based: Use HMAC with nonce or counter.

    • Formula (using nonce ):
    • Example (using ):
      1. Bob generates .
      2. Bob sends to Alice.
      3. Alice computes .
      4. 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)

  1. Alice requests session key for Bob from KDC: .
  2. KDC generates random .
  3. KDC encrypts for Alice and Bob using their respective KEKs:
  4. KDC sends to Alice, to Bob (conceptually, via separate secure channels formed by KEKs).
  5. Alice decrypts: .
  6. Bob decrypts: .

Modified Protocol (More Practical)

  1. Alice KDC: .
  2. KDC generates . Computes and .
  3. KDC Alice: . (Sends Bob’s encrypted key to Alice).
  4. Alice decrypts .
  5. Alice Bob: , (Sends Bob his encrypted key plus the first message encrypted with ).
  6. Bob decrypts .
  7. 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.
    1. Alice KDC: .
    2. Oscar intercepts, changes request to KDC: .
    3. KDC Oscar (intended for Alice): , .
    4. Oscar intercepts, decrypts . Forwards to Alice (maybe along with disguised as ).
    5. Alice decrypts , believes she shares it with Bob.
    6. Alice Oscar (thinking it’s Bob): .
    7. 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)

  1. Alice KDC: (Includes a nonce ).
  2. KDC generates , Lifetime . Creates:
    • (Ticket for Alice: includes , verified nonce , lifetime , Bob’s ID ).
    • (Ticket for Bob: includes , Alice’s ID , lifetime ).
  3. KDC Alice: .
  4. Alice decrypts with .
    • Verifies (confirms KDC response is fresh and for her request).
    • Verifies (confirms key is intended for Bob).
    • Extracts and .
  5. Alice generates Timestamp . Creates Authenticator:
    • .
  6. Alice Bob: , (Ticket for Bob + Authenticator).
  7. Bob decrypts with .
    • Verifies (confirms key is for session with Alice).
    • Extracts and .
  8. 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:

    1. Alice (Oscar intercepts): .
    2. Oscar Bob: (Oscar’s public key, pretending it’s Alice’s). Oscar chose private .
    3. Bob (Oscar intercepts): .
    4. 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

  1. Alice sends and (containing or signed ).
  2. Bob sends and (containing or signed ).
  3. Alice verifies using . If valid, computes .
  4. 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.