Finish lab

This commit is contained in:
Florian Hoss 2022-06-08 16:26:04 +02:00
parent 88c32093a3
commit 6da3e784cd
9 changed files with 101 additions and 78 deletions

View file

@ -7,7 +7,7 @@ openssl prime -generate -bits 8
\end{verbatim}
\begin{verbatim}
prime1 = 211, prime2 = 223, prime3 = 227, e=11
prime1 = 211, prime2 = 223, e=11
\end{verbatim}
\subsection{Berechnungen}
@ -18,29 +18,36 @@ prime1 = 211, prime2 = 223, prime3 = 227, e=11
\end{align}
\begin{verbatim}
g = 9, x = 2, y = 3
g = 9, x = 2, y = 3, n = 227 (prime3)
\end{verbatim}
\begin{align}
a = g^{x}\ (mod\ prime3) = 9^{2} (mod\ 227) = 81 \\
b = g^{y}\ (mod\ prime3) = 9^{3} (mod\ 227) = 48 \\
k_{1} = b^{x}\ (mod\ prime3) = 48^{2}\ (mod\ 227) = 34 \\
k_{2} = a^{y}\ (mod\ prime3) = 81^{3}\ (mod\ 227) = 34 \\
k = k_{1} = k_{2} = 34
a = g^{x}\ (mod\ n) = 9^{2} (mod\ 227) = 81\ (public\ a) \\
b = g^{y}\ (mod\ n) = 9^{3} (mod\ 227) = 48\ (public\ b) \\
k_{1} = b^{x}\ (mod\ n) = 48^{2}\ (mod\ 227) = 34\ (private) \\
k_{2} = a^{y}\ (mod\ n) = 81^{3}\ (mod\ 227) = 34\ (private) \\
k = k_{1} = k_{2} = 34\ (private)
\end{align}
\subsection{Fragen und Antworten}
1. What attack is the Diffie-Hellman key exchange vulnerable to?
Man in the Middle
- Man in the Middle
2. What measures can be taken to prevent this type of attack?
Encryption, Authentication over QR code or 2Factor-Authentication
- Encryption, Authentication over QR code or 2Factor-Authentication
3. For the Diffie-Hellman, a generator g is used. Explain what a generator is and how can it be found
- A generator is a number that will be the base of the calculation and is shared between the 2 parties. G is a small prime number.
\begin{align}
g^{a}\ (mod\ n) \neq g^{b}\ (mod\ n) \\
g^{(a\ *\ b)}\ (mod\ n) = g^{(b\ *\ a)}\ (mod\ n)
\end{align}
4. Show why for the primes 61,23 and the public key e=60 no private key d can be found
\begin{align}