\documentclass[12pt]{article} \usepackage{graphics} \usepackage{epsfig} \usepackage{comment} \usepackage{amsmath} \usepackage{amssymb} % for \nmid \newcommand{\bits}[1]{\{0,1\}^{{#1}}} \newcommand{\Z}{\mathbb{Z}} \newcommand{\N}{\mathbb{N}} \newcommand{\Q}{\mathbb{Q}} \newcommand{\R}{\mathbb{R}} \newcommand{\prob}{{\rm prob}} \newcommand{\lf}{\left\lfloor} \newcommand{\rf}{\right\rfloor} \newcommand{\lc}{\left\lceil} \newcommand{\rc}{\right\rceil} \newcommand{\Ceil}[1]{\left\lceil {#1}\right\rceil} \newcommand{\ceil}[1]{\left\lceil {#1}\right\rceil} \newcommand{\floor}[1]{\left\lfloor{#1}\right\rfloor} \newcommand{\abit }{\hat{a}} \newcommand{\bbit }{\hat{b}} \newcommand{\nth}{n^{th}} \newif{\ifshowsoln} \showsolntrue \begin{document} \centerline{\bf CMSC 456 Midterm, Fall 2020} \begin{enumerate} \addtolength{\itemsep}{-2mm} % reduced space between lines \item This is an open-book, open-slides, open-web exam. If you have a question please go to class Zoom site or post to private piazza. \item There are 5 problems which add up to 100 points. The exam is 120 minutes. \item In order to be eligible for as much partial credit as possible, show all of your work for each problem, \textbf{write legibly}, and \textbf{clearly indicate} your answers. Credit \textbf{cannot} be given for illegible answers. \item After the last page there is paper for scratch work. \item Please write out the following statement: ``\textit{I pledge on my honor that I will not give or receive any unauthorized assistance on this examination\/}.'' \bigskip \bigskip \bigskip \bigskip \item Fill in the following: \[ \begin{array}{rl} {\rm NAME: } & \cr {\rm SIGNATURE: } & \cr {\rm UID: } & \cr \end{array} \] \end{enumerate} \newpage %You may use the following table of numbers in $\{0,1,\ldots,36\}$ that are rel prime to 36, %and their inverses. % %\[ %\begin{array}{ccccccccccccc} %\hbox{NUMBER:} & 1 & 5 & 7 & 11 & 13 & 17 & 19 & 23 & 25 & 29 & 31 & 35 \cr %\hbox{INV MOD 36:} & 1 & 29& 31 & 23 & 25 & 17 & 19 & 11 & 11 & 5 & 7 & 35\cr %\end{array} %\] \newpage {\bf THERE ARE FIVE PROBLEMS} {\bf MAKE SURE YOU DO ALL FIVE} \bigskip {\bf FOR EACH PROBLEM WE HAVE A BLANK PAGE AFTER IT SO YOU CAN DO THE PROBLEM ON BOTH THE PAGE IT WAS GIVEN ON, AND THE NEXT PAGE IF YOU NEED MORE SPACE.} \bigskip {\bf THE LAST PAGE IS BLANK SCRATCH PAPER.} \newpage \begin{enumerate} \item (20 points) Throughout this problem we use the 36-letter alphabet $\{A,\ldots,Z,0,\ldots,9\}$. Hence everything is mod 36. You may want to use the tables on the next page. For BOTH PARTS of the problems SHOW YOUR WORK. \begin{enumerate} \item (10 points) Using the Vig cipher with key 7UP, how do you encode MATH4? \item (10 points) If you want to use the affine cipher with $ax+b$, then how many pairs $(a,b)$ work if we DO NOT WANT to just have a shift cipher? \end{enumerate} {\bf THE NEXT PAGE HAS A TABLE YOU WILL NEED FOR THIS PROBLEM} \newpage \[ \begin{array}{ccccccccccccc} A & B & C & D & E & F & G & H & I & J & K & L & M \cr 0 & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12\cr \end{array} \] \[ \begin{array}{ccccccccccccc} N & O & P & Q & R & S & T & U & V & W & X & Y & Z \cr 13 & 14 & 15 & 16 & 17& 18& 19& 20& 21& 22& 23& 24& 25\cr \end{array} \] \[ \begin{array}{ccccccccccccc} 0 & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9\cr 26 & 27 & 28 & 29 & 30& 31& 32& 33& 34& 35\cr \end{array} \] \newpage \item (20 points) Assume the alphabet is $\{0,\ldots,100\}$ so we are doing everything mod 101. Alice and Bob want to use the the $2\times 2$ matrix cipher. \begin{enumerate} \item (5 points) Give a $2\times 2$ matrix $A$ with four {\bf distinct non-zero elements} that they CAN use. \item (5 points) Give a $2\times 2$ matrix $B$ with four {\bf distinct non-zero elements} that they CANNOT use. \item (5 points) Take the matrix $B$ from part b. Use it to code 9 8 Present your answer as two numbers. \item (5 points) In Part c you used a matrix $B$ that Alice and Bob CANNOT USE to code ED. So Alice CAN code messages! Why should they not use the matrix $B$? \end{enumerate} \newpage \hbox{\ } \newpage \item (20 points) (You may use this page and the next page for this problem.) Alice and Bob are using the {\bf Vig Cipher with alphabet $\{0,\ldots,9\}$}. (See HW 3, Problem 4 OR problem 5 on THIS midterm.) Eve learns that the message \centerline{\it 54321 12345} was coded by \centerline{\it 12389 18141} What is the shortest possible key? (Don't just give us the length, give us the key.) SHOW YOUR WORK. \newpage \hbox{\ } \newpage \hbox{\ } \item (20 points) For this problem the $\Sigma$ is an alphabet with $p$ letters in it where $p$ is a prime. Alice and Eve play the following game. \begin{itemize} \item Alice flips a coin to get either RP (for Random Perm) or AF (for Affine). \begin{itemize} \item If she gets RP then she generates a random perm of $\Sigma$ and sends it to Eve. \item If she gets AF then she generates a random pair $(a,b)$ such that $ax+b \pmod p$ can be used as an affine cipher, and sends that perm to Eve. (The random Affine cipher CAN just be a shift cipher). \end{itemize} \item Eve looks at the perm she gets and yells out either RP or AF. If she is correct she wins. If not then Alice wins. \end{itemize} Note that it is the \emph{permutation} that is being transmitted in both cases. AND NOW for the problem. Assume an Eve with unlimited computational power. \begin{enumerate} \item (5 points) Come up with a strategy for Eve that will win most of the time. \item (15 points) Using your strategy, what is the probability that Eve wins (as a function of $p$)? \end{enumerate} \bigskip \newpage \hbox{\ } \bigskip \bigskip \bigskip \bigskip \bigskip \bigskip \bigskip \bigskip \bigskip \bigskip \bigskip \bigskip \bigskip \bigskip \bigskip \bigskip \bigskip \bigskip \bigskip \bigskip \bigskip \bigskip \bigskip \bigskip \newpage \hbox{\ } \item (20 points) You want to encrypt a sequence of digits 0 through 9 inclusive $x_1, x_2, \dots x_n$ (this is your plaintext). You generate a random key $k_1, k_2, \dots k_n$, also consisting of digits 0 through 9. You generate your ciphertext by adding each individual digit mod 10 to its corresponding key digit: \[c_i = x_i + k_i \pmod {10}\] Include probabilities to support your answers: \begin{enumerate} \item (5 points) Is this cryptosystem info-theoretic secure? \item (5 points) Is it info-theoretic secure if you change the plaintext digits to be 0-8 instead of 0-9 (but still do everything base-10)? \item (5 points) Is it info-theoretic secure if you change the key digits to be 0-8 instead of 0-9 (but still do everything base-10)? \item (5 points) Is it info-theoretic secure if we use 11 digits for the ciphertext so $c_i = x_i + k_i \pmod {11}$ (but still use 10 digits for the plaintext and key?) \end{enumerate} Hint: You may NOT assume that the distribution of letters in plaintext is uniform. \newpage \end{enumerate} \newpage \hbox{\ } \newpage \centerline{SCRATCH PAPER} \end{document}