Exam I

advertisement
MATH 316
Spring 2015
Exam I
Directions: This exam is due on Friday, February 27 by class time. I hope you enjoy! 
You may not discuss this exam or any of its problems with anyone. Any clarification issues
should be directed towards me. You may use your notes and books, but no internet or talking
with other students. Show all of your work or risk losing credit. Good luck!
Please attach this page to your (stapled) exam and sign the following statement:
I affirm that I have been on the honor’s system during this exam and I have not discussed this
exam or its contents with anyone (except for Dr. Morton) and have used only the resources
allowed for each problem as stated.
Signed,
For problems on which Maple is allowed, you must turn in ALL calculations
and work that you do on Maple.
1. MAPLE ALLOWED: Break the following Vigenère cipher, USING Maple, and find the
keyword:
"gyyyhgvpcvikgaytigjzzeinowqcrjkmynshgnyuhavdmvraqthifjuxujivjphdakks
uxeouynjeaxqctslbtwvojelacifyenjewbtfiadgnnkcwsactevaccpglnpvctlrplgbwr
djkekslhcgwjeiutwgwmgcjkejnafyeivhwkxjkrwyffviegeyyesvzhvhwjpuvhkzllc
nsxxitevyaueekzlnkofctnjefufajpgcplvovkdntoqgyyptaxpjnafke"
The keyword is of length at most 10.
2. BY HAND: We will use an ADFGVX cipher with keyword “ZOMBIES”:
Here is the array:
A
D
F
G
V
X
A
C
8
M
P
Z
6
D
A
I
Q
T
1
2
F
D
K
F
R
X
9
G
B
L
O
W
V
G
V
H
N
S
Y
4
3
X
E
J
U
0
5
7
Use this information:
(a) To decrypt GFVAF XVXDD DDGAG AFDDV VAXGV XXGXA GDDGV
GGDXA FADFD V
(b) To encrypt By 2013, 349 walkers were killed.
3. BY HAND: Alice is sending a message to Bob using one of the following cryptosystems.
In fact, Alice is bored and her plaintext consists of the letter a repeated a few hundred
times. Eve knows what system is being used but not the key, and intercepts the ciphertext.
For the systems below, state:
 if or how Eve will recognize that the plaintext is one repeated letter and
 decide whether or not Eve can deduce the letter
 decide whether or not Eve can deduce the key.
(a) Shift cipher
(b) Affine cipher
(c) Hill cipher (with a 2x2 matrix)
(d) Vigenere cipher (where the key is a 10 letter word in English)
(e) One-time pad (we don’t know this yet. If we do not get to it by the end of class on
Monday, it will not be on the exam).
4. BY HAND: Let a,b,c,d,e,f be integers mod 26. Consider the following combination of the
Hill and affine ciphers: We represent a block of plaintext as a pair (x,y) mod 26. Then the
corresponding ciphtertext (u,v) is
é
ù
é x y ù ê a b ú + é e f ù º éë u v ùû mod 26
ë
û c d
ë
û
ë
û
é a b ù é 1 4 ù
a. Use the key ê
ú=ê
ú , éë e
ë c d û ë 5 11 û
“message”. Show all work.
f ù = éë 14 16 ùû to encrypt the message
û
b. Using the same key as in part a, decrypt the message “PKCZCU”, showing all work.
c. Describe how to carry out a chosen plaintext attack on this system (with the goal of
finding the key a,b,c,d,e,f). You should state explicitly what plaintexts you choose and
how to recover the key.
5. YOU MAY USE MAPLE FOR MULTIPLICATIONS AND MODULAR
ARITHMETIC: In 1998, Neal Koblitz presented a toy public key cipher system. It
works in this fashion: To be able to receive enciphered messages from others elsewhere,
Ursula chooses any four positive integers a,b,A and B and calculates
M = ab - 1
e = AM + a (e for encipherment)
d = BM + b (d for decipherment)
ed – 1
M
She then publicizes e and n with instructions that a numerical message x in the range 0 to n-1
is to be enciphered as
y = e × x mod n
Ursula deciphers a received message y by computing
x= d × y mod n
(a) If Ursula chooses a=47, b=22, A=11, and B=5, calculate her values of M, e, d, and n.
(b) Gustav, a customer at Ursula’s bank, is accessing his account online and wants to encrypt
his PIN: 1958.
 Compute the encipherment of his PIN,
 Verify that when Ursula receives this value she deciphers it correctly by using the
formulas given.
(c) Suppose that Ursula had used certain choices of a, b, A, and B to generate the values
n=1722629 and e=41996. (And, no, it should not be easy to reverse this and figure out
what a,b,A,B are). Further suppose that Rhonda intercepts an enciphered PIN 1305808
belonging to another bank customer, Walter, and would like to decipher it in order to gain
access to Walter’s account. (Thus our y is 1305808). If Rhonda knows the relationship
among e, d, and n,
 What (if anything) can she do to find d?
 What alternative approach might she take to find Walter’s PIN without finding d?
 Find Walter’s PIN.
n=
6. SOME MAPLE ALLOWED: The following is a type of block cipher that we have not
discussed in class, called digraph transformations.
We suppose that our plaintext and ciphertext message units are two-letter blocks, called
digraphs. This means that the plaintext is split up into two-letter segments. If the entire
plaintext has an odd number of letters, then in order to obtain a whole number of digraphs we
add on an extra letter at the end; we choose a letter which is not likely to cause confusion,
such as "x".
Each digraph is then assigned a numerical equivalent. The simplest way to do this (with a 26letter alphabet) is to take
m × 26 + n ,
where m is the numerical equivalent of the first letter in the digraph and n is the numerical
equivalent of the second letter in the digraph. The numbers resulting from this process will
range from "aa": 0 × 26 + 0 = 0 to "zz": 25 × 26 + 25 = 675. In other words, the numbers range
from 0 to 262 - 1, just as with our usual mod 26 alphabet the numbers ranged from 0 to
25=26-1.
Next, we use an affine transformation from the numerical equivalent of the plaintext digraph
to the numerical equivalent of the ciphertext digraph. This affine transformation will be of
the form
y º a x + b mod 262
As usual, x will represent the plaintext, y the ciphertext. The number a must be relatively
prime to 262 (i.e. no common factors) so that we can find its inverse. Again, this is just as in
our usual affine case, but now we change the modulus to 262 so that all of the 262 possible
digraphs can be represented.
The deciphering transformation will be of the form
x º a ¢ y + b ¢ mod 262
just as with our usual affine transformations.
Example: Suppose we are using an enciphering transformation y º 159 x + 580 mod 676 . We
wish to encrypt the digraph "no". We find the numerical equivalent of "no": 13 × 26 + 14 = 352 .
Thus the plaintext number is 352. This is taken to the ciphertext equivalent
by y º 159 × 352 + 580mod 676 º 440mod 676 . Now we need to translate 440 back into a digraph:
the largest multiple of 26 that fits in 440 is 16: 16 × 26 + 24 . Thus our ciphertext digraph is
16,24="QY".
If we encrypt the digraph "on", this has numerical equivalent 377, and is encrypted to
359="NV".
Exercise: You intercept the message "PWULPZTQAWHF" which you know was encrypted
using an affine map on digraphs. An extensive statistical analysis of earlier ciphertexts which
had been coded by the same enciphering map shows that the most frequently occurring
digraphs in all of that ciphertext are "IX" and "TQ", in that order. It is known that the most
common digraphs in the English language are "th" and "he", in that order.
a. Find the deciphering key, and read the message. You may use Maple, but step-by-step
and showing all work. If you have questions about how to get Maple to perform the
mathematical steps, you may come and see me, but you may not discuss this with
anyone else.
b. You decide to have the intended recipient of the message incapacitated, but you don't
want the sender to know that anything is amiss. So you want to impersonate the
sender's accomplice and reply "goodwork". Find the enciphering key and determine
the appropriate ciphertext.
c. Why is this an example of a block cipher? (No more than about 5-6 sentences. Some
examples might be helpful here.)
d. Discuss the following attacks with regards to this new cipher: ciphertext only, known
plaintext, chosen plaintext, chosen ciphertext. Be specific. (Examples might help.)
7. BY MAPLET (NOT MAPLE): Decipher the following substitution cipher (word
divisions have NOT been preserved). Do NOT use Maple for this problem. To receive full
credit, you must give the frequency counts for the letters and/or for the digrams (fill in the
appropriate spaces) and give a complete explanation of your thinking. (So take notes as
you work on this.) Give a complete list of the key (or as much as you have information about).
NEWOALVFLTSAFRTEWLSJIERMQELSWKONLTSAFNEKTVOFEIDSSFJONLT
SQSKLSWFKUVWEDEWHONLTSGEDEZBDVSKEKHEDDAFWSGEWJSJBSDD
OQKAFOWIVLVFGLTVKELEJVKLEFRSONWOAGTDBFVFSLBSVGTLHVDDVO
FHVDSKVKEFALLSWDBVFKVGFVNVREFLDVLLDSIDASGWSSFUDEFSLQTO
KSEUSJSKRSFJSJDVNSNOWHKEWSKOEHECVFGDBUWVHVLVPSLTELLTSB
KLVDDLTVFMJVGVLEDQELRTSKEWSEUWSLLBFSELVJSEWJYAOETVLRTTV
MSWKGAVJSLOLTSGEDEZB
HINT: D=l (the letter “el”) here.
8. BY HAND: Use a Playfair cipher with keyword Albert Einstein to:
(a) Encrypt Strive not to be a success, but rather to be of value
(b) Decrypt ”QGEHNTCNNHPWMF”
Download