Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Needham–Schroeder protocol
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|Key transport protocol}}[[File:Symetric Needham-Schroeder-Protocol – linear.svg|thumb|upright=1.3|Symmetric Needham–Schroeder protocol scheme]] 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]].<ref name="needham-schroeder"> {{Cite journal | last1=Needham | first1=Roger | last2=Schroeder | first2=Michael | title=Using encryption for authentication in large networks of computers. | journal=Communications of the ACM | volume=21 | issue=12 | date=December 1978 | pages=993–999 | doi=10.1145/359657.359659 | citeseerx=10.1.1.357.4298 | s2cid=7704786 | url=https://dl.acm.org/doi/pdf/10.1145/359657.359659 }} </ref> These are: * The ''Needham–Schroeder Symmetric Key Protocol'', based on a [[Symmetric-key algorithm|symmetric encryption algorithm]]. It forms the basis for the [[Kerberos (protocol)|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. == Symmetric protocol == Here, [[Alice and Bob|Alice]] <math>(A)</math> initiates the communication to Bob {{tmath|1= B }}. <math>S</math> is a server trusted by both parties. In the communication: * <math>A</math> and <math>B</math> are identities of Alice and Bob respectively * <math>{K_{AS}}</math> is a symmetric key known only to <math>A</math> and <math>S</math> * <math>{K_{BS}}</math> is a symmetric key known only to <math>B</math> and <math>S</math> * <math>N_A</math> and <math>N_B</math> are [[cryptographic nonce|nonces]] generated by <math>A</math> and <math>B</math> respectively * <math>{K_{AB}}</math> is a symmetric, generated key, which will be the [[session key]] of the session between <math>A</math> and <math>B</math> The protocol can be specified as follows in [[security protocol notation]]: : <math>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>S \rightarrow A: \{N_A, K_{AB}, B, \{K_{AB}, A\}_{K_{BS}}\}_{K_{AS}}</math> :: The server generates <math>{K_{AB}}</math> and sends back to Alice a copy encrypted under <math>{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>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>B \rightarrow A: \{N_B\}_{K_{AB}}</math> :: Bob sends Alice a nonce encrypted under <math>{K_{AB}}</math> to show that he has the key. : <math>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 [[Dorothy E. Denning|Denning]] and Sacco<ref>{{cite journal |last1=Denning |first1=Dorothy E. | last2=Sacco | first2=Giovanni Maria |author-link=Dorothy E. Denning |year=1981 |title=Timestamps in key distribution protocols |journal=Communications of the ACM |volume=24 |issue=8 |pages=533–535 |doi=10.1145/358722.358740 |s2cid=3228356 |doi-access=free }}</ref>). If an attacker uses an older, compromised value for {{tmath|1= K_{AB} }}, he can then replay the message <math>\{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.<ref>{{cite journal |last1=Needham |first1=R. M. |author-link=Roger Needham | last2=Schroeder | first2= M. D. | author-link2=Michael Schroeder |year=1987 |title=Authentication revisited |journal=ACM SIGOPS Operating Systems Review |volume=21 |issue=1 |page=7 |doi=10.1145/24592.24593 |s2cid=33658476 |doi-access=free }}</ref> At the beginning of the protocol: : <math>A \rightarrow B: A</math> :: Alice sends to Bob a request. : <math>B \rightarrow A: \{A,N_B'\}_{K_{BS}}</math> :: Bob responds with a nonce encrypted under his key with the Server. : <math>A \rightarrow S: \left . A,B,N_A,\{A,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>S \rightarrow A: \{N_A, K_{AB}, B, \{K_{AB}, A,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 [[#The symmetric protocol|above]]. Note that <math>N_B'</math> is a different nonce from {{tmath|1= N_B }}. The inclusion of this new nonce prevents the replaying of a compromised version of <math>\{K_{AB}, A\}_{K_{BS}}</math> since such a message would need to be of the form <math>\{K_{AB}, A,N_B'\}_{K_{BS}}</math> which the attacker can't forge since she does not have {{tmath|1= K_{BS} }}. == Public-key protocol == This assumes the use of a [[public-key cryptography|public-key encryption algorithm]]. Here, Alice <math>(A)</math> and Bob <math>(B)</math> use a trusted server <math>(S)</math> to distribute public keys on request. These keys are: * <math>K_{PA}</math> and {{tmath|1= K_{SA} }}, respectively public and private halves of an encryption key-pair belonging to <math>A</math> (<math>S</math> stands for "secret key" here) * <math>K_{PB}</math> and {{tmath|1= K_{SB} }}, similar belonging to <math>B</math> * <math>K_{PS}</math> and {{tmath|1= K_{SS} }}, similar belonging to {{tmath|1= S }}. (Note that this key-pair will be used for [[digital signature]]s, i.e., <math>K_{SS}</math> used for signing a message and <math>K_{PS}</math> used for verification. <math>K_{PS}</math> must be known to <math>A</math> and <math>B</math> before the protocol starts.) The protocol runs as follows: : <math>A \rightarrow S: \left . A, B \right .</math> :: <math>A</math> requests {{tmath|1= B }}'s public keys from {{tmath|1= S }}. : <math>S \rightarrow A: \{K_{PB}, B\}_{K_{SS}}</math> :: <math>S</math> responds with public key <math>K_{PB}</math> alongside {{tmath|1= B }}'s identity, signed by the server for authentication purposes. : <math>A \rightarrow B: \{N_A, A\}_{K_{PB}}</math> :: <math>A</math> chooses a random <math>N_A</math> and sends it to {{tmath|1= B }}. : <math>B \rightarrow S: \left. B, A \right .</math> :: <math>B</math> now knows A wants to communicate, so <math>B</math> requests {{tmath|1= A }}'s public keys. : <math>S \rightarrow B: \{K_{PA}, A\}_{K_{SS}}</math> :: Server responds. : <math>B \rightarrow A: \{N_A, N_B\}_{K_{PA}}</math> :: <math>B</math> chooses a random {{tmath|1= N_B }}, and sends it to <math>A</math> along with <math>N_A</math> to prove ability to decrypt with {{tmath|1= K_{SB} }}. : <math>A \rightarrow B: \{N_B\}_{K_{PB}}</math> :: <math>A</math> confirms <math>N_B</math> to {{tmath|1= B }}, to prove ability to decrypt with {{tmath|1= K_{SA} }}. At the end of the protocol, <math>A</math> and <math>B</math> know each other's identities, and know both <math>N_A</math> and {{tmath|1= N_B }}. 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>I</math> can persuade <math>A</math> to initiate a session with them, they can relay the messages to <math>B</math> and convince <math>B</math> that he is communicating with {{tmath|1= A }}. Ignoring the traffic to and from <math>S</math>, which is unchanged, the attack runs as follows: : <math>A \rightarrow I: \{N_A, A\}_{K_{PI}}</math> :: <math>A</math> sends <math>N_A</math> to {{tmath|1= I }}, who decrypts the message with {{tmath|1= K_{SI} }}. : <math>I \rightarrow B: \{N_A, A\}_{K_{PB}}</math> :: <math>I</math> relays the message to {{tmath|1= B }}, pretending that <math>A</math> is communicating. : <math>B \rightarrow I: \{N_A, N_B\}_{K_{PA}}</math> :: <math>B</math> sends <math>N_B</math>. : <math>I \rightarrow A: \{N_A, N_B\}_{K_{PA}}</math> :: <math>I</math> relays it to {{tmath|1= A }}. : <math>A \rightarrow I: \{N_B\}_{K_{PI}}</math> :: <math>A</math> decrypts <math>NB</math> and confirms it to {{tmath|1= I }}, who learns it. : <math>I \rightarrow B: \{N_B\}_{K_{PB}}</math> :: <math>I</math> re-encrypts {{tmath|1= N_B }}, and convinces <math>B</math> that she's decrypted it. At the end of the attack, <math>B</math> falsely believes that <math>A</math> is communicating with him, and that <math>N_A</math> and <math>N_B</math> are known only to <math>A</math> and {{tmath|1= B }}. The following example illustrates the attack. Alice ({{tmath|1= A }}) would like to contact her bank ({{tmath|1= B }}). We assume that an impostor ({{tmath|1= I }}) successfully convinces <math>A</math> that they are the bank. As a consequence, <math>A</math> uses the public key of <math>I</math> instead of using the public key of <math>B</math> to encrypt the messages she intends to send to her bank. Therefore, <math>A</math> sends <math>I</math> her nonce encrypted with the public key of {{tmath|1= I }}. <math>I</math> decrypts the message using their private key and contacts <math>B</math> sending it the nonce of <math>A</math> encrypted with the public key of <math>B</math>. <math>B</math> has no way to know that this message was actually sent by {{tmath|1= I }}. <math>B</math> responds with their own nonce and encrypts the message with the public key of {{tmath|1= A }}. Since <math>I</math> is not in possession of the private key of <math>A</math> they have to relay the message to <math>A</math> without knowing the content. A decrypts the message with her private key and respond with the nonce of <math>B</math> encrypted with the public key of {{tmath|1= I }}. <math>I</math> decrypts the message using their private key and is now in possession of nonce <math>A</math> and {{tmath|1= 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 (computer scientist)|Gavin Lowe]].<ref name="lowe"> {{cite journal | last1=Lowe | first1=Gavin | title=An attack on the Needham–Schroeder public key authentication protocol. | journal=Information Processing Letters | volume=56 | issue=3 | pages=131–136 | date=November 1995 | url=http://web.comlab.ox.ac.uk/oucl/work/gavin.lowe/Security/Papers/NSPKP.ps | doi=10.1016/0020-0190(95)00144-2 | accessdate=2008-04-17 | citeseerx=10.1.1.394.6094 }}</ref> 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>B \rightarrow A: \{N_A, N_B\}_{K_{PA}}</math> with the fixed version: : <math>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 {{tmath|1= B }}. == See also == * [[Kerberos (protocol)|Kerberos]] * [[Otway–Rees protocol]] * [[Yahalom (protocol)|Yahalom]] * [[Wide Mouth Frog protocol]] * [[Neuman–Stubblebine protocol]] * [[Diffie–Hellman key exchange]] == References == {{reflist}} == External links == {{commonscat}} * {{cite web | url=http://www.lsv.fr/Software/spore/nspk.html | title=Needham-Schroeder Public Key |author1=Roger Needham |author2=Michael Schroeder | date=1978 | publisher=Laboratoire Spécification et Vérification }} * {{cite web | url=http://www.lsv.fr/Software/spore/nssk.html | title=Needham Schroeder Symmetric Key |author1=Roger Needham |author2=Michael Schroeder | date=1978 | publisher=Laboratoire Spécification et Vérification }} * {{cite web | url=http://www.lsv.fr/Software/spore/nspkLowe.html | title=Lowe's fixed version of Needham-Schroder Public Key |author=Gavin Lowe | date=1995 | publisher=Laboratoire Spécification et Vérification }} * [https://www.youtube.com/watch?v=EtpdLBeIaus Explanation of man-in-the-middle attack] by [[Brady Haran#Other YouTube channels|Computerphile]]. {{DEFAULTSORT:Needham-Schroeder Protocol}} [[Category:Authentication protocols]] [[Category:Key transport protocols]] [[Category:Symmetric-key cryptography]] [[Category:Computer access control protocols]] [[Category:Telecommunication protocols]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Pages transcluded onto the current version of this page
(
help
)
:
Template:Cite journal
(
edit
)
Template:Cite web
(
edit
)
Template:Commonscat
(
edit
)
Template:Reflist
(
edit
)
Template:Short description
(
edit
)
Template:Tmath
(
edit
)