\documentclass[12pt]{amsart}
\pagestyle{plain}

\usepackage{amsthm, setspace, framed, hyperref}
\usepackage{enumerate}
\usepackage{fullpage}

\begin{document}

\vspace{-5mm}\noindent \textbf{Math 314 - Fall 2016 \hfill 
Name:} 
\hspace{2in} %Replace this line with your name!

\noindent \textbf{Mission 8} \hfill Due December 11th, 2017 \vspace{-4mm}\\

\small \textit{The driving force behind modern computer ciphers isn’t security, but efficiency. The question is not can you create a secure cipher. You can. The question is whether you can create one that will work efficiently on huge data sets, or on very limited hardware.}\\
\vspace{1mm} \hfill--- Jeff Dege.

\vspace{-5mm}
\normalsize
\noindent \hrulefill

\section*{Guidelines}
\begin{itemize}
	\item All work must be shown for full credit.
	\item You can choose to use SageMath code to help you solve the problems.  If you do, print out your code (or use the same folder as the latex code on SMC).
	\item Either print out this assignment and write your answers on it, or edit the latex source on SMC and type your answers in the document.  Make sure you still show your work!
There is one point of extra credit available on this assignment if you use \LaTeX
	\item You may work with classmates, but be sure to turn in your own written solutions.  Write down the name(s) of anyone who helps you.
\item Check one:\\
%You can put an x inside the framebox to "check" the box in latex for example: \framebox(12,12){x}
\framebox(12,12){} I worked with the following classmate(s): 
\rule{7cm}{0.5pt}\\ %Replace this line with names of students.
\noindent\framebox(12,12){} I did not receive any help on this assignment.
\end{itemize}

\section{Graded Problems}

\begin{enumerate}[1.]

\item Using the primes $q=113$, $p=2 \times q+1=227$, implement the discrete log hash.  Use the sage command \texttt{primitive\_root()} to find a primitive root, and find the digest of 35120.
\begin{framed} 
	\vspace{2in}
	%Type your answer here!
	
\end{framed}
\pagebreak


\item Create an RSA key by using the primes $p=1987$, $q=2017$ and $e=17$.  Use the RSA signature algorithm to sign the message $m=11235$.  Then repeat this by signing the digest of the message when using the discrete log hash as described in problem 1.
\begin{framed} 
	\vspace{2in}
	%Type your answer here!
	
\end{framed}

\item My RSA key is $(n,e) = (5737043443,3)$.  You receive two messages from me, $(m_1,s_1) = (2357111317,5014697870)$ and $(m_2,s_2) = (1357111317,3012698810)$.  Determine which one was forged without factoring $n$.  
\begin{framed} 
	\vspace{1.5in}
	%Type your answer here!
	
\end{framed}
	
	\item Describe how Eve could perform a Man-in-the-middle attack against the three-pass-protocol. (Page 83)
    	\begin{framed} 
	\vspace{2.5in}
	%Type your answer here!
	
\end{framed}
\pagebreak
	\item Let $p$ be a large prime, and $\alpha$ a primitive root $\pmod{p}$.  Let $h(x) \equiv \alpha^x \pmod{p}$.  Why is $h(x)$ not a good cryptographic hash function?
\begin{framed} 
	\vspace{3in}
	%Type your answer here!
	
\end{framed}
	\item (Note: For this problem do your work by hand, showing all of your work to receive full credit rather than using SAGE.) In the ElGamal Cryptosystem, Alice and Bob use $p=17$ and $\alpha=3$.  Bob chooses his secret to be $a=6$ so $\beta=15$.
	\begin{enumerate}[a.]
	\item Alice picks the secret number $k=10$, and wishes to send the message $m=2$  Determine the encrypted message that Alice sends to Bob. 
	 
	\begin{framed} 
	\vspace{3.7in}
	%Type your answer here!
	
\end{framed}
\item Bob receives the ciphertext $(r,t)= (7,6)$.  Determine the plaintext $m$.
\begin{framed} 
	\vspace{4in}
	%Type your answer here!
	
\end{framed}
	\end{enumerate}


\end{enumerate}
	
\end{document}