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

\usepackage{fancyhdr}   
\pagestyle{fancy}      
\lhead{CS 355, FALL 2022}               
\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 = 2022, b = 125$. You must show all your work. 
    
  {\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?\newline
  {\bfseries Solution.}  \newline
  % \   %%% <-- ERASE THIS LINE AND WRITE YOUR SOLUTION HERE
  
  
  
  \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? \newline
  {\bfseries Solution.}  \newline
  % \   %%% <-- ERASE THIS LINE AND WRITE YOUR SOLUTION HERE
  
  
  
  \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? \newline
  {\bfseries Solution.}  \newline
  % \   %%% <-- ERASE THIS LINE AND WRITE YOUR SOLUTION HERE
  
  
  
  \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}? 
  {\bfseries Solution.}  \newline
  % \   %%% <-- ERASE THIS LINE AND WRITE YOUR SOLUTION HERE
  
  
  
  \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.})
  
  
 
    
\newpage
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%% PROBLEM 3 %%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

 
 \item {\bfseries Finding Inverse Using Extended GCD Algorithm (20 points).} In this problem we shall work over the group $(\bbZ_{257}^*,\times)$. 
   Note that $257$ is a prime. 
   The multiplication operation $\times$ is ``integer multiplication $\mod 257$.'' 
   
   Use the Extended GCD algorithm to find the multiplicative inverse of $55$ in the group $(\bbZ_{257}^*,\times)$. You must show all your work.
   
   {\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, 2235\}$ that satisfies the following two equations. 
\begin{align*}
    x &= 2 \mod 52\\
    x &= 3 \mod 43
\end{align*}
Note that 43 is a prime, but 52 is \ul{not} a prime. 
However, we have the guarantee that 52 and 43 are relatively prime, that is, $\gcd(52,43)=1$. 
Also note that the number $2235 = 52\cdot43-1$. You must show all your work.
   
  {\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$.
  
  (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}
