Rewrote first section of crypto handout
This commit is contained in:
74
Advanced/Cryptography/parts/1 mod.tex
Executable file
74
Advanced/Cryptography/parts/1 mod.tex
Executable file
@ -0,0 +1,74 @@
|
||||
\section{Modular Arithmetic}
|
||||
|
||||
\definition{}
|
||||
$\mathbb{Z}_n$ is the set of integers mod $n$. For example, $\mathbb{Z}_5 = \{0, 1, 2, 3, 4\}$. \par
|
||||
|
||||
\problem{}
|
||||
Create a multiplication addition table for $\mathbb{Z}_4$:
|
||||
|
||||
\begin{center}
|
||||
\begin{tabular}{c | c c c c}
|
||||
+ & 0 & 1 & 2 & 3 \\
|
||||
\hline
|
||||
0 & ? & ? & ? & ? \\
|
||||
1 & ? & ? & ? & ? \\
|
||||
2 & ? & ? & ? & ? \\
|
||||
3 & ? & ? & ? & ? \\
|
||||
\end{tabular}
|
||||
\end{center}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
\definition{}
|
||||
Let $a, b \in \mathbb{Z}_n$. \par
|
||||
If $a \times b = 1$, we say that $b$ is the \textit{inverse} of $a$ in $\mathbb{Z}_n$.
|
||||
|
||||
\vspace{2mm}
|
||||
|
||||
We usually write \say{$a$ inverse} as $a^{-1}$. \par
|
||||
Inverses are \textbf{not} guaranteed to exist.
|
||||
|
||||
\theorem{}<mod_has_inverse>
|
||||
$a$ has an inverse in $\mathbb{Z}_n$ iff $\gcd(a, n) = 1$ \par
|
||||
|
||||
\problem{}
|
||||
Find the inverse of $3$ in $\mathbb{Z}_4$, if one exists. \par
|
||||
Find the inverse of $20$ in $\mathbb{Z}_{14}$, if one exists. \par
|
||||
Find the inverse of $2$ in $\mathbb{Z}_5$, if one exists.
|
||||
%$34^\star \equiv -175 \equiv 366 \pmod{541}$.
|
||||
\vfill
|
||||
|
||||
|
||||
\problem{}
|
||||
Today, we will often assume that $n$ is prime. \par
|
||||
Why? What is special about $\mathbb{Z}_n$ with a prime $n$?
|
||||
|
||||
\vfill
|
||||
\pagebreak
|
||||
|
||||
\problem{}<general_inverse>
|
||||
In general, how can we find the inverse of $a$ in $\mathbb{Z}_n$? Assume $a$ and $n$ are coprime.\par
|
||||
\hint{You can find that $34^{-1}$ is $-175$ in $\mathbb{Z}_{541}$ by looking at a previous problem.}
|
||||
|
||||
\begin{solution}
|
||||
We need an $a^{-1}$ so that $a \times a^{-1} = 1$. \par
|
||||
This means that $aa^{-1} - mk = 1$. \par
|
||||
Since $a$ and $m$ are coprime, $\gcd(a, m) = 1$ and $aa^{-1} - mk = \gcd(a, m)$ \par
|
||||
Now use the extended Euclidean algorithm from \ref{extendedeuclid} to find $a^\star$.
|
||||
\end{solution}
|
||||
|
||||
\vfill
|
||||
|
||||
\definition{}
|
||||
Elements in $\mathbb{Z}_n$ that have an inverse are called \textit{units}. \par
|
||||
The set of units in $\mathbb{Z}_n$ is called $\mathbb{Z}_n^\times$, which is read \say{$\mathbb{Z}$ mod $n$ cross}.
|
||||
|
||||
\problem{}
|
||||
What is $\mathbb{Z}_5^\times$? \par
|
||||
What is $\mathbb{Z}_{12}^\times$? \par
|
||||
|
||||
\vfill
|
||||
\pagebreak
|
||||
|
Reference in New Issue
Block a user