Key Moments

Man in the Middle & Needham–Schroeder Protocol - Computerphile

ComputerphileComputerphile
Education4 min read25 min video
Jan 7, 2022|73,703 views|2,407|158
Save to Pod
TL;DR

Explains public key crypto, man-in-the-middle attacks, and the Needham-Schroeder protocol's flaws.

Key Insights

1

Public key cryptography uses paired public and private keys for encryption, where anyone can encrypt with the public key, but only the private key holder can decrypt.

2

A 'man-in-the-middle' attack occurs when an attacker intercepts and relays messages between two parties, posing as each.

3

The initial simple protocol's vulnerability is that a party can be tricked into decrypting a message intended for someone else, validating the attacker.

4

The Needham-Schroeder public key protocol aims to establish secure communication by exchanging secrets and identities.

5

The Needham-Schroeder protocol has a critical flaw where an attacker can impersonate one party to another by misusing the protocol steps.

6

The attack exploits a scenario where a party intends to initiate a connection with an attacker (acting as 'Pat'), who then forwards the communication to the intended recipient, creating a false sense of secure connection.

THE FUNDAMENTALS OF PUBLIC KEY CRYPTOGRAPHY

Public key cryptography, also known as asymmetric cryptography, operates with a pair of keys: a public key and a private key. The public key can be shared widely, allowing anyone to encrypt messages or data. However, only the corresponding private key, held securely by the owner, can decrypt these messages. This mechanism ensures that a message encrypted with a public key can only be unlocked by its specific private key holder, establishing a secure channel from sender to receiver.

THE 'MAN-IN-THE-MIDDLE' THREAT

In digital communications, messages often travel through multiple servers and routers. This passage creates opportunities for 'man-in-the-middle' (MITM) attacks. An attacker in this position can intercept communications, potentially read messages, and even manipulate them. The analogy of a malicious postman, 'Pat', illustrates how an intermediary can interfere with message delivery and verification, posing a significant threat to secure communication channels.

INITIAL PROTOCOL VULNERABILITIES

Early security protocols often assumed that if a party could decrypt a message, they must possess the correct private key. However, this assumption is flawed. A simple protocol where Alice sends a secret locked with Bob's public key to Bob, and Bob responds, can be exploited. If a malicious 'Pat' intercepts this, Pat can forward Alice's message to Bob. Bob decrypts it, believing it came directly from Alice, and sends a response back. Pat can then relay this response to Alice, making both believe they are communicating securely with each other, when in reality, Pat is in the middle.

THE NEEDHAM-SCHROEDER PUBLIC KEY PROTOCOL

The Needham-Schroeder public key protocol was designed to address these issues by incorporating identity verification. It involves Alice encrypting a secret and her identity with Bob's public key. Bob, upon decrypting, verifies Alice's identity from the message and then encrypts the secret (and his own secret) with Alice's public key. This two-way exchange aims to ensure both parties are who they claim to be and have established a shared secret.

THE CRITICAL FLAW IN NEEDHAM-SCHROEDER

Despite its design, the Needham-Schroeder protocol has a significant vulnerability. The attack arises when a user, Alice, intends to communicate with an entity she believes to be 'Pat' (the attacker). Alice encrypts a secret and her identity using Pat's public key. Pat, acting as an intermediary, intercepts this. Crucially, Pat then forwards Alice's message to the intended recipient, Bob, encrypting it with Bob's public key. Bob decrypts this, believing it came from Alice, and stages a response. Pat intercepts this response and relays it back to Alice, creating a false sense of a secure connection between Alice and Bob, with Pat orchestrating the entire deception.

EXPLOITING THE INTERMEDIARY SCENARIO

This attack is particularly insidious because it leverages a scenario where a user might intentionally initiate a connection with an untrusted party (like a 'dodgy website'). The attacker, posing as that website, then uses the user's genuine attempt to connect as a bridge to establish a fake connection with a legitimate service (like a bank). The protocol's steps, when misused by Pat, allow Pat to trick Bob into believing he is communicating with Alice, while Alice believes she is communicating with Bob, with Pat controlling the flow and all shared secrets.

THE SOLUTION: ADDING CONTEXTUAL IDENTIFIERS

A straightforward fix to the Needham-Schroeder protocol's vulnerability involves adding context to the messages. If, during the exchange, Alice were to include Bob's identity in her message to Bob (making it clear she intended to speak to Bob, not Pat), Bob would notice the discrepancy. When Bob receives a message that apparently came from Alice but mentions Bob's name, he would realize the communication is compromised and abort the protocol, thus failing the man-in-the-middle attack.

THE CHALLENGE OF SECURE PROTOCOL DESIGN

Designing secure protocols is exceptionally difficult because attackers only need to find one loophole, while defenders must consider every possible interaction and combination of protocol runs. The Needham-Schroeder protocol's flaw remained undiscovered for years because the specific attack scenario was not initially anticipated. This highlights the ongoing need for rigorous analysis and a deep understanding of potential attack vectors in cryptography.

Common Questions

Public key cryptography, also known as asymmetric cryptography, uses a pair of keys: a public key to encrypt messages and a private key to decrypt them. Only the owner of the private key can decrypt messages locked with its corresponding public key.

Topics

Mentioned in this video

More from Computerphile

View all 82 summaries

Found this useful? Build your knowledge library

Get AI-powered summaries of any YouTube video, podcast, or article in seconds. Save them to your personal pods and access them anytime.

Try Summify free