6 \begin{document} |
6 \begin{document} |
7 |
7 |
8 \section*{Handout 5 (Protocols)} |
8 \section*{Handout 5 (Protocols)} |
9 |
9 |
10 Protocols are the computer science equivalent to fractals and |
10 Protocols are the computer science equivalent to fractals and |
11 the Mandelbrot set in mathematics. With the latter you have a |
11 the Mandelbrot set in mathematics. With the latter two you |
12 simple formula which you just iterate and then you test |
12 have a simple formula, which you just iterate and then you |
13 whether a point is inside or outside a region, and voila |
13 test whether a point is inside or outside a region\ldots{}it |
14 something magically |
14 does not look exciting, but voila something magically |
15 happened.\footnote{\url{http://en.wikipedia.org/wiki/Fractal}, |
15 happened.\footnote{\url{http://en.wikipedia.org/wiki/Fractal}, |
16 \url{http://en.wikipedia.org/wiki/Mandelbrot_set}} Protocols |
16 \url{http://en.wikipedia.org/wiki/Mandelbrot_set}} Protocols |
17 are similar: they are simple exchanges of messages, but in the |
17 are similar: they are simple exchanges of messages, but in the |
18 end something ``magical'' can happen---for example a secret |
18 end something ``magical'' can happen---for example a secret |
19 channel has been established or two entities have |
19 channel has been established or two entities have |
20 authenticated themselves to each other. The problem with magic |
20 authenticated themselves to each other. Even in face of strong |
21 is of course it is poorly understood and even experts often |
21 adversaries where we have no control over the network over |
22 got, and get, it wrong with protocols. |
22 which our messages are exchanged. The problem with magic is of |
23 |
23 course it is poorly understood and even experts often got, and |
24 To have an idea what kind of protocols we are interested, let |
24 get, it wrong with protocols. |
|
25 |
|
26 To have an idea what kind of protocols we are interested in, let |
25 us look at a few examples. One example are (wireless) key |
27 us look at a few examples. One example are (wireless) key |
26 fobs which operate the central locking system and the |
28 fobs, which operate the central locking system and the |
27 ignition in a car. |
29 ignition in a car. |
28 |
30 |
29 \begin{center} |
31 \begin{center} |
30 \includegraphics[scale=0.075]{../pics/keyfob.jpg} |
32 \includegraphics[scale=0.075]{../pics/keyfob.jpg} |
31 \quad |
33 \quad |
32 \includegraphics[scale=0.2025]{../pics/startstop.jpg} |
34 \includegraphics[scale=0.2025]{../pics/startstop.jpg} |
33 \end{center} |
35 \end{center} |
34 |
36 |
35 \noindent The point of these key fobs is that everything is |
37 \noindent The point of these key fobs is that everything is |
36 done over the ``air''---there is no physical connection |
38 done over the ``air''---there is no physical connection |
37 between the key, doors and engine. So we must achieve security |
39 between the key, doors and engine, as was the case with the |
38 by exchanging certain messages between the key fob on one side |
40 old solid metal keys. With the key fobs we must achieve |
39 and doors and engine on the other. Clearly what we like to |
41 security by exchanging certain messages between the key fob on |
40 achieve is that I can get into my car and start it, but that |
42 one side and the doors and engine on the other. Clearly what |
41 thieves are kept out. The problem is that everybody can |
43 we like to accomplish is that I can get into my car and start |
42 ``overhear'' or skim the exchange of messages between the key |
44 it, but that thieves are kept out. The problem is that |
43 fob and car. In this scenario the simplest attack you need to |
45 everybody can ``overhear'' or skim the exchange of messages |
44 defend against is a person-in-the-middle attack. Imagine you |
46 between the key fob and car. In this scenario the simplest |
45 park your car in front of a supermarket. One thief follows you |
47 attack you need to defend against is a person-in-the-middle |
46 with a strong transmitter. A second thief ``listens'' to the |
48 attack. For this imagine you park your car in front of a |
47 signal from the car and wirelessly transmits it to the |
49 supermarket. One thief follows you with a strong transmitter. |
48 ``colleague'' who followed you and who silently enquires about |
50 A second thief ``listens'' to the signals from the car and |
49 the answer from the key fob. The answer is then send back to |
51 wirelessly transmits them to the ``colleague'' who followed |
50 the thief at the car, which then dutifully opens and possibly |
52 you. This thief silently enquires what the key fob answers. |
51 starts. No need to steal your key anymore. |
53 This answer is then send back to the thief at the car. If done |
52 |
54 properly the car will dutifully open and possibly start. No |
53 But there are many more such protocols we like to consider. |
55 need to steal your keys anymore. |
54 Other examples are wifi---you might sit at a Starbucks and |
56 |
|
57 But there are many more such protocols we like to treat. |
|
58 Another example is Wifi---you might sit at a Starbucks and |
55 talk wirelessly to the free access point there and from there |
59 talk wirelessly to the free access point there and from there |
56 talk with your bank, for example. Also even if your have to |
60 talk to your bank. Moreover, even if your have to touch your |
57 touch your Oyster card at the reader each time you enter and |
61 Oyster card at the reader each time you enter or exit the |
58 exit the Tube, it actually operates wirelessly and with |
62 Tube, it actually operates wirelessly and with appropriate |
59 appropriate equipment over some quite large distance. But |
63 equipment over some quite large distance (several meters). But |
60 there are many many more examples (Bitcoins, mobile |
64 there are many, many more examples (Bitcoins, mobile |
61 phones,\ldots). The common characteristics of the protocols we |
65 phones,\ldots). The common characteristics of the protocols we |
62 are interested in here is that an adversary or attacker is |
66 are interested in is that an adversary or attacker is assumed |
63 assumed to be in complete control over the network or channel |
67 to be in complete control over the network or channel over |
64 over which you exchanging messages. An attacker can install a |
68 which we exchanging messages. An attacker can install a packet |
65 packet sniffer on a network, inject packets, modify packets, |
69 sniffer on a network, inject packets, modify packets, replay |
66 replay old messages, or fake pretty much everything. In this |
70 old messages, or fake pretty much everything else. In this |
67 hostile environment, the purpose of protocols (that is |
71 hostile environment, the purpose of a protocol (that is |
68 exchange of messages) is to achieve some security goal, for |
72 exchange of messages) is to achieve some security goal. For |
69 example only allow the owner of the car in but everybody else |
73 example only allow the owner of the car in, but everybody else |
70 should be kept out. |
74 should stay out. |
71 |
75 |
72 The protocols we are interested here are generic descriptions |
76 The protocols we are interested here are generic descriptions |
73 of how to exchange messages in order to achieve a goal, be it |
77 of how to exchange messages in order to achieve a goal. Unlike |
74 establishing a mutual secure connection or being able to |
78 the distant past where, for example, we had to meet a person in |
75 authenticate to a system. Unlike the distant past where for |
79 order to authenticate him or her (via a passport for example), |
76 example we had to meet a person in order to authenticate him |
80 the problem we are facing on the Internet is that we cannot |
77 or her (via a passport for example), the problem we are facing |
81 easily be sure who we are ``talking'' to. The obvious reason |
78 on the Internet is that we cannot easily be sure who we are |
82 is that only some electrons arrive at our computer; we do not |
79 ``talking'' to. The obvious reason is that only some electrons |
83 see the person, or computer, behind the incoming electrons |
80 arrive at our computer; we do not see the person, or computer, |
84 (messages). |
81 behind the incoming electrons (messages). |
|
82 |
85 |
83 To start, let us look at one of the simplest protocols that |
86 To start, let us look at one of the simplest protocols that |
84 are part of the TCP protocol (which underlies the Internet). |
87 are part of the TCP protocol (which underlies the Internet). |
85 This protocol does not do anything security relevant, it just |
88 This protocol does not do anything security relevant, it just |
86 establishes a ``hello'' from a client to a server which the |
89 establishes a ``hello'' from a client to a server which the |
661 |
664 |
662 \noindent and $A$ sends $E$ its first half of the message. |
665 \noindent and $A$ sends $E$ its first half of the message. |
663 |
666 |
664 \begin{center} |
667 \begin{center} |
665 \begin{tabular}{ll@{\hspace{2mm}}l} |
668 \begin{tabular}{ll@{\hspace{2mm}}l} |
666 5) & $A \to E :$ & $H_1$ |
669 5. & $A \to E :$ & $H_1$ |
667 \end{tabular} |
670 \end{tabular} |
668 \end{center} |
671 \end{center} |
669 |
672 |
670 \noindent Neither $E$ nor $B$ can do much with this message. |
673 \noindent Neither $E$ nor $B$ can do much with this message. |
671 Remember it is only half of some ``garbled'' text that cannot |
674 Remember it is only half of some ``garbled'' text that cannot |
672 be decrypted. $E$ could try to forward the message to $B$ and |
675 be decrypted. $E$ could try to forward the message to $B$ and |
673 see what its reply is. |
676 see what its reply is. |
674 |
677 |
675 \begin{center} |
678 \begin{center} |
676 \begin{tabular}{ll@{\hspace{2mm}}l} |
679 \begin{tabular}{ll@{\hspace{2mm}}l} |
677 6) & $E \to B :$ & $H_1$\\ |
680 6. & $E \to B :$ & $H_1$\\ |
678 7) & $B \to E :$ & $\{H_1, M_1\}_{K^{pub}_E}$ |
681 7. & $B \to E :$ & $\{H_1, M_1\}_{K^{pub}_E}$ |
679 \end{tabular} |
682 \end{tabular} |
680 \end{center} |
683 \end{center} |
681 |
684 |
682 \noindent Although $E$ can decrypt the message with its |
685 \noindent Although $E$ can decrypt the message with its |
683 private key, but it only gets the halves $H_1$ and $M_1$ which |
686 private key, but it only gets the halves $H_1$ and $M_1$ which |
684 are of no use yet. In order to get more information it |
687 are of no use yet. In order to get more information it |
685 can send the message to $A$ with $A$'s public key. |
688 can send the message to $A$ with $A$'s public key. |
686 |
689 |
687 \begin{center} |
690 \begin{center} |
688 \begin{tabular}{ll@{\hspace{2mm}}l} |
691 \begin{tabular}{ll@{\hspace{2mm}}l} |
689 8) & $E \to A :$ & $\{H_1, M_1\}_{K^{pub}_A}$ |
692 8. & $E \to A :$ & $\{H_1, M_1\}_{K^{pub}_A}$ |
690 \end{tabular} |
693 \end{tabular} |
691 \end{center} |
694 \end{center} |
692 |
695 |
693 \noindent $A$ would receive this message, decrypt it and |
696 \noindent $A$ would receive this message, decrypt it and |
694 find out it matches with its expectation. It therefore |
697 find out it matches with its expectation. It therefore |
695 sends out the message |
698 sends out the message |
696 |
699 |
697 \begin{center} |
700 \begin{center} |
698 \begin{tabular}{ll@{\hspace{2mm}}l} |
701 \begin{tabular}{ll@{\hspace{2mm}}l} |
699 9) & $A \to E :$ & $\{H_2, M_1\}_{K^{pub}_E}$ |
702 9. & $A \to E :$ & $\{H_2, M_1\}_{K^{pub}_E}$ |
700 \end{tabular} |
703 \end{tabular} |
701 \end{center} |
704 \end{center} |
702 |
705 |
703 \noindent Now $E$ is in the possession of $H_1$ and $H_2$, |
706 \noindent Now $E$ is in the possession of $H_1$ and $H_2$, |
704 which it can join together in order to obtain |
707 which it can join together in order to obtain |