Needham–Schroeder protocol explained

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.[1] These are:

Symmetric protocol

(A)

initiates the communication to Bob .

S

is a server trusted by both parties. In the communication:

A

and

B

are identities of Alice and Bob respectively

{KAS

} is a symmetric key known only to

A

and

S

{KBS

} is a symmetric key known only to

B

and

S

NA

and

NB

are nonces generated by

A

and

B

respectively

{KAB

} is a symmetric, generated key, which will be the session key of the session between

A

and

B

The protocol can be specified as follows in security protocol notation:

AS:\left.A,B,NA\right.

Alice sends a message to the server identifying herself and Bob, telling the server she wants to communicate with Bob.

SA:\{NA,KAB,B,\{KAB,

A\}
KBS
\}
KAS

The server generates

{KAB

} and sends back to Alice a copy encrypted under

{KBS

} 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.

AB:\{KAB,

A\}
KBS

Alice forwards the key to Bob who can decrypt it with the key he shares with the server, thus authenticating the data.

BA:\{NB\}

KAB

Bob sends Alice a nonce encrypted under

{KAB

} to show that he has the key.

AB:\{NB-1\}

KAB

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[2]). If an attacker uses an older, compromised value for, he can then replay the message

\{KAB,

A\}
KBS
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.[3] At the beginning of the protocol:

AB:A

Alice sends to Bob a request.

BA:\{A,NB'\}

KBS

Bob responds with a nonce encrypted under his key with the Server.

AS:\left.A,B,NA,\{A,NB'\}

KBS

\right.

Alice sends a message to the server identifying herself and Bob, telling the server she wants to communicate with Bob.

SA:\{NA,KAB,B,\{KAB,A,NB'\}

KBS
\}
KAS

Note the inclusion of the nonce.

The protocol then continues as described through the final three steps as described in the original protocol above. Note that

NB'

is a different nonce from . The inclusion of this new nonce prevents the replaying of a compromised version of

\{KAB,

A\}
KBS
since such a message would need to be of the form

\{KAB,A,NB'\}

KBS
which the attacker can't forge since she does not have .

Public-key protocol

This assumes the use of a public-key encryption algorithm.

Here, Alice

(A)

and Bob

(B)

use a trusted server

(S)

to distribute public keys on request. These keys are:

KPA

and, respectively public and private halves of an encryption key-pair belonging to

A

(

S

stands for "secret key" here)

KPB

and, similar belonging to

B

KPS

and, similar belonging to . (Note that this key-pair will be used for digital signatures, i.e.,

KSS

used for signing a message and

KPS

used for verification.

KPS

must be known to

A

and

B

before the protocol starts.)

The protocol runs as follows:

AS:\left.A,B\right.

A

requests 's public keys from .

SA:\{KPB,

B\}
KSS

S

responds with public key

KPB

alongside 's identity, signed by the server for authentication purposes.

AB:\{NA,

A\}
KPB

A

chooses a random

NA

and sends it to .

BS:\left.B,A\right.

B

now knows A wants to communicate, so

B

requests 's public keys.

SB:\{KPA,

A\}
KSS

Server responds.

BA:\{NA,NB\}

KPA

B

chooses a random, and sends it to

A

along with

NA

to prove ability to decrypt with .

AB:\{NB\}

KPB

A

confirms

NB

to, to prove ability to decrypt with .

At the end of the protocol,

A

and

B

know each other's identities, and know both

NA

and . These nonces are not known to eavesdroppers.

An attack on the protocol

This protocol is vulnerable to a man-in-the-middle attack. If an impostor

I

can persuade

A

to initiate a session with them, they can relay the messages to

B

and convince

B

that he is communicating with .

Ignoring the traffic to and from

S

, which is unchanged, the attack runs as follows:

AI:\{NA,

A\}
KPI

A

sends

NA

to, who decrypts the message with .

IB:\{NA,

A\}
KPB

I

relays the message to, pretending that

A

is communicating.

BI:\{NA,NB\}

KPA

B

sends

NB

.

IA:\{NA,NB\}

KPA

I

relays it to .

AI:\{NB\}

KPI

A

decrypts

NB

and confirms it to, who learns it.

IB:\{NB\}

KPB

I

re-encrypts, and convinces

B

that she's decrypted it.

At the end of the attack,

B

falsely believes that

A

is communicating with him, and that

NA

and

NB

are known only to

A

and .

The following example illustrates the attack. Alice would like to contact her bank . We assume that an impostor successfully convinces

A

that they are the bank. As a consequence,

A

uses the public key of

I

instead of using the public key of

B

to encrypt the messages she intends to send to her bank. Therefore,

A

sends

I

her nonce encrypted with the public key of .

I

decrypts the message using their private key and contacts

B

sending it the nonce of

A

encrypted with the public key of

B

.

B

has no way to know that this message was actually sent by .

B

responds with their own nonce and encrypts the message with the public key of . Since

I

is not in possession of the private key of

A

they have to relay the message to

A

without knowing the content. A decrypts the message with her private key and respond with the nonce of

B

encrypted with the public key of .

I

decrypts the message using their private key and is now in possession of nonce

A

and . Therefore, they can now impersonate the bank and the client respectively.

Fixing the man-in-the-middle attack

The attack was first described in a 1995 paper by Gavin Lowe.[4] 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:

BA:\{NA,NB\}

KPA
with the fixed version:

BA:\{NA,NB,

B\}
KPA
and the intruder cannot successfully replay the message because A is expecting a message containing the identity of I whereas the message will have identity of .

See also

External links

Notes and References

  1. Needham . Roger . Schroeder . Michael . Using encryption for authentication in large networks of computers. . Communications of the ACM . 21 . 12 . December 1978 . 993–999 . 10.1145/359657.359659 . 10.1.1.357.4298 . 7704786 .
  2. Denning . Dorothy E. . Sacco . Giovanni Maria . Dorothy E. Denning . 1981 . Timestamps in key distribution protocols . Communications of the ACM . 24 . 8 . 533–535 . 10.1145/358722.358740 . 3228356 . free .
  3. Needham . R. M. . Roger Needham . Schroeder . M. D. . Michael Schroeder . 1987 . Authentication revisited . ACM SIGOPS Operating Systems Review . 21 . 1 . 7 . 10.1145/24592.24593 . 33658476 . free .
  4. Lowe . Gavin . An attack on the Needham–Schroeder public key authentication protocol. . Information Processing Letters . 56 . 3 . 131–136 . November 1995 . 10.1016/0020-0190(95)00144-2 . 2008-04-17 . 10.1.1.394.6094.