Crypto edits

This commit is contained in:
Mark 2024-10-17 21:09:13 -07:00
parent 386b83c83f
commit 8b10780fbe
Signed by: Mark
GPG Key ID: C6D63995FE72FD80
7 changed files with 45 additions and 20 deletions

View File

@ -8,6 +8,7 @@
\usepackage{../../resources/macros}
\usepackage{multicol}
\usepackage{mathtools}
\uptitlel{Advanced 2}
\uptitler{\smallurl{}}

View File

@ -17,20 +17,19 @@ Find $\gcd(20, 14)$ by hand.
Given two integers $a, b$, we can find two integers $q, r$, where $0 \leq r < b$ and $a = qb + r$. \par
In other words, we can divide $a$ by $b$ to get $q$ remainder $r$.
\begin{instructornote}
\ref{divalgo} looks scary on paper, but it's quite simple. \par
Doing a small example on the board (like $14 \div 3$) may be a good idea. \par
\vspace{2mm}
For those that are new to modular arithmetic, you may want to explain how remainders,
clock-face counting, division algorithm, and modular arithmetic are all the same.
\end{instructornote}
\theorem{}<gcd_abc>
For any integers $a, b, c$, \par
$\gcd(ac + b, a) = \gcd(a, b)$
\problem{}
Compute the gcd of 12 and 976.
\begin{solution}
$976 = 3 \times 324 + 4 = 3 \times 4 \times 81 + 4$
So, $\gcd(a, b) = 4$
\end{solution}
\vfill
\problem{The Euclidean Algorithm}<euclid>
Using the two theorems above, detail an algorithm for finding $\gcd(a, b)$. \par
Then, compute $\gcd(1610, 207)$ by hand. \par

View File

@ -3,6 +3,12 @@
\definition{}
$\mathbb{Z}_n$ is the set of integers mod $n$. For example, $\mathbb{Z}_5 = \{0, 1, 2, 3, 4\}$. \par
\vspace{2mm}
Multiplication in $\mathbb{Z}_n$ works much like multiplication in $\mathbb{Z}$: \par
If $a, b$ are elements of $\mathbb{Z}_n$, $a \times b$ is the remainder of $a \times b$ when divided by $n$. \par
\note{For example, $2 \times 2 = 4$ and $3 \times 4 = 12 = 2$ in $\mathbb{Z}_5$}
\problem{}
Create a multiplication table for $\mathbb{Z}_4$:
@ -37,12 +43,25 @@ $a$ has an inverse in $\mathbb{Z}_n$ iff $\gcd(a, n) = 1$ \par
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 $4$ in $\mathbb{Z}_7$, if one exists.
\begin{solution}
\begin{itemize}
\item $3^{-1}$ in $\mathbb{Z}_{4}$ is $3$
\item $20^{-1}$ in $\mathbb{Z}_{14}$ doesn't exist.
\item $4^{-1}$ in $\mathbb{Z}_{7}$ is $2$
\end{itemize}
\end{solution}
\vfill
\problem{}
Today, we will often assume that $n$ is prime. \par
Why? What is special about $\mathbb{Z}_n$ with a prime $n$?
Show that if $n$ is not prime, $\mathbb{Z}_n$ has at least one element with no inverse.
\vfill
\problem{}
Is this true if $n$ is prime?
\vfill
\pagebreak

View File

@ -29,7 +29,8 @@ Is $(\mathbb{Z}_5, -)$ a group? \par
\problem{}
Show that $(\mathbb{R}, \times)$ is not a group, then make it one by modifying $\mathbb{R}$. \par
Show that $(\mathbb{R}, \times)$ is not a group,
then find a subset $S$ of $\mathbb{R}$ so that $(S, \times)$ is a group.
\begin{solution}
$(\mathbb{R}, \times)$ is not a group because $0$ has no inverse. \par
@ -58,8 +59,8 @@ What is the smallest group we can create?
\problem{}
Let $(G, \ast)$ be a group with finitely many elements, and let $a \in G$. \par
Show that $\exists n \in \mathbb{Z}^+$ so that $a^n = e$ \par
\hint{$a^n = a \ast a \ast ... \ast a$ repeated $n$ times.}
Show that there exists an $n$ in $\mathbb{Z}^+$ so that $a^n = e$ \par
\hint{$a^n \coloneqq a \ast a \ast ... \ast a$, with $a$ repeated $n$ times.}
\vspace{2mm}
@ -77,8 +78,9 @@ What is the order of 2 in $(\mathbb{Z}_{17}^\times, \times)$? \par
\theorem{}
Let $p$ be a prime number. \par
In any group $(\mathbb{Z}_p^\times, \ast)$ there exists a $g \in \mathbb{Z}_p^\times$ where...
\begin{itemize}
\item The order of $g$ is $p - 1$
\begin{itemize}[itemsep=1mm]
\item The order of $g$ is $p - 1$, and
\item $\{a^0,~ a^1,~ ...,~ a^{p - 2}\} = \mathbb{Z}_n^\times$
\end{itemize}
We call such a $g$ a \textit{generator}, since its powers generate every other element in the group.

View File

@ -21,7 +21,7 @@ Show that $\exp$ is a bijection, which will guarantee the existence of $\log$. \
\vfill
\problem{}
What's the simplest (but not the most efficient) way to calculate $\log_g(a)$?
Find a simple (but perhaps inefficient) way to calculate $\log_g(a)$
\vfill

View File

@ -86,7 +86,10 @@ Eve can read all public values, but she cannot change them in any way.
\problem{}
Complete the algorithm. What should Alice and Bob compute? \par
What is their shared secret?
\hint{
The goal of this process is to arrive at a \textit{shared secret} \par
That is, Alice and Bob should arrive at the same value without exposing it to Eve.
}
\vfill

View File

@ -182,5 +182,6 @@ $\gcd(ac + b, a) = \gcd(a, b)$ \par
[Note on \ref{eua_runtime}] This proof can be used to show that the Euclidean
algorithm finishes in logarithmic time, and it is the first practical application
of the Fibonacci numbers. If you have finished all challenge problems,
finish the proof: show that the Euclidean algorithm runs in $O(\log{n})$
finish the proof: find how many steps the Euclidean algorithm needs to arrive at
a solution for a given $a$ and $b$.
\pagebreak