Needham–Schroeder protocol
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:
- 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.
The symmetric protocol
Here, Alice [math]\displaystyle{ (A) }[/math] initiates the communication to Bob [math]\displaystyle{ B }[/math]. [math]\displaystyle{ S }[/math] is a server trusted by both parties. In the communication:
- [math]\displaystyle{ A }[/math] and [math]\displaystyle{ B }[/math] are identities of Alice and Bob respectively
- [math]\displaystyle{ {K_{AS}} }[/math] is a symmetric key known only to [math]\displaystyle{ A }[/math] and [math]\displaystyle{ S }[/math]
- [math]\displaystyle{ {K_{BS}} }[/math] is a symmetric key known only to [math]\displaystyle{ B }[/math] and [math]\displaystyle{ S }[/math]
- [math]\displaystyle{ N_A }[/math] and [math]\displaystyle{ N_B }[/math] are nonces generated by [math]\displaystyle{ A }[/math] and [math]\displaystyle{ B }[/math] respectively
- [math]\displaystyle{ {K_{AB}} }[/math] is a symmetric, generated key, which will be the session key of the session between [math]\displaystyle{ A }[/math] and [math]\displaystyle{ B }[/math]
The protocol can be specified as follows in security protocol notation:
[math]\displaystyle{ A \rightarrow S: \left . A,B,N_A \right . }[/math]
- Alice sends a message to the server identifying herself and Bob, telling the server she wants to communicate with Bob.
[math]\displaystyle{ S \rightarrow A: \{N_A, K_{AB}, B, \{K_{AB}, A\}_{K_{BS}}\}_{K_{AS}} }[/math]
- The server generates [math]\displaystyle{ {K_{AB}} }[/math] and sends back to Alice a copy encrypted under [math]\displaystyle{ {K_{BS}} }[/math] 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.
[math]\displaystyle{ A \rightarrow B: \{K_{AB}, A\}_{K_{BS}} }[/math]
- Alice forwards the key to Bob who can decrypt it with the key he shares with the server, thus authenticating the data.
[math]\displaystyle{ B \rightarrow A: \{N_B\}_{K_{AB}} }[/math]
- Bob sends Alice a nonce encrypted under [math]\displaystyle{ {K_{AB}} }[/math] to show that he has the key.
[math]\displaystyle{ A \rightarrow B: \{N_B-1\}_{K_{AB}} }[/math]
- 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 [math]\displaystyle{ K_{AB} }[/math], he can then replay the message [math]\displaystyle{ \{K_{AB}, A\}_{K_{BS}} }[/math] 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:
- [math]\displaystyle{ A \rightarrow B: A }[/math]
- Alice sends to Bob a request.
- [math]\displaystyle{ B \rightarrow A: \{A,\mathbf{N_B'}\}_{K_{BS}} }[/math]
- Bob responds with a nonce encrypted under his key with the Server.
- [math]\displaystyle{ A \rightarrow S: \left . A,B,N_A,\{A,\mathbf{N_B'}\}_{K_{BS}} \right . }[/math]
- Alice sends a message to the server identifying herself and Bob, telling the server she wants to communicate with Bob.
- [math]\displaystyle{ S \rightarrow A: \{N_A, K_{AB}, B, \{K_{AB}, A,\mathbf{N_B'}\}_{K_{BS}}\}_{K_{AS}} }[/math]
- 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 [math]\displaystyle{ N_B' }[/math] is a different nonce from [math]\displaystyle{ N_B }[/math]. The inclusion of this new nonce prevents the replaying of a compromised version of [math]\displaystyle{ \{K_{AB}, A\}_{K_{BS}} }[/math] since such a message would need to be of the form [math]\displaystyle{ \{K_{AB}, A,\mathbf{N_B'}\}_{K_{BS}} }[/math] which the attacker can't forge since she does not have [math]\displaystyle{ K_{BS} }[/math].
The public-key protocol
This assumes the use of a public-key encryption algorithm.
Here, Alice [math]\displaystyle{ (A) }[/math] and Bob [math]\displaystyle{ (B) }[/math] use a trusted server [math]\displaystyle{ (S) }[/math] to distribute public keys on request. These keys are:
- [math]\displaystyle{ K_{PA} }[/math] and [math]\displaystyle{ K_{SA} }[/math], respectively public and private halves of an encryption key-pair belonging to [math]\displaystyle{ A }[/math] ([math]\displaystyle{ S }[/math] stands for "secret key" here)
- [math]\displaystyle{ K_{PB} }[/math] and [math]\displaystyle{ K_{SB} }[/math], similar belonging to [math]\displaystyle{ B }[/math]
- [math]\displaystyle{ K_{PS} }[/math] and [math]\displaystyle{ K_{SS} }[/math], similar belonging to [math]\displaystyle{ S }[/math]. (Note that this key-pair will be used for digital signatures, i.e., [math]\displaystyle{ K_{SS} }[/math] used for signing a message and [math]\displaystyle{ K_{PS} }[/math] used for verification. [math]\displaystyle{ K_{PS} }[/math] must be known to [math]\displaystyle{ A }[/math] and [math]\displaystyle{ B }[/math] before the protocol starts.)
The protocol runs as follows:
[math]\displaystyle{ A \rightarrow S: \left . A, B \right . }[/math]
- [math]\displaystyle{ A }[/math] requests [math]\displaystyle{ B }[/math]'s public keys from [math]\displaystyle{ S }[/math]
[math]\displaystyle{ S \rightarrow A: \{K_{PB}, B\}_{K_{SS}} }[/math]
- [math]\displaystyle{ S }[/math] responds with public key [math]\displaystyle{ K_{PB} }[/math] alongside [math]\displaystyle{ B }[/math]'s identity, signed by the server for authentication purposes.
[math]\displaystyle{ A \rightarrow B: \{N_A, A\}_{K_{PB}} }[/math]
- [math]\displaystyle{ A }[/math] chooses a random [math]\displaystyle{ N_A }[/math] and sends it to [math]\displaystyle{ B }[/math].
[math]\displaystyle{ B \rightarrow S: \left. B, A \right . }[/math]
- [math]\displaystyle{ B }[/math] now knows A wants to communicate, so [math]\displaystyle{ B }[/math] requests [math]\displaystyle{ A }[/math]'s public keys.
[math]\displaystyle{ S \rightarrow B: \{K_{PA}, A\}_{K_{SS}} }[/math]
- Server responds.
[math]\displaystyle{ B \rightarrow A: \{N_A, N_B\}_{K_{PA}} }[/math]
- [math]\displaystyle{ B }[/math] chooses a random [math]\displaystyle{ N_B }[/math], and sends it to [math]\displaystyle{ A }[/math] along with [math]\displaystyle{ N_A }[/math] to prove ability to decrypt with [math]\displaystyle{ K_{SB} }[/math].
[math]\displaystyle{ A \rightarrow B: \{N_B\}_{K_{PB}} }[/math]
- [math]\displaystyle{ A }[/math] confirms [math]\displaystyle{ N_B }[/math] to [math]\displaystyle{ B }[/math], to prove ability to decrypt with [math]\displaystyle{ K_{SA} }[/math]
At the end of the protocol, [math]\displaystyle{ A }[/math] and [math]\displaystyle{ B }[/math] know each other's identities, and know both [math]\displaystyle{ N_A }[/math] and [math]\displaystyle{ N_B }[/math]. 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 [math]\displaystyle{ I }[/math] can persuade [math]\displaystyle{ A }[/math] to initiate a session with them, they can relay the messages to [math]\displaystyle{ B }[/math] and convince [math]\displaystyle{ B }[/math] that he is communicating with [math]\displaystyle{ A }[/math].
Ignoring the traffic to and from [math]\displaystyle{ S }[/math], which is unchanged, the attack runs as follows:
[math]\displaystyle{ A \rightarrow I: \{N_A, A\}_{K_{PI}} }[/math]
- [math]\displaystyle{ A }[/math] sends [math]\displaystyle{ N_A }[/math] to [math]\displaystyle{ I }[/math], who decrypts the message with [math]\displaystyle{ K_{SI} }[/math]
[math]\displaystyle{ I \rightarrow B: \{N_A, A\}_{K_{PB}} }[/math]
- [math]\displaystyle{ I }[/math] relays the message to [math]\displaystyle{ B }[/math], pretending that [math]\displaystyle{ A }[/math] is communicating
[math]\displaystyle{ B \rightarrow I: \{N_A, N_B\}_{K_{PA}} }[/math]
- [math]\displaystyle{ B }[/math] sends [math]\displaystyle{ N_B }[/math]
[math]\displaystyle{ I \rightarrow A: \{N_A, N_B\}_{K_{PA}} }[/math]
- [math]\displaystyle{ I }[/math] relays it to [math]\displaystyle{ A }[/math]
[math]\displaystyle{ A \rightarrow I: \{N_B\}_{K_{PI}} }[/math]
- [math]\displaystyle{ A }[/math] decrypts [math]\displaystyle{ NB }[/math] and confirms it to [math]\displaystyle{ I }[/math], who learns it
[math]\displaystyle{ I \rightarrow B: \{N_B\}_{K_{PB}} }[/math]
- [math]\displaystyle{ I }[/math] re-encrypts [math]\displaystyle{ N_B }[/math], and convinces [math]\displaystyle{ B }[/math] that she's decrypted it
At the end of the attack, [math]\displaystyle{ B }[/math] falsely believes that [math]\displaystyle{ A }[/math] is communicating with him, and that [math]\displaystyle{ N_A }[/math] and [math]\displaystyle{ N_B }[/math] are known only to [math]\displaystyle{ A }[/math] and [math]\displaystyle{ B }[/math].
The following example illustrates the attack. Alice (A) would like to contact her bank (B). We assume that an impostor (I) 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. 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 I. B responds with their own nonce and encrypts the message with the public key of A. 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. I decrypts the message using their private key and is now in possession of nonce A and B. 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:
[math]\displaystyle{ B \rightarrow A: \{N_A, N_B\}_{K_{PA}} }[/math]
with the fixed version:
[math]\displaystyle{ B \rightarrow A: \{N_A, N_B, B\}_{K_{PA}} }[/math]
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 B.
See also
- Kerberos
- Otway–Rees protocol
- Yahalom
- Wide Mouth Frog protocol
- Neuman–Stubblebine protocol
- Diffie-Hellman key exchange
References
- ↑ Needham, Roger; Schroeder, Michael (December 1978). "Using encryption for authentication in large networks of computers.". Communications of the ACM 21 (12): 993–999. doi:10.1145/359657.359659. https://dl.acm.org/doi/pdf/10.1145/359657.359659.
- ↑ Denning, Dorothy E.; Sacco, Giovanni Maria (1981). "Timestamps in key distribution protocols". Communications of the ACM 24 (8): 533–535. doi:10.1145/358722.358740.
- ↑ Needham, R. M.; Schroeder, M. D. (1987). "Authentication revisited". ACM SIGOPS Operating Systems Review 21 (1): 7. doi:10.1145/24592.24593.
- ↑ Lowe, Gavin (November 1995). "An attack on the Needham-Schroeder public key authentication protocol.". Information Processing Letters 56 (3): 131–136. doi:10.1016/0020-0190(95)00144-2. http://web.comlab.ox.ac.uk/oucl/work/gavin.lowe/Security/Papers/NSPKP.ps. Retrieved 2008-04-17.
External links
- "Needham-Schroeder Public Key". Laboratoire Spécification et Vérification. 1978. http://www.lsv.fr/Software/spore/nspk.html.
- "Needham Schroeder Symmetric Key". Laboratoire Spécification et Vérification. 1978. http://www.lsv.fr/Software/spore/nssk.html.
- Gavin Lowe (1995). "Lowe's fixed version of Needham-Schroder Public Key". Laboratoire Spécification et Vérification. http://www.lsv.fr/Software/spore/nspkLowe.html.
- Explanation of man-in-the-middle attack by Computerphile.
Original source: https://en.wikipedia.org/wiki/Needham–Schroeder protocol.
Read more |