664 \noindent Similarly $B$ splits its message into two halves |
665 \noindent Similarly $B$ splits its message into two halves |
665 $M_1$ and $M_2$. However, $A$ initially only sends the first |
666 $M_1$ and $M_2$. However, $A$ initially only sends the first |
666 half $H_1$ to $B$. Which $B$ answers with the message |
667 half $H_1$ to $B$. Which $B$ answers with the message |
667 consisting of the received $H_1$ and its own first half $M_1$ |
668 consisting of the received $H_1$ and its own first half $M_1$ |
668 encrypted with $A$'s public key. The message in step 5. $A$ |
669 encrypted with $A$'s public key. The message in step 5. $A$ |
669 receives this message, decrypts it and only when the $H_1$ |
670 receives this message, decrypts it and \textbf{only} when the $H_1$ |
670 matches with its first half it send out earlier, $A$ |
671 matches with its first half it send out earlier, $A$ |
671 will send out the second half; see step 6. For this, $A$ |
672 will send out the second half; see step 6. For this, $A$ |
672 adds the received $M_1$ and encrypts both parts with $B$'s |
673 adds the received $M_1$ and encrypts both parts with $B$'s |
673 public key. Finally $B$ checks whether the received $M_1$ |
674 public key. Finally $B$ checks whether the received $M_1$ |
674 matches with its first half, and if yes sends $A$ its |
675 matches with its first half, and if yes sends $A$ its |
787 to make sense out of the two halves (which again do not fit |
788 to make sense out of the two halves (which again do not fit |
788 together). So one option is to send $M_2$. |
789 together). So one option is to send $M_2$. |
789 |
790 |
790 With this the protocol has ended. $E$ was able to decrypt all |
791 With this the protocol has ended. $E$ was able to decrypt all |
791 messages, but what messages did $A$ and $B$ receive and from |
792 messages, but what messages did $A$ and $B$ receive and from |
792 whom? Do you notice that $A$ and $B$ will find out that |
793 whom? Was $E$ able to modify the messages? If yes, were |
|
794 $A$ and $B$ able to find out that |
793 something strange is going on and probably not talk on this |
795 something strange is going on and probably not talk on this |
794 channel anymore? I leave you to think about it. |
796 channel anymore? I leave you to think about it.\footnote{\rotatebox{180}{ |
795 \footnote{\rotatebox{180}{ |
|
796 \begin{minipage}{10cm} |
797 \begin{minipage}{10cm} |
797 Consider the case where $A$ sends |
798 Consider the case where $A$ sends |
798 the message ``How is your grandmother?'' to $B$, and $B$ |
799 the message ``How is your grandmother?'' to $B$, and $B$ |
799 send the message ``How is the weather in London today'' to $A$. |
800 send the message ``How is the weather in London today'' to $A$. Another |
800 \end{minipage}}} |
801 possibility: what if $A$ and $B$ include a voice message in there |
|
802 messages. |
|
803 \end{minipage}}}\bigskip |
|
804 |
|
805 \noindent |
|
806 I hope you have thought about all these questions. Maybe you noticed that |
|
807 there is a way to defeat the lockstep protocol. If an attacker could only |
|
808 forward the (unmodified) messages, then all would be great. Because then |
|
809 it could be used to establish secret keys using the Hellman-Diffie |
|
810 technique (see further reading). That $E$ was able to decrypt all messages |
|
811 is of no importance for the Hellman-Diffie |
|
812 technique. |
|
813 |
|
814 Unfortunately, $E$ can create completely fake messages. Let |
|
815 us look at this possibility: $E$ intercepts again the keys from $A$ |
|
816 and $B$, and substitutes its own keys. |
|
817 |
|
818 \begin{center} |
|
819 \begin{tabular}{ll@{\hspace{2mm}}l} |
|
820 1. & $A \to E :$ & $K^{pub}_A$\smallskip\\ |
|
821 2. & $E \to B :$ & $K^{pub}_E$\smallskip\\ |
|
822 3. & $B \to E :$ & $K^{pub}_B$\smallskip\\ |
|
823 4. & $E \to A :$ & $K^{pub}_E$ |
|
824 \end{tabular} |
|
825 \end{center} |
|
826 |
|
827 \noindent |
|
828 Now $A$ and $B$ build again their message halves: |
|
829 |
|
830 \[ |
|
831 \{A,m\}_{K^{pub}_E} \;\mapsto\; H_1,H_2\qquad |
|
832 \{B,m'\}_{K^{pub}_E} \;\mapsto\; M_1,M_2 |
|
833 \] |
|
834 |
|
835 \noindent |
|
836 $A$ sends its first half $H_1$. |
|
837 |
|
838 \begin{center} |
|
839 \begin{tabular}{ll@{\hspace{2mm}}l} |
|
840 5. & $A \to E :$ & $H_1$ |
|
841 \end{tabular} |
|
842 \end{center} |
|
843 |
|
844 \noindent At this stage of the protocol, |
|
845 also $E$ creates two messages and halves them, say |
|
846 |
|
847 \[ |
|
848 \{E,m_E\}_{K^{pub}_E} \;\mapsto\; C_1,C_2\qquad |
|
849 \{E,m'_E\}_{K^{pub}_E} \;\mapsto\; D_1,D_2 |
|
850 \] |
|
851 |
|
852 \noindent |
|
853 But notice that $E$ has to make up these messages out of |
|
854 thin air. No information from $A$ and $B$ is usable yet---remember |
|
855 the half $H_1$ on its own cannot be decrypted. $E$ can then send |
|
856 $C_1$ to $B$, which dutifully responds |
|
857 |
|
858 \begin{center} |
|
859 \begin{tabular}{ll@{\hspace{2mm}}l} |
|
860 6. & $E \to B :$ & $C_1$\\ |
|
861 7. & $B \to E :$ & $\{C_1, M_1\}_{K^{pub}_E}$ |
|
862 \end{tabular} |
|
863 \end{center} |
|
864 |
|
865 \noindent |
|
866 Next $E$ has to send a message to $A$---it can use the made up $D_1$ and |
|
867 the $H_1$ received earlier. |
|
868 |
|
869 \begin{center} |
|
870 \begin{tabular}{ll@{\hspace{2mm}}l} |
|
871 8. & $E \to A :$ & $\{H_1, D_1\}_{K^{pub}_A}$ |
|
872 \end{tabular} |
|
873 \end{center} |
|
874 |
|
875 \noindent |
|
876 $A$ can verify it received $H_1$ and thus sends out |
|
877 |
|
878 \begin{center} |
|
879 \begin{tabular}{ll@{\hspace{2mm}}l} |
|
880 9. & $A \to E :$ & $\{H_2, D_1\}_{K^{pub}_E}$ |
|
881 \end{tabular} |
|
882 \end{center} |
|
883 |
|
884 \noindent |
|
885 With this $E$ is in the possesion of both halves from $A$. |
|
886 In order to get the reply from $B$, $E$ can send the message |
|
887 |
|
888 \begin{center} |
|
889 \begin{tabular}{ll@{\hspace{2mm}}l} |
|
890 10. & $E \to B :$ & $\{C_2, M_1\}_{K^{pub}_E}$ |
|
891 \end{tabular} |
|
892 \end{center} |
|
893 |
|
894 \noindent |
|
895 and $B$ can verify that it received $M_1$. So it answer |
|
896 with |
|
897 |
|
898 \begin{center} |
|
899 \begin{tabular}{ll@{\hspace{2mm}}l} |
|
900 11. & $B \to E :$ & $M_2$ |
|
901 \end{tabular} |
|
902 \end{center} |
|
903 |
|
904 \noindent Finally $E$ can complete the protocol with sending $D_2$ to $A$: |
|
905 |
|
906 \begin{center} |
|
907 \begin{tabular}{ll@{\hspace{2mm}}l} |
|
908 12. & $E \to A :$ & $D_2$ |
|
909 \end{tabular} |
|
910 \end{center} |
|
911 |
|
912 \noindent |
|
913 $A$ and $B$ receive expected messages and were able to verify |
|
914 their first halves. That means they do not suspect anything dodgy |
|
915 going on: $E$ has sucessfully managed a man-in-the middle attack. |
|
916 In case $A$ and $B$ are computers, there is not much that can |
|
917 prevent this attack. In case they are humans, there are a few |
|
918 things they can do. For example $A$ and $B$ can craft their |
|
919 messages such that they include a specific question only $A$ and |
|
920 $B$ are likely to be able to answer, or include a voice message |
|
921 which identifies $A$ and $B$ by their voice. The point is $E$ should |
|
922 not be able to create legit looking messages. Humans can do this |
|
923 if they have some minimal knowledge of the protocol partner (for example |
|
924 know their voice from TV); but computers cannot. The conclusion is |
|
925 that there is no protocol that can establish a trusted connection |
|
926 without any preshared information. The solution that has evolved |
|
927 over the years is to use certificates which have been created by an |
|
928 authority we (or better the browser) already trust. |
|
929 |
|
930 \section*{Key Fob Protocol} |
801 |
931 |
802 Recall from the beginning that a person-in-the middle |
932 Recall from the beginning that a person-in-the middle |
803 attack can easily be mounted at the key fob and car |
933 attack can easily be mounted at the key fob and car |
804 protocol unless we are careful. If you look at actual |
934 protocol unless we are careful. If you look at actual |
805 key fob protocols, they use a variant of the protocol |
935 key fob protocols, they use a variant of the protocol |
816 \item $T \to C$: $N, G'$ |
946 \item $T \to C$: $N, G'$ |
817 \item $C$ checks that $G = G'$ |
947 \item $C$ checks that $G = G'$ |
818 \end{enumerate} |
948 \end{enumerate} |
819 |
949 |
820 \noindent The assumption is that the key $K$ is only known to |
950 \noindent The assumption is that the key $K$ is only known to |
821 the car and the transponder. The claim is that $C$ and $T$ can |
951 the car and the transponder. |
|
952 The claim is that $C$ and $T$ can |
822 authenticate to each other. Again, I leave it to you to find |
953 authenticate to each other. Again, I leave it to you to find |
823 out if this protocol is immune from |
954 out, if this protocol is immune from |
824 person-in-the-middle attacks. |
955 person-in-the-middle attacks. (Hint: Does it establish a |
|
956 trusted connection from ``zero''?) |
825 |
957 |
826 |
958 |
827 \subsubsection*{Further Reading} |
959 \subsubsection*{Further Reading} |
828 |
960 |
829 \begin{itemize} |
961 \begin{itemize} |
830 \item A nice video explaining the Hellman-Diffie key excahnge technique |
962 \item A nice video explaining the Hellman-Diffie key exchange technique |
831 is here |
963 is here |
832 |
964 |
833 \begin{center} |
965 \begin{center} |
834 \url{https://www.youtube.com/watch?v=YEBfamv-_do} |
966 \url{https://www.youtube.com/watch?v=YEBfamv-_do} |
835 \end{center} |
967 \end{center} |
836 |
968 |
837 The main point of this technique is that no sensitive information |
969 The main point of this technique is that no sensitive information |
838 is sent over the network---both parties create the key together. |
970 is sent over the network---both parties create the key together, but |
|
971 on their computer, not over the network. |
839 While the technique is cryptographic magic, it can be attacked |
972 While the technique is cryptographic magic, it can be attacked |
840 when messages can be manipulated during transit. |
973 when messages can be manipulated during transit. Remember that |
|
974 the lockstep protocol can only be attacked by either passively |
|
975 forwarding the messages (without being able to modify them) or |
|
976 by creating complete fake messages. |
841 |
977 |
842 \item A blogpost that describes the first few milliseconds of |
978 \item A blogpost that describes the first few milliseconds of |
843 an HTTPS connection is at |
979 an HTTPS connection is at |
844 |
980 |
845 \begin{center} |
981 \begin{center} |