The Needham–Schroeder protocol is one of the two key transport protocols intended for use over an insecure network, both proposed by Roger Needham and Michael Schroeder. These are:
The Needham–Schroeder Symmetric Key Protocol, based on a symmetric encryption algorithm. It forms the basis for the Kerberos protocol. This protocol aims to establish a session key between two parties on a network, typically to protect further communication.
The Needham–Schroeder Public-Key Protocol, based on public-key cryptography. This protocol is intended to provide mutual authentication between two parties communicating on a network, but in its proposed form is insecure.
Contents
Symmetric protocol
Here, Alice
(
A
)
{\displaystyle (A)}
initiates the communication to Bob
B
{\displaystyle B}
.
S
{\displaystyle S}
is a server trusted by both parties. In the communication:
A
{\displaystyle A}
and
B
{\displaystyle B}
are identities of Alice and Bob respectively
K
A
S
{\displaystyle {K_{AS}}}
is a symmetric key known only to
A
{\displaystyle A}
and
S
{\displaystyle S}
K
B
S
{\displaystyle {K_{BS}}}
is a symmetric key known only to
B
{\displaystyle B}
and
S
{\displaystyle S}
N
A
{\displaystyle N_{A}}
and
N
B
{\displaystyle N_{B}}
are nonces generated by
A
{\displaystyle A}
and
B
{\displaystyle B}
respectively
K
A
B
{\displaystyle {K_{AB}}}
is a symmetric, generated key, which will be the session key of the session between
A
{\displaystyle A}
and
B
{\displaystyle B}
The protocol can be specified as follows in security protocol notation:
A
→
S
:
A
,
B
,
N
A
{\displaystyle A\rightarrow S:\left.A,B,N_{A}\right.}
Alice sends a message to the server identifying herself and Bob, telling the server she wants to communicate with Bob.
S
→
A
:
{
N
A
,
K
A
B
,
B
,
{
K
A
B
,
A
}
K
B
S
}
K
A
S
{\displaystyle S\rightarrow A:\{N_{A},K_{AB},B,\{K_{AB},A\}_{K_{BS}}\}_{K_{AS}}}
The server generates
K
A
B
{\displaystyle {K_{AB}}}
and sends back to Alice a copy encrypted under
K
B
S
{\displaystyle {K_{BS}}}
for Alice to forward to Bob and also a copy for Alice. Since Alice may be requesting keys for several different people, the nonce assures Alice that the message is fresh and that the server is replying to that particular message and the inclusion of Bob's name tells Alice who she is to share this key with.
A
→
B
:
{
K
A
B
,
A
}
K
B
S
{\displaystyle A\rightarrow B:\{K_{AB},A\}_{K_{BS}}}
Alice forwards the key to Bob who can decrypt it with the key he shares with the server, thus authenticating the data.
B
→
A
:
{
N
B
}
K
A
B
{\displaystyle B\rightarrow A:\{N_{B}\}_{K_{AB}}}
Bob sends Alice a nonce encrypted under
K
A
B
{\displaystyle {K_{AB}}}
to show that he has the key.
A
→
B
:
{
N
B
−
1
}
K
A
B
{\displaystyle A\rightarrow B:\{N_{B}-1\}_{K_{AB}}}
Alice performs a simple operation on the nonce, re-encrypts it and sends it back verifying that she is still alive and that she holds the key.
Attacks on the protocol
The protocol is vulnerable to a replay attack (as identified by Denning and Sacco). If an attacker uses an older, compromised value for
K
A
B
{\displaystyle K_{AB}}
, he can then replay the message
{
K
A
B
,
A
}
K
B
S
{\displaystyle \{K_{AB},A\}_{K_{BS}}}
to Bob, who will accept it, being unable to tell that the key is not fresh.
Fixing the attack
This flaw is fixed in the Kerberos protocol by the inclusion of a timestamp. It can also be fixed with the use of nonces as described below. At the beginning of the protocol:
A
→
B
:
A
{\displaystyle A\rightarrow B:A}
Alice sends to Bob a request.
B
→
A
:
{
A
,
N
B
′
}
K
B
S
{\displaystyle B\rightarrow A:\{A,N_{B}'\}_{K_{BS}}}
Bob responds with a nonce encrypted under his key with the Server.
A
→
S
:
A
,
B
,
Public-key protocol
This assumes the use of a public-key encryption algorithm.
Here, Alice
(
A
)
{\displaystyle (A)}
and Bob
(
B
)
{\displaystyle (B)}
use a trusted server
(
S
)
{\displaystyle (S)}
to distribute public keys on request. These keys are:
K
P
A
{\displaystyle K_{PA}}
and
K
S
A
{\displaystyle K_{SA}}
, respectively public and private halves of an encryption key-pair belonging to
A
{\displaystyle A}
(
An attack on the protocol
This protocol is vulnerable to a man-in-the-middle attack. If an impostor
I
{\displaystyle I}
can persuade
A
{\displaystyle A}
to initiate a session with them, they can relay the messages to
B
{\displaystyle B}
and convince
B
{\displaystyle B}
that he is communicating with
A
{\displaystyle A}
.
Ignoring the traffic to and from
S
{\displaystyle S}
, which is unchanged, the attack runs as follows:
A
→
I
:
{
N
A
,
A
}
Fixing the man-in-the-middle attack
The attack was first described in a 1995 paper by Gavin Lowe.
The paper also describes a fixed version of the scheme, referred to as the Needham–Schroeder–Lowe protocol. The fix involves the modification of message six to include the responder's identity, that is we replace:
B
→
A
:
{
N
A
,
N
B
}
K
P
A
{\displaystyle B\rightarrow A:\{N_{A},N_{B}\}_{K_{PA}}}
with the fixed version:
B
→
A
:
{
N
A
,
N
B
,
B
}