Quarter II

advertisement
Algebra II Case Studies:
[2nd Quarter – Cryptography – Form C]
For this quarter, you are going to look into the origins and basics of cryptography, the
process of coding information so that no one is able to know it except for you and whomever you
are sending it to. In ancient Rome, Julius Caesar was one of the first to use a coding system (a
cipher) to protect important information he was relaying to his generals. For this case study, you
are going to analyze the Caesar Cipher and its more generic form, the affine cipher, both of
which are based on simple linear equations and can be “broken” by solving systems of equations.
Before you can begin analyzing these two types of ciphers, you need a quick
understanding of a special type of arithmetic called “modular arithmetic”. Modular arithmetic
allows you to stay within a certain range of numbers by considering the remainder if you divided
by a “modulus” (normally abbreviated “mod”).
Consider the following example:
Here’s a list of numbers
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, …
Suppose I set a mod of 4; Then
there would be 4 repeating values
(these are the remainders if the
list above is divided by 4)
1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, …
We show this relationship mathematically in the following manner:
1 (mod 4) = 1
5 (mod 4) = 1
8 (mod 4) = 0
14 (mod 4) = 2
because 1 divided by 4 is equal to 0 (R1), 5 divided by 4 is equal to 1 (R1), 8 divided by
4 is equal to 2 (R0), and 14 divided by 4 is equal to 3 (R2).
Both the Caesar and affine ciphers rely on this modular arithmetic so that the coded
messages have the same alphabet to work from. To understand why this is important, consider
this idea – your cipher is one where you change each letter to the next (A to B, B to C, and so
on). What do you do with Z? There’s no 27th letter after it, but thanks to modular arithmetic we
know Z becomes A (27 divided by 26 leaves a remainder of 1).
Now that you understand modular arithmetic (and you have the knowledge of how to
work with linear equations and linear systems), you are more than capable of analyzing these
ciphers.
1. Caesar Cipher
Caesar’s cipher was a simple shifting cipher where each letter was moved a certain number of
spaces down the alphabet. For example, a Caesar cipher with a shift of five would change A to
F, B to G, and so on. For this first part, answer the following:
(A) [10 points] Show how a Caesar shift of six would change the alphabet (write the
alphabet on top and the cipher beneath). Write a short message and encode it.
(B) [5 points] The Caesar shift cipher is basically a linear equation with a slope of 1 and a
y-intercept of whatever the shift was. Write the equation of the Caesar shift in part
(A) and draw its graph.
(C) [15 points] Your graph in part (B) does not demonstrate how the message is coded.
Draw a second graph of the alphabetic changes using the description below:
- The horizontal axis is the original alphabet
- The vertical axis is the coded alphabet
- Your graph will not be connected (i.e., once it reaches the top it will resume at
the bottom) – explain what this disconnection represents mathematically
(D) [10 points] Algebraically, the general function for encoding a message with a Caesar
shift is f(x) = (x + n) (mod 26). What is the general function g(x) for decoding a
message (hint: encoding and decoding are “inverses”)?
(E) [10 points] Now that you have the general form of the decoding function, what is the
decoding function for the Caesar shift used in parts (A) & (B)? Demonstrate this by
decoding your coded message from part (A). Note that you should get you original
message back.
2. Affine Cipher
An affine cipher is similar to a Caesar cipher but has one major difference – the slope of the line
is no longer 1. For example, an affine cipher could have a function notation of
f(x) = (7x + 5) (mod 26). Based on this new detail, answer the following:
(A) [20 points] The general form for encoding with an affine cipher is
f(x) = (ax + b) (mod 26). Write the equation for an affine cipher with a slope of 4
and an intercept of 1. Graph the alphabetic changes using a similar graph to the one
you created in part 1(C) & explain why there are more “disconnects” in this graph.
(B) [30 points] Calculating the decoding function of an affine cipher can be very
complicated due to the slope not being 1 (finding a multiplicative inverse in modular
arithmetic is quite tricky). However, affine ciphers are not widely used because they
are still easily broken. If you can figure out just two of the letters of the encoded
message, you can solve the following system for a and b to find the encoding
function: {ax1 + b = y1 & ax2 + b = y2} where (x1, y1) & (x2, y2) are the values of the
two letters you know the coding of, x2 > x1, and y2 must be greater than y1 (if it’s not,
add the modulus to y2 until it is)
Suppose you discovered that D was coded as U and I was coded as T. Find the
encoding equation and graph the alphabetic changes (see part 1(C) or 2(A)). Then
decode the message “VXB UTU WOTR PXMMZPW!”
Download