\documentclass[11pt]{article}
\input{headers04}

\usepackage{fancyhdr}   
\pagestyle{fancy}      
\lhead{CS 355, FALL 2020}               
\rhead{Name: Hemanta K. Maji} %%% <-- REPLACE Hemanta K. Maji WITH YOUR NAME HERE

\usepackage[strict]{changepage}  
\newcommand{\nextoddpage}{\checkoddpage\ifoddpage{\ \newpage\ \newpage}\else{\ \newpage}\fi}  


\begin{document}

\title{Homework 4}

\date{}

\maketitle 

\thispagestyle{fancy}  
\pagestyle{fancy}      




\begin{enumerate}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%% PROBLEM 1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\item {\bfseries An Example of Extended GCD Algortihm (20 points).}
    Recall that the extended GCD algorithm takes as input two integers $a, b$ and returns a triple $(g, \alpha, \beta)$, such that 
    $$g = \gcd(a,b), \text{ and } g = \alpha \cdot a + \beta \cdot b.$$ 
    Here $+$ and $\cdot$ are integer addition and multiplication operations, respectively. 
    
    Find $(g, \alpha, \beta)$ when $a = 310, b = 2020$. 
    
  {\bfseries Solution.}  \newline
   \   %%% <-- ERASE THIS LINE AND WRITE YOUR SOLUTION HERE  
   \newpage
  

  


  
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%% PROBLEM 2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \item    {\bfseries  (20 points).}  Suppose we have a cryptographic protocol $P_n$ that is implemented using $\alpha n^2$ CPU instructions, where $\alpha$ is some positive constant.  
  We expect the protocol to be broken with $\beta 2^{n/10}$ CPU instructions. 
  
  Suppose, today, everyone in the world uses the primitive $P_n$ using $n=n_0$, a constant value such that even if the entire computing resources of the world were put together for 8 years we cannot compute $\beta 2^{n_0/10}$ CPU instructions. 
  
  Assume Moore's law holds. 
  That is, every two years, the amount of CPU instructions a CPU can run per second doubles. 
  
  \begin{enumerate}
  \item (5 points) Assuming Moore's law, how much faster will be the CPUs 8 years into the future as compared to the CPUs now?
  \vfill
  \item (5 points) At the end of 8 years, what choice of $n_1$ will ensure that setting $n=n_1$ will ensure that the protocol $P_n$ for $n=n_1$ cannot be broken for another 8 years? 
  \vfill
\newpage  
  \item (5 points) What will be the run-time of the protocol $P_n$ using $n=n_1$ on the \underline{new computers} as compared to the run-time of the protocol $P_n$ using $n=n_0$ on today's computers? 
  \vfill
  \item (5 points) What will be the run-time of the protocol $P_n$ using $n=n_1$ on today's computers as compared to the run-time of the protocol $P_n$ using $n=n_0$ on \underline{today's computers}? 
  \vfill
  \end{enumerate}
  
  
  ({\footnotesize {\em Remark}: This problem explains why we demand that our cryptographic algorithms run in polynomial time and it is exponentially difficult for the adversaries to break the cryptographic protocols.})

\nextoddpage 

    \   %%% <-- ERASE THIS LINE AND WRITE YOUR SOLUTION HERE  
%     \newpage
  
  
 
    
  
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%% PROBLEM 3 %%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

 
 \item {\bfseries Finding Inverse Using Extended GCD Algorithm (20 points).} In this problem we shall work over the group $(\bbZ_{503}^*,\times)$. 
   Note that $503$ is a prime. 
   The multiplication operation $\times$ is ``integer multiplication $\mod 503$.'' 
   
   Use the Extended GCD algorithm to find the multiplicative inverse of 50 in the group $(\bbZ_{503}^*,\times)$.
   
   {\bfseries Solution.}  \newline
   \   %%% <-- ERASE THIS LINE AND WRITE YOUR SOLUTION HERE  
  
  
 \newpage 


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%% PROBLEM 4 %%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\item {\bfseries Another Application of Extended GCD Algorithm (20 points).} 
Use the Extended GCD algorithm to find $x \in \{0,1,2,\dots, 1538\}$ that satisfies the following two equations. 
\begin{align*}
    x &= 10\mod 19\\
    x &= 7 \mod 81
\end{align*}
Note that 19 is a prime, but 81 is \ul{not} a prime. 
However, we have the guarantee that 19 and 81 are relatively prime, that is, $\gcd(81,19)=1$. 
Also note that the number $1538 = 19\cdot81-1$. 

%Recall that in the last homework, we used Lagrange interpolation to derive a part of Chinese Remainder Theorem. In this problem we will use the extended GCD algorithm to do that. We shall proceed towards this objective incrementally. 
   
  {\bfseries Solution.}  \newline
   \   %%% <-- ERASE THIS LINE AND WRITE YOUR SOLUTION HERE  
     \newpage
  
  
 
   
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%% PROBLEM 5 %%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


\item {\bfseries Square Root of an Element (20 points).} 
  Let $p$ be a prime such that $p=3\mod 4$. 
  For example, $p\in\{3,7,11,19\dotsc\}.$
  
  We say that $x$ is a square-root of $a$ in the group $(\bbZ_p^*,\times)$ if $x^2 = a\mod p$. We say that $a\in \bbZ_p^*$ is a quadratic residue if $a=x^2 \mod{p}$ for some $x\in \bbZ_p^*$. Prove that if $a\in \bbZ_p^*$ is a quadratic residue then $a^{(p+1)/4}$ is a square-root of $a$.
  
  %Prove that if 
 % $a^{(p+1)/4}$ is a square-root of $a$.\\ 
  %\color{red}
  (Remark: This statement is only true if we assume that $a$ is a quadratic residue. For example, when $p=7$, 3 is not a quadratic residue, so $3^{(7+1)/4}$ is not a square root of 3.)
  
  
  {\bfseries Solution.}  \newline
   \   %%% <-- ERASE THIS LINE AND WRITE YOUR SOLUTION HERE  



\end{enumerate}
\newpage

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%% PLEASE LIST COLLABORATORS BELOW  %%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
{\bfseries Collaborators :} \newline 
% ENTER THEIR NAMES HERE  

\end{document}
