222 lines
6.3 KiB
TeX
222 lines
6.3 KiB
TeX
|
\documentclass[12pt,a4paper,german]{article}
|
|||
|
\usepackage{url}
|
|||
|
%\usepackage{graphics}
|
|||
|
\usepackage{times}
|
|||
|
\usepackage[T1]{fontenc}
|
|||
|
\usepackage{pifont}
|
|||
|
\usepackage{ngerman}
|
|||
|
\usepackage{float}
|
|||
|
\usepackage{diagbox}
|
|||
|
\usepackage[latin1]{inputenc}
|
|||
|
\usepackage{geometry}
|
|||
|
\usepackage{amsfonts}
|
|||
|
\usepackage{amsmath}
|
|||
|
\usepackage{csquotes}
|
|||
|
\usepackage{graphicx}
|
|||
|
\usepackage{epsfig}
|
|||
|
\usepackage{paralist}
|
|||
|
\geometry{left=2.0cm,textwidth=17cm,top=3.5cm,textheight=23cm}
|
|||
|
|
|||
|
%%%%%%%%%% Fill out the the definitions %%%%%%%%%
|
|||
|
\def \name {Valentin Brandl} %
|
|||
|
\def \matrikel {108018274494} %
|
|||
|
% \def \pname {Vorname2 Nachname2} %
|
|||
|
% \def \pmatrikel {Matrikelnummer2} %
|
|||
|
\def \gruppe {Gruppe 193} %
|
|||
|
\def \uebung {1} %
|
|||
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|||
|
|
|||
|
% DO NOT MODIFY THIS HEADER
|
|||
|
\newcommand{\hwsol}{
|
|||
|
\vspace*{-2cm}
|
|||
|
\noindent \matrikel \quad \name \hfill Gruppe:\gruppe \\
|
|||
|
% \noindent \pmatrikel \quad \pname \\
|
|||
|
\begin{center}{\Large \bf L\"osung f\"ur \"Ubung \# \uebung}\end{center}
|
|||
|
}
|
|||
|
|
|||
|
\newcommand{\cmark}{\ding{51}}%
|
|||
|
\newcommand{\xmark}{\ding{55}}%
|
|||
|
|
|||
|
\begin{document}
|
|||
|
%Import header
|
|||
|
\hwsol
|
|||
|
|
|||
|
|
|||
|
\section*{Aufgabe 1}
|
|||
|
|
|||
|
Ciphertext:
|
|||
|
|
|||
|
\begin{align*}
|
|||
|
\text{Hex} && \text{Bin} \\
|
|||
|
(DC)_{16} &=& (11011100)_2 \\
|
|||
|
(48)_{16} &=& (01001000)_2 \\
|
|||
|
(13)_{16} &=& (00010011)_2
|
|||
|
\end{align*}
|
|||
|
|
|||
|
Schl<EFBFBD>ssel:
|
|||
|
|
|||
|
\begin{align*}
|
|||
|
\text{Hex} && \text{Bin} \\
|
|||
|
(98)_{16} &=& (10011000)_2 \\
|
|||
|
(29)_{16} &=& (00101001)_2 \\
|
|||
|
(60)_{16} &=& (01100000)_2
|
|||
|
\end{align*}
|
|||
|
|
|||
|
Bin<EFBFBD>re berechnung der ersten 3 Bytes:
|
|||
|
|
|||
|
\begin{itemize}
|
|||
|
|
|||
|
\item
|
|||
|
\begin{tabular}{ccccccccc}
|
|||
|
& 1 & 1 & 0 & 1 & 1 & 1 & 0 & 0 \\
|
|||
|
xor & 1 & 0 & 0 & 1 & 1 & 0 & 0 & 0 \\
|
|||
|
\hline
|
|||
|
& 0 & 1 & 0 & 0 & 0 & 1 & 0 & 0
|
|||
|
\end{tabular}
|
|||
|
|
|||
|
$(01000100)_2 = (44)_{16} = `D`_{ASCII}$
|
|||
|
|
|||
|
|
|||
|
\item
|
|||
|
\begin{tabular}{ccccccccc}
|
|||
|
& 0 & 1 & 0 & 0 & 1 & 0 & 0 & 0 \\
|
|||
|
xor & 0 & 0 & 1 & 0 & 1 & 0 & 0 & 1 \\
|
|||
|
\hline
|
|||
|
& 0 & 1 & 1 & 0 & 0 & 0 & 0 & 1
|
|||
|
\end{tabular}
|
|||
|
|
|||
|
$(01100001)_2 = (61)_{16} = `a`_{ASCII}$
|
|||
|
|
|||
|
\item
|
|||
|
\begin{tabular}{ccccccccc}
|
|||
|
& 0 & 0 & 0 & 1 & 0 & 0 & 1 & 1 \\
|
|||
|
xor & 0 & 1 & 1 & 0 & 0 & 0 & 0 & 0 \\
|
|||
|
\hline
|
|||
|
& 0 & 1 & 1 & 1 & 0 & 0 & 1 & 1
|
|||
|
\end{tabular}
|
|||
|
|
|||
|
$(01110011)_2 = (73)_{16} = `s`_{ASCII}$
|
|||
|
|
|||
|
\end{itemize}
|
|||
|
|
|||
|
\begin{itemize}
|
|||
|
|
|||
|
\item
|
|||
|
\begin{tabular}{lcccccccccccc}
|
|||
|
Ciphertext & DC & 48 & 13 & 3B & 9C & 4C & 49 & 80 & AC & A7 & B9 & 54 \\
|
|||
|
Schl<68>ssel & 98 & 29 & 60 & 72 & F2 & 38 & 2C & F2 & C2 & C2 & CD & 1D \\
|
|||
|
\hline
|
|||
|
Plaintext & 44 & 61 & 73 & 49 & 6E & 74 & 65 & 72 & 6E & 65 & 74 & 49 \\
|
|||
|
ASCII & D & a & s & I & n & t & e & r & n & e & t & I
|
|||
|
\end{tabular}
|
|||
|
|
|||
|
\item
|
|||
|
\begin{tabular}{lcccccccccccc}
|
|||
|
Ciphertext & F2 & 7C & 2B & 9E & D5 & DF & 0D & 05 & B3 & 1D & 4E & F8 \\
|
|||
|
Schl<68>ssel & 81 & 08 & 65 & FB & A0 & B3 & 6C & 6B & D7 & 3C & 6F & D9 \\
|
|||
|
\hline
|
|||
|
Plaintext & 73 & 74 & 4E & 65 & 75 & 6C & 61 & 6E & 64 & 21 & 21 & 21 \\
|
|||
|
ASCII & s & t & N & e & u & l & a & n & d & ! & ! & !
|
|||
|
\end{tabular}
|
|||
|
|
|||
|
Plaintext: \enquote{DasInternetIstNeuland!!!}.
|
|||
|
|
|||
|
\end{itemize}
|
|||
|
|
|||
|
\section*{Aufgabe 2}
|
|||
|
|
|||
|
Da jedes Bit im Ciphertext ein eigenes Bit im Schl<68>ssel hat, l<>sst sich jeder beliebige Klartext (der selben L<>nge) aus
|
|||
|
dem Ciphertext ableiten, zumindest wenn der Schl<68>ssel richtig gew<65>hlt wird. Daher ist es nicht m<>glich, zu sagen, ob ein
|
|||
|
Schl<EFBFBD>ssel korrekt ist, ohne den urspr<70>nglichen Plaintext zu kennen.
|
|||
|
|
|||
|
\section*{Aufgabe 3}
|
|||
|
|
|||
|
\begin{enumerate}[(a)]
|
|||
|
|
|||
|
\item Die Magic Number des PNG Formats ist $89$ $50$ $4e$ $47$ $0d$ $0a$ $1a$ $0a$. Diese 8 Bytes bilden den Anfang
|
|||
|
jeder validen PNG Datei. Das er<65>ffnet die M<>glichkeit f<>r einen Known-Plaintext Angriff.
|
|||
|
|
|||
|
\item F<>r $a$, $b$ und $c$ mit $a \text{ xor } b = c$ gilt $b \text{ xor } c = a$ und $a \text{ xor } c = b$, also
|
|||
|
l<>sst sich der Schl<68>ssel berechnen, in dem man den Ciphertext mit dem Known-Plaintext xor'ed.
|
|||
|
|
|||
|
\begin{tabular}{lcccccccc}
|
|||
|
Ciphertext (hex) & 33 & fd & eb & 12 & cd & 0a & 0a & f5 \\
|
|||
|
Known Plaintext (hex) & 89 & 50 & 4e & 47 & 0d & 0a & 1a & 0a \\
|
|||
|
\hline
|
|||
|
Schl<68>ssel (hex) & ba & ad & a5 & 55 & c0 & 00 & 10 & ff \\
|
|||
|
\end{tabular}
|
|||
|
|
|||
|
\item Die S<><53>igkeiten sind im Lageraum im ID (gegen<65>ber vom Fachschaftsraum), in dem Regal direkt gegen<65>ber der
|
|||
|
T<>r. Ca auf der H<>he zwischen T<>re und Grill.
|
|||
|
|
|||
|
\end{enumerate}
|
|||
|
|
|||
|
\section*{Aufgabe 4}
|
|||
|
|
|||
|
\begin{enumerate}[(a)]
|
|||
|
|
|||
|
\item
|
|||
|
\begin{enumerate}[1)]
|
|||
|
|
|||
|
\item Berechnung der ersten 8 Bytes des Schl<68>sselstroms:
|
|||
|
|
|||
|
Known Plaintext: \enquote{https://} $\Rightarrow$ $68$ $74$ $74$ $70$ $73$ $3a$ $2f$ $2f$
|
|||
|
|
|||
|
\begin{tabular}{lcccccccc}
|
|||
|
Ciphertext & 4E & 7E & 3D & 88 & 8E & 01 & 0D & 84 \\
|
|||
|
Known-Plaintext & 68 & 74 & 74 & 70 & 73 & 3A & 2F & 2F \\
|
|||
|
\hline
|
|||
|
Schl<68>ssel & 26 & 0A & 49 & F8 & FD & 3B & 22 & AB \\
|
|||
|
\end{tabular}
|
|||
|
|
|||
|
\item Aufstellen eines Gleichungssystems zur Bestimmung von $A$, $B$ und $C$ des LCG:
|
|||
|
|
|||
|
$m = 257$
|
|||
|
|
|||
|
\begin{eqnarray*}
|
|||
|
S_0 &= (26)_{16} = (38)_{10} \\
|
|||
|
S_1 &= (0A)_{16} = (10)_{10} \\
|
|||
|
S_2 &= (49)_{16} = (73)_{10} \\
|
|||
|
S_3 &= (F8)_{16} = (248)_{10} \\
|
|||
|
S_4 &= (FD)_{16} = (253)_{10} \\\\
|
|||
|
S_2 &\equiv A * S_1 + B * S_0 + C &\mod 257 \\
|
|||
|
S_3 &\equiv A * S_2 + B * S_1 + C &\mod 257 \\
|
|||
|
S_4 &\equiv A * S_3 + B * S_2 + C &\mod 257 \\
|
|||
|
\end{eqnarray*}
|
|||
|
|
|||
|
\begin{align}
|
|||
|
73 &\equiv 10 * A + 38 * B + C &\mod 257 \\
|
|||
|
C &\equiv 73 - 10 * A - 38 * B &\mod 257 \\
|
|||
|
\\
|
|||
|
248 &\equiv 73 * A + 10 * B + 73 - 10 * A - 38 * B &\mod 257 \\
|
|||
|
248 &\equiv 63 * A - 28 * B + 73 &\mod 257 \\
|
|||
|
63 * A &\equiv 175 + 28 * B &\mod 257 \\
|
|||
|
A &\equiv 29 * B + 117 &\mod 257 \\
|
|||
|
\\
|
|||
|
253 &\equiv 248(29*B + 117) + 73 * B + 73 - 10(29*B + 117) - 38*B &\mod 257 \\
|
|||
|
253 &\equiv 253*B + 232 + 73*B + 73 - 33*B - 142 - 38 *B &\mod 257 \\
|
|||
|
253 &\equiv 255*B + 163 &\mod 257 \\
|
|||
|
255*B &\equiv 90 &\mod 257 \\
|
|||
|
\underline{B} &\equiv 212 &\mod 257 \\
|
|||
|
\\
|
|||
|
A &\equiv 29 * 212 + 117 &\mod 257 \\
|
|||
|
\underline{A} &\equiv 97 &\mod 257 \\
|
|||
|
\\
|
|||
|
C &\equiv 73 - 10 * 97 - 38 * 212 &\mod 257 \\
|
|||
|
\underline{C} &\equiv 42 &\mod 257
|
|||
|
\end{align}
|
|||
|
|
|||
|
$A = 97 \mod 257$, $B = 212 \mod 257$, $C = 42 \mod 257$
|
|||
|
|
|||
|
Plaintext: \url{https://youtu.be/VmUGe8KDdGI}
|
|||
|
|
|||
|
\end{enumerate}
|
|||
|
|
|||
|
\item Es werden $n+1$ Parameter und $n$ Seed-Werte ben<65>tigt. Da man also $n+1$ Unbekannte im aufzustellenden
|
|||
|
Gleichungssystem hat, werden auch $n+1$ Klartext-Chiffretext-Paare f<>r einen erfolgreichen Angriff ben<65>tigt.
|
|||
|
|
|||
|
\end{enumerate}
|
|||
|
|
|||
|
\end{document}
|
|||
|
|