Number Theory Applications in Cryptography
Number Theory Applications in Cryptography
5-2013
May 2013
D r. D iana Thom as
C om m ittee M ember
D ate
D r. Helen M. R oberts
D epartm ent Chair
NUMBER THEORY APPLICATIONS IN CRYPTOGRAPHY
A THESIS
by
Francesca Pizzigoni
Montclair State University
Montclair, New Jersey
May, 2013
A b s tra c t
This thesis provides a unique cryptosystem comprised of different number theory
applications. We first consider the well-known Knapsack Problem and the resulting
Knapsack Cryptosystem. It is known that when the Knapsack Problem involves a
superincreasing sequence, the solution is easy to find. Two cryptosystems are designed
and displayed in this thesis that allow two parties often called Alice and Bob use a
common superincreasing sequence in the encryption and decryption process. They
use this sequence and a variation of the Knapsack Cryptosystem to send and receive
binary messages. The first cryptosystem assumes that Alice and Bob agree on a shared
superincreasing sequence prior to beginning encryption. The second cryptosystem
involves Alice and Bob constructing a common, secret, superincreasing sequence built
from subsequences of the Fibonacci sequence during the encryption process. Elliptic
curves were explored on a smaller scale as they are also applied in cryptography. For a
fixed prime number p and a special class of elliptic curves over Zp, we investigate how
many of them intercept the y-axis. Additionally, the research presented in this paper
was successfully implemented into a middle school classroom.
Chapter 1 includes introductory material about cryptography. Chapter 2 discusses
superincreasing sequences and their appearance in Fibonacci subsequences. It also
includes important properties of the Fibonacci sequence. The two cryptosystems are
presented in Chapter 3 followed by the brief findings of the intersection of elliptic curves
with y-axis in Chapter 4. Finally, Chapter 5 introduces a middle school lesson plan
that provided students the experience of cryptography and increased their appreciation
of mathematics. A few other lesson plans are provided in the appendix.
A ck now ledgm ents
I would first and foremost like to th an k my advisor, Dr. Aihua Li. Her patience and
persistence has m ade this thesis possible. She acted as an inspiring m entor both in and out
of the classroom. Her assistance and m otivation is truly im m easurable and I am extrem ely
grateful to her.
I would also like to show my appreciation to my parents, family, and friends. Their
continued support and words of encouragem ent truly m ade an im pact on my academic
achievements.
A very special thanks to my com m ittee members, Dr. Jo n ath an C utler and Dr. D iana
Thom as. T heir review and helpful suggestions of this thesis were a crucial piece to its
completion.
Furtherm ore, I would like to extend a great deal of thanks to th e N ational Science Foun
dation and the GK-12 program for the funding of this research. I especially want to th an k
Dr. Mika M unakata and Eliza Leszczynski for their support throughout the year. I also
owe thanks to the other 2012-2013 GK-12 Fellows: Jessica Evans, Alexander Cali, and A nna
4
C on ten ts
1 I n tr o d u c ti o n t o C r y p to g r a p h y 6
2 S u p e r in c r e a s in g S e q u e n c e s 7
3 C r y p to s y s te m u s in g t h e F ib o n a c c i S e q u e n c e 17
4 A S p e c ia l C a s e o f E llip tic C u r v e s a n d t h e P o in ts o n t h e Y -A x is 21
6 C o n c lu d in g R e m a r k s 34
7 A p p e n d ix 36
A A C r y p to s y s te m A lg o r ith m U s in g S a g e 37
B L e s s o n P l a n 2: H o w t o S o u n d L ik e a S e c re t A g e n t 39
5
1 In trod u ction to C ryptography
C ryptography is a branch of m athem atics th a t has been incorporated into our daily lives.
As the science of creating secure and efficient codes, it uses various algorithm s, known as
cryptosystem s, to send and receive secret messages. O riginated in ancient civilizations, cryp
tography plays an ever im portant role in to d ay ’s society. Every tim e a credit card is swiped
or a com puter is used, a security m ethod built from a cryptosystem is applied. It is m ost
significant in m atters related to cyber and national security. Deeply rooted in the processes
of cryptography is a discrete branch of m athem atics known as N um ber Theory. This project
It is im portant to be fam iliar w ith the various term inology of crytography. Two parties,
often nam ed Alice and Bob, are trying to com m unicate in such a way th a t an adversary,
often nam ed Eve, cannot understand the message. Ideally, the cryptosystem should be built
so th a t even if Eve intercepts a message, he or she cannot uncover its meaning. Therefore,
E ncryption
E ncryption is the process of taking a plaintext piece of inform ation and encoding it in such a
way th a t only th e intended recipient can receive and understand the message. The plaintext
D ecryption
D ecryption is the m ethod used to uncover a ciphertext. Through a reverse algorithm ,the
6
Keys
The algorithm involved in encryption and decryption often uses a key. There are two types
of keys: public and private. A public key is one th a t can be known to someone other
th an the two com m unicating parties. A private key can be used by a single com m unicating
m ember. It is kept secret for all other m embers and outsiders. Cryptosystem s can often use
T hroughout the project, we assum e the message space is built from integers, integers
2 S uperincreasing Sequences
P re lim in aries
T he first application in Num ber Theory involves a superincreasing sequence which is defined
below.
th a n the sum of the num bers before it. These sequences are relatively easy to create and are
Given a vector a = (ai, 02, . . . , a*) of positive integers and a positive integer A, the Knapsack
k- 1
Problem for (a, A) is to find a k-vector b = (6i, 62, • • •, bif) £ such that ^2 afti = A and k
i=0
is a positive integer.
7
E x a m p le 1 . The solution to ((1,3, 7,20,42,107), 115) is (1 ,0 ,1 , 0 ,0 ,1 ).
Note th a t the K napsack Problem m ay have no solution, exactly one solution, or more
and the solution to the K napsack Problem exists, then the solution is unique [4]. In this
case, a simple algorithm can be applied to find the solution. This algorithm is a key player
The K napsack Problem was first recognized in 1957 by George Dantzig. Dantzig, known
for his contributions to O perations Research, connected this problem w ith other m axim iza
tion problem s in th e field. W ork on the Knapsack Problem continued in the direction of
approxim ation algorithm s and other solution m ethods in the 1980’s [2]. The work on var
ious solution techniques may have been sparked by the use of the Knapsack Problem in a
public key cryptosystem . This system , as previously m entioned, is known as the Knapsack
2. Alice chooses two private, large integers A and B such th a t B > 2rn and gcd(A , B) = 1.
n n n
C' = A~XC = A~l XiMi = A~l xiAri = aqr* m od B.
¿=1 ¿=1 i= 1
8
As Alice knows r, she can use Proposition 2.2 below to uncover the plaintext x from
C'.
2rn < B Therefore, th e solution to C' = xKi m ° d & is equivalent to C' = XlILi xKi
positive integer. Consider the Knapsack Problem for r and C '. Assuming that a binary
solution x — ( x i,. .. ,x n) exists, then it is unique and can be computed with the following
steps:
1. Determine xn first.
n
C' := ^ 2 xpri = C - rnxn.
2=1
T he steps above are based on a well-known algorithm for solving the K napsack Cryp
T hen
9
which implies
n —1 n —1
|Vn - XnVn < \xj - 2/ih < } n since - y i\ < 1 for alH = 1 , 2 , . . . , n - 1
¿=1 i= 1
2/2, • • • ,x n = yn so x = y. □
Following Step 1 shown above, we compare 115 and 107. As 115 > 107, we assign xq = 1.
For Step 2, our new C' — 115 — 107 = 8 . Continuing to r5 = 42, we compare 8 and 42.
Tls 8 < 42, we assign £5 = 0 and therefore C' remains 8. Similarly, we would find £4 = 0 .
Comparing r%, 8 > 7 50 x% = 1. Our new C' — l and trivially, X2 = 0 and X\ — 1. Therefore,
{r h r 2 , • • • ,?"n) and call it a superincreasing vector. We will now show an example of the
K napsack Cryptosystem .
E x a m p le 3.
1. Alice has a secret key r — ( 1, 2,5,13, 34, 89, 233, 610) which is superincreasing.
2. She chooses A = 101 and B = 1221. Note that B > 2rn and gcd(A , B) = 1.
10
5. Alice computes C' = A~l C m od B. Here, A~l = 677 which can be found using the
Euclidean Algorithm. Thus, C' = (677)(931) m od 1221 = 251. Using Proposition 2.2,
am ined a few different sequences for their superincreasing nature. One of the m ost com
monly known sequences is the Fibonacci sequence ( F n}£°. The num bers in this sequence
are created by adding the two previous num bers in the sequence. The first few term s are
{ 0 ,1 ,1 ,2 ,3 ,5 ,8 ,1 3 ,...} .
On the surface, the Fibonacci sequence appears to follow a recursive formula. However,
Binet derived an explicit form ula for the sequence in 1843 based on the Golden ratio a =
The num ber a is known as the Golden Ratio. The following corollary is a direct result
11
Proof. From B inet’s formula, we know th a t a = 1+2^ , (3 - 1~2V^ and Fn = a ^ . Now
since |<a| > |/3|, and |a | > 1, we can say th a t \a\n > \(3\n. Therefore, a n + \(3\n < 2an.
Because of this, we can say th a t Fn = a- fJQ- < ^ and since a < 2, we can conclude th a t
on+l
F» < V -
□
L e m m a 2.6. Consider positive integers n ,g > 1. Let p be a prime number such that p > g.
log2( V E p ) - g - l
Then if 0 < R < n —1
, then F 5+i?(n_i) < p
log2( y / 5 p ) - g - l log2( F 5 p ) - g - l
Proof. We know th a t R < n —1
< n—1 so R (n—l) + g + l < log 2(V%>) which implies
2 R (n -l)+ g + l < ^ p
2 R (n -l)+ g + l
Thus from Corollary 2.5, Fg+^ n^ < <p.
7T-
consecutive finite subsequence { Fm, Fm+1, . . . , Fm+r} where r > 2, m > 0 is not superincreas
ing.
Proof. A simple counterexam ple will prove th a t Fibonacci sequence is not superincreasing.
Consider the first few term s of the sequence: {0,1,1, 2, 3 ,5 ,... }. It can easily be seen th a t
Now consider the sequence { Fm, Fm+1, . . . , Fm+r} for m > 0 ,r > 2. A simple check shows
th a t Fmjr3 — Fjjj_j_2 T Fm+1 Fmjr2 T Fm+1 T Fm. Thus, F177,-1-3 ^ Fm+2 T Fm+1 -I- Fm. D
12
This project considers not only the Fibonacci sequence, bu t also Lucas sequence. The
Lucas sequence {Ln}g°, while very similar to the Fibonacci sequence, begins w ith the integers
2 and 1 and follows the same rule after the first two num bers. Thus by definition, L q —
Lucas sequence is expressed in Lem ma 2.8 as a linear com bination of certain Fibonacci
Sequence
A lthough the Fibonacci sequence is not a superincreasing sequence, a closer look shows th a t it
does have m any superincreasing subsequences. For example, the even term s of the Fibonacci
does not use consecutive Fibonacci num bers forms a superincreasing sequence.
Since all > 2 and —2 > 0, then m -\-ri + r 2 -\-------b i + —2 > m + r i + r 2H-------b r^-x
13
which implies th a t
for all positive integers d. Thus, S = {Fm, Fm+ri, Fm+n+r2, . . . , F m+ri+r.2+...+rd, . . . } is super-
increasing. □
If all are the same, we obtain a special case of the above theorem . This case creates
2, 3, 5, 8 , 13, 21, 34, 55, 89... is Fibonacci Sequence out to the 12th term . Consider
the subsequence created w ith every th ird number: 1, 5, 21, 89. This subsequence is a
superincreasing sequence.
T he above theorem s show th a t there are an infinite num ber of superincreasing subse
quences of the Fibonacci sequence. Moving on to Lucas sequence, we can follow the same
logic. As previously stated, Lucas sequence is a linear com bination of Fibonacci sequences.
14
G eneralized ¿-S uperincreasing Sequences
Proposition 2.2 is the m ain piece to the Knapsack C ryptosystem b u t the solution m ust be
binary. W ith such a valuable proposition, one m ight ask, “Can we find other sequences th a t
guarantee the uniqueness of the solution to a Knapsack Problem and the solution can be
(t — l ) ( r i + r 2 + • • • + r n_ i).
quence. We now consider a 3-super increasing sequence r = { ri, r 2, . . . , rn} such th a t >
0 if S < r n
15
2. rn < S < 2rn if and only if xn — 1 since
S > 2 r n <^ x iri + x 2t2 H------- h £n_ ir n_i > r n(2 - a;n)
0 if S < r n
J - 1 if S > ( t - 1)rn
The proof of this theorem is sim ilar to the previous proof. Therefore, it has been om itted.
16
3 C ryp tosystem using th e F ibonacci Sequence
Using our knowledge of the Knapsack Cryptosystem and superincreasing sequences, we cre
ated the following cryptosystem s. The first cryptosystem assumes th a t Alice and Bob possess
a common key in the form of a superincreasing sequence before any interactions take place.
T he second cryptosystem allows Alice and Bob to create a common shared key am idst the
system.
Alice and Bob share a common key in the form of a superincreasing sequence which is pro
T he public keys include g £ Z + ,<7 ^ 1, and a large prime p such th a t p > 2rn. Alice has a
secret key a £ Z + such th a t gcd(a,p — 1) = 1 and Bob has a secret key k £ Z + such th a t
gcd(k,p — 1) = 1.
2 . Bob encrypts his plaintext message x € Z£ by sending (01, 02) to Alice where C\ = gk
m od p and C2 = A k(x • r) m od p.
3. Alice decrypts the messages by doing C' = (ci)~a(c2) m od p. She then solves the
K napsack Problem w ith {r, C"} to get back to the plaintext message x.
Proof.
(ci)~a(c2) m od p = (gka)~lgkax ■r = x ■f
Because p > 2rn, this result is ju st a K napsack problem w ith (r, x • r) and Proposition 2.2
17
E x a m p le 4. Alice and Bob have the common, secret key f = (1 ,2 ,5 ,1 3 ,3 4 ,8 9 ,2 3 3 ,6 1 0 )
which is superincreasing.
2. Bob has the plaintext message x = (0, 0 ,1 ,1 ,0 , 0,1, 0). He computes (01, 02) where
She solves the Knapsack Problem for (r, 251) to recover the plaintext message x =
(0 , 0 , 1, 1, 0 , 0 , 1, 0 ).
T he above cryptosystem is based on the fact th a t Alice and Bob already have a common
superincreasing sequence. This is a fairly large assum ption so we have created another
subsequences.
The following are public keys: a fixed n £ Z + such th a t n > 2, a large prim e p » 2l°J^ ,
Alice has a secret key a £ Z + such th a t gcd(a,p — 1) = 1 and Bob has a secret key k £ Z +
such th a t gcd(k,p — 1) = 1.
18
vector r. Bob com putes K = Ak m od p. He then com putes
log2(V$p) - g - 1
u= ------------------------- .
n —1
If K < u ,
r = { F g i F g + K , F g + 2K l ■ • ■ 1 F g + ( n - 1 ) # } ’
If K > u,
where v = LW
I —-1I and w —LIU
—J I + 1.
A k(x • r) m od p.
3. Alice com putes K — c\ = gka mod p. She then creates a superincreasing vector r in
the same m anner as Bob. They now have a shared, secret, superincreasing sequence r.
4. Alice decrypts the messages by com puting C = (ci)- a (c2) m od p. She then uses the
special proposition w ith C and r to get back to the plaintext message x. This result
Proof. Because p > 2l^h , \fhp > 210n 7. This implies log2{\[hp) > 10n — 7 so log2(V^p) —
F g + ( n —1)K P•
19
log2(y/bp) - g
Because K <
n
we can use Lem m a 2.6 to show th a t Fg+^ i ) K < p. Because the last num ber in our
sequence is less th an p, Proposition 2.2 can now be used to uncover the message.
Since g < log2 (V^p)~ 10n+9, then g+lO n—9 < log2 (V^p) =>• g + n + 9 n —9 < log2(y/&p)
K K K
< ~K
u U f j + jJ
log2(V5p) - g - 1
V <
n —1
Now using Lem m a 2.6, we can show th a t Fg+(n-i)v < p. Because th e last num ber in
our sequence is less th a n p, Proposition 2.2 can now be used to uncover the message.
20
E x a m p le 5. Public Keys: n = A,g = 2 ,p = 12431470127
4- Alice decrypts the message by computing C' = (ci)_a(c2) m od p. She finds C' = 520995
and uses Proposition 2.2 to solve the Knapsack Problem for (r,C ') to get back to the
Version 2 of the cryptosystem has quite a few intricate steps. To increase the feasibility
of the com putations, an algorithm for the cryptosystem has been w ritten using the software
SAGE and can be found in the Appendix. The next p art of this paper will consider another
th e Y -A x is
Elliptic curves are becoming increasingly im portant in the world of cryptography. Elliptic
Curve Cryptography, or ECC , represents one of the m ost m odern m ethods used today. In
this chapter, we will examine a special class of elliptic curves and establish when this set of
curves will have a ^-intercept. An elliptic curve E over a field F is defined by an equation
21
x, y E F, is a point on the curve if (x, y ) satisfies the above equation [4]. Elliptic curves have
their own binary addition defined in a specific way. ECC uses the algebraic structure of the
defined as follows:
the identity of this closed algebraic group. The operation of the group is represented as ©,
defined below:[4]
1. For every P 6 E ( F ) , P @ 0 = P = 0 ® P
for
_ I (2/2 - yi)(x 2 - Xi ) - 1 i f Pi ± P2
{'O , (1,3), (1,10), (2,0), (3,4), (3,9), (5,2), (5,11), (6 ,1), (6 ,12), (11,3), (11,10), (12,0)}.
im portant to notice th a t the left hand side m ust be a perfect square. In a finite field, perfect
22
D e f in itio n 5. [11] If m is a positive integer, we say that an integer a is a quadratic residue
is a quadratic nonresidue because there is no integer which, when squared, will give 8 modulo
13.
It will be shown in a later section why quadratic residues play an especially im portant
role in elliptic curve cryptography. Because of their im portance, it is valuable to know some
key properties of quadratic residues. These properties can also be found in any num ber
theory book.
nonresidue modulo p.
D e f in itio n 6 . [4] Let p be an odd prime and a be an integer not divisible by p. The Legendre
Symbol is defined as
1 if a is a quadratic residue of p
1 —1 if a is a quadratic nonresidue of p.
23
T h e o r e m 4 .2 . Let p be any odd prime and a and b be integers not divisible by p. Then
*• I
3. ( ^ ) = 1 .
1 if p = 1 (mod 4) /2 1 if p = 1 or 7 (mod 8 )
V
—1 if p = 3 (mod 4), —1 if p = 3 or 5 (mod 8 ).
1 if p = 1 or 11 (mod 12)
and
1 if p = 5 or 7 (mod 12),
1 if p = 1 or 4 (mod 5)
—1 if p = 2 or 3 (mod 5).
Theorem 4.4 (T h e Law of Q u a d ra tic R eciprocity). [4] Let p and q be distinct odd primes.
Then
-qj ( - 1) 2 2
\ p-
T h e o r e m 4.5.
if p = 1 (mod 4) or q = 1 (mod 4)
24
Recall Exam ple 6 . Notice th a t this curve does not have a y-intercept. A question naturally
asked is: using th e previous factorization, can we predict the num ber of a values th a t will
M ethodology
L et’s assum e we work w ith a finite field, Zp where p is an odd prime. As m entioned earlier,
there is one condition th a t m ust hold for elliptic curves, th a t is, 4A 3 + 27 B 2 ^ 0. This
requires th a t the curve not have any double roots. In other words, all factors are distinct.
This restricts th e possible a values in our factored form. For any prim e p, a ^ 0,1, —2, (—2 )“ 1
in order to guarantee th a t (x —a)(x —a2)(x + a + a2) does not have any double roots in Zp.
In order to explore the p-intercepts of the curve, we set x = 0. The equation be
comes y2 = a4(a + 1). For a solution to exist, a + 1 = b2 for some b £ Zp. Thus
In this case, two solutions exist: (0, a2b) and (0, —(a2b)). However, if a2b — —(a2b) then
2a2b = 0 .
W ith the condition th a t a ^ 0 , l , —2, (—2 )-1 in Zp, this implies th a t p | ( a + l ) or p\b which
implies th a t a = —1. Thus, the curve has p-intercepts if and only if a + 1 is a quadratic
residue of p. W hen a + 1 is a quadratic residue, there exists two p-intercepts if and only if
a 7^ —1.
Now th e question is: for a fixed prim e p, how m any Ea(Zp) 6 Sp intersect w ith the y-axis?
We know th a t a ^ 0,1, —2, (—2 )_1 thus a + 1 ^ 1,2, —1, (—2 )-1 + 1. To know how m any a ’s,
for a set p, will have a solution, we need to remove the values listed above th a t are quadratic
25
residues. One should note th a t if 2 is a quadratic residue then 2_1 is a quadratic residue.
However, (—2 )_1 + 1 = 2 _1 so (—2 )-1 + 1 is a quadratic residue which can also be proven
' p+ r
if r = 1,5
p + r —4
mr if r = 3 (3)
p + r — 12
if r = 7
Proof It is known th a t for a given p, there are exactly yy- quadratic residues. We investigate
quadratic residues. W ith the added condition th a t a + 1 ^ 2, —1, 2—1, we can count how
m any a ’s such th a t a + 1 is a quadratic residue. This all depends on how m any am ont the
three values: 2 , - 1 , 2 -1 are quadratic residues of p. We will subtract the values from
quadratic residues.
2 . If p = 3 m od 8 => —1, 2 , (—2 ) 1 + 1 are not quadratic residues so there are (p — l )/2
quadratic residues.
quadratic residues.
26
E x a m p le 8 . Consider the special elliptic curve with p = 11. Since 11 = 3 mod 8 , r = 3.
Therefore, p+”~4 = 1-:y - - = 5. There are 5 values for a which, when x = 0, will provide
a y-intercept on the curves. These a values are the following: 2, 3, 4, 3, 10. For example,
when x = 0 and a = 2, y 2 — 4. Therefore, the points (0, 2) and (0,9) are y-intercepts on the
5 A p p lication s in E ducation
This research was funded by the N ational Science Foundation through a program called
“G K - 12: Fellows in the M iddle” a t M ontclair State University. Through this program , m ath
and science graduate students are paired up w ith a team of middle school science and m ath
teachers, and their research advisors. The graduate students, or fellows, a tte n d the middle
school once a week to teach integrated m ath and science lessons. The author of this paper,
the m ath fellow, was paired w ith Jessica Evans, the science fellow. Our team worked in
cooperation w ith Noreen W iggins and C atherine Sickinger, the 6th grade m ath and science
teachers, respectively, a t the Franklin School in Kearny, New Jersey. There are several goals
for the GK-12 program . At the very least, the program aims for the middle school students
to experience m ath and science in a whole new light. The m iddle school students have
the opportunity to observe the graduate fellows in fields of which the young students may
have never heard. T he integrated lessons are refreshing and the students are often sparked
w ith new interest in m ath and science. A nother im portant goal of the GK-12 program is
to provide the teachers w ith sample integrated lessons and general ideas on how to increase
stu d en ts’ interest in STEM fields. Teachers are often overwhelmed w ith the am ount of cur
riculum they are required to teach. By integrating m ath w ith science, previous concepts can
be reinforced while teaching a new idea. An additional im portant goal of the GK-12 Program
is to allow the graduate students to enhance their own com m unication skills. Consequently,
27
th e fellows are asked to create m iddle school lessons based on their research topics. As cryp
tography is often unheard of in a middle school classroom, the author of this thesis took the
opportunity to show the students a brand new side of m ath. Displayed below is a lesson
titled “Shift Cipher Shenanigans.” T he lesson introduces the concept of C ryptography to the
students. They then learn the m ost basic cryptosystem , the Shift Cipher. Two additional
lesson plans can be found in th e appendix. The first, titled “How to Sound Like a Secret
A gent” reviews more vocabulary and introduces the S ubstitution Cipher. The second is a
lesson plan th a t explores the basics of m odular arithm etic. It is titled “M odeling M odular
A rithm etic.” T hrough these lessons, key middle school concepts are reinforced. For example,
Grade: 6
M aterials:
« P ractice Sheet
Goal: The students will be introduced to cryptography and specifically, the shift or Caesar
cipher.
Objective: Students will code and decode various messages using the shift cipher cryptosys
tem .
28
Standards Addressed:
• W arm-Up: Find the daily jum ble @ h ttp ://ju m b le.co m /g am es/in fo /1 3
• Tell the students th a t we are going to s ta rt w ith a game today. The object is to jum ble
the letters around to find the right word. Make it a class effort. If necessary, click hint.
Note: This m ay be necessary as some words may be above their vocabulary. **Dont
• Ask th e students if they liked th a t activity. Some m ay love the activity and some may
not. Explain th a t puzzle solving can be very sim ilar to M athem atics is several ways.
One m ajor way th a t puzzle solving is related to M athem atics is through Cryptography.
• W rite the word “cryptography” on the board so the students can see it. Describe
secret messages. There are m athem aticians th a t spend quite a bit of tim e study
ing— different ways of sending and receiving these messages in a secretive way.
• Let us take a m om ent to think of why we need to send messages in a secret way.
• If I w anted to send a message to Ms. W iggins w ithout anyone else (student OR teacher)
29
— Students m ay respond in the following ways and the following responses should
be given:
— Text Message - W hat if someone sees her phone and reads her messages?
• Here is an idea! W hat if we wrote the message in such a way th a t even if someone saw
it, they sim ply would not understand it. T h a t is the general idea of cryptography.
» Now, le t’s think. How m any letters are there in our alphabet? (26)
• W rite the alphabet in large letters on the board. (To save tim e - this can be done prior
• Today we are going to learn w hat is called a “shift cipher” . H ere‘s the trick - we will
take the alphabet and shift every letter a certain num ber of places to the left or right.
For example, if we shifted the alphabet two places to the right, an “a” would be in
the “c” spot, a “b” would be in the “d” spot ***Write the new (shifted) alphabet
underneath while doing this- explain th a t when we get to the end of the alphabet, we
m ust w rap around back to the beginning. Label th e new alphabet as “new” .
• Now if we w anted to w rite the word “A P P L E ” w ith our new alphabet, we would have
to use a “C” instead of an “A” , an “R ” instead of a “P ” . (By now the kids will have
caught on). W hat would “A P P L E ” look like in the final product? (CRRNG)
— CRRN G - A P PL E
• If I w anted to tell Mrs. W iggins th a t “I would like an apple.” I might send her a
message th a t says “I would like a crrng.” This way if someone saw the message, they
30
would not understand. It would be even b e tte r if we translated th e whole sentence.
At your seats, please tran slate the sentence: “I would like an apple.”
» T he original and new alphabets we have created are often seen in circular form. Today,
you will each create your own wheel so th a t you can easily shift the alphabet however
m any places you’d like in w hatever direction you would like. Pass out cardstock and
assist students w ith m aking shift cipher wheels. The attached cipher wheel model was
substitution-and-shift.htm l.
• W hen the students finish their wheels, ask them to come up and receive the following
worksheets.
• For homework: The shift cipher has another name. Find out the other nam e for a shift
Extension:
For the more advanced students, here are some possible follow-up questions:
a) W h at is the to tal num ber of ciphers th a t can be created w ith shift cipher wheels?
b) W hat is the to ta l num ber of ciphers th a t can be created w ith the letters of th e English
alphabet?
31
32
N a m e _________________________________D ate________________________
1. After shifting your alphabet 5 spaces to th e right, rew rite the phrase:
2. Shift your alphabet 22 spaces to the right. Rew rite the phrase:
LETS GO YANKEES
3. If you were to shift the alphabet 22 spaces to the right, how can we arrive at the same
4. T he following message was created by shifting the alphabet 21 places to the right,
or five places to the left. Find the original message. (Hint: S tart from the inside of your
wheel.)
5. T he following message was created by shifting the alphabet 4 places to the right. How
33
6 C oncluding R em arks
The two cryptosystem s found in this thesis use simple applications of num ber theory in
cluding the K napsack Problem and superincreasing sequences. B oth cryptosystem s require
quences, these system s can be adapted to messages of a non-binary system. The security of
the second version of our cryptosystem lies in the hidden, shared key. The key is m ade in a
unique way so th a t even if a th ird party intercepted one num ber in the sequence, they would
not know how to find the others as it is hidden in the Fibonacci subsequence. However,
future research could be done to further examine the security and complexity of the system.
This project also found several interesting properties of the Fibonacci sequence which are
used in th e developm ent in the cryptosystem . It is natu ral to consider sim ilar sequences
for the same purpose. In fact, a sequence th a t is defined w ith the same recursive p attern
as the Fibonacci sequence can be created using any random pair of startin g num bers. Any
can elaborate on this idea and explore th e nature of Lucas sequence in order to incorporate
34
R eferen ces
[1] Anshel, Iris., Michael Anshel, Dorian Goldfeld. “An Algebraic M ethod for Public-Key
[2] Bartholdi, John J., “T he Knapsack Problem ,” Georgia In stitu te of Technology. 2008.
[3] Dudley, Underwood. “A Guide to Elem entary N um ber Theory,” M athem atical Associ
[4] Hoffstein, J., Pipher, J., Silverman, J.H .. “An Introduction to M athem atical Cryptog
[5] Koblitz, Neal. “A Course in Num ber Theory and C ryptography,” Springer-Verlag, 1987.
[6] Luma, A., Raufi, B. “R elationship between Fibonacci and Lucas Sequences and Their
A pplication in Sym m etric C ryptosystem s,” Latest Trends on Circuits, Systems and
Signals, 2010.
[7] M atousesk, Radom il. “Knapsack Cipher and C ryptanalyst Using Heuristic M ethods,”
[8] Menezes, A., Vanstone, S., “Elliptic Curve C ryptosystem s and Their Im plem entation,”
[10] R aphael, A. Joseph, Sundaram , Dr. V., “Secured Com m unication through Fibonacci
[11] Rosen, K enneth H. “E lem entary N um ber Theory ans its applications,” Pearson. 2005.
35
[12] Singh, Thokchom C hh atrajit. “Lucas Num bers and Cryptography,” M aster’s Thesis
7 A p p en d ix
36
A A C ry p to sy stem A lgorith m U sin g Sage
print ’E n t e r "n" (the m e s s a g e space). The following will check the necessary conditions
n=4
pl= int(2~(10*n-7)/sqrt(5))
#print pi
p = next_prime(p2)
print ’O u r p r i m e i s ’, p
h=int(log (sqrt(5)*p,2)-10*n+9)
g=2.0
a= 7
k=ll
A=mod(g~a,p)
print ’A l i c e s e n d s to B o b A = g ~ a m o d p, A = ’, A
#####################################################
x = v e c t o r ([1,0,1,1])
print ’E n c r y p t i o n P r o c e s s : ’
K=mod(A~k,p)
print ’K = ’ , K
u = i n t ( ( l o g ( s q r t ( 5 ) * p ,2)- g - 1 ) / ( n - 1 ) )
37
print ’u = ’ ,u
if K < u:
print ’C a s e 1: K < u’
K=int(K)
r = v e c t o r ([])
for i in r a n g e ( 0 , n ) :
r=vector(list(r) + l i s t ( v e c t o r ( [ f i b o n a c c i ( g + i * K ) ] )))
print r
print ’D o t product of r a n d x ’ , r .d o t _ p r o d u c t ( x )
cl=mod(g~k,p)
c2=mod(A~k*(x*r),p)
print cl
print c2
C =mod((cl~(a))~-l*c2,p)
print C
else:
print ’C a s e 2: K >= u ’
K=int(K)
w=int(K/u)+l
v=int(K/w)
r = v e c t o r ([])
for i in r a n g e ( 0 , n ) :
r=vector(list(r) + l i s t ( v e c t o r ( [ f i b o n a c c i ( g + i * K ) ] )))
m = r .d o t _ p r o d u c t ( x )
cl=mod(g~k,p)
38
c2=mod(A~k*m,p)
print ,c _ l = ’ ,cl
print ,c _ 2 = ’ ,c2
C = m o d ( ( c l " ( a ) ) ~-l*c2,p)
print ,r = , ,r
print >C=} , C
Grade: 6
M aterials:
• P aper
• Pencil
Goal:
• Students will be introduced to the im portant term inology often used in cryptography.
•T h ey will understand the difference between a substitution cipher and a shift cipher.
Objectives:
Standards Addressed:
39
-N JC C C S Science: 5.1.4.A..2, 5.1.4.A.3, 5.1.4.B.2 .
P rocedure/ Lesson:
• As a warm-up, ask the students to report on w hat they found as the alternate name
for a shift cipher and why. They should respond w ith the nam e “Caesar Cipher” as
Julius C aesar used the m ethod to com m unicate with his troops.
• Ask one student to stand and give ju st a sum m ary of w hat went on in the “Shift Cipher
Shenanigans” lesson. This will be helpful for any student th a t was absent but it is also
— W heel
— Apple = crrng
• We are going to learn the technical term s used in cryptology. We will sound like
com plete secret agents after today! (as a new word is introduced, w rite it on the
board)
• L et’s s ta rt w ith the term plaintext message. Last week, when we took “apple” and
turn ed it into “crrng” , “apple” was the word we were trying to secretly send. The
— T he “crrng” is w hat we call the ciphertext. It is the message after it has been
hidden.
40
• The process th a t took “apple” and m ade it “crrng” is w hat we call encryption. It is
• If we were to take the ciphertext, and decode it or unjum ble it, th a t is w hat we call
decryption.
• T he wheel th a t we used to encrypt and decrypt certain words and messages is called
a key. If the key is known by m any others, it is considered to be a public key. If the
• At this point, ask the students to recap and nam e the term s ju st discussed.
— W h at do you call the process of uncovering a message after it has been hidden?
(decryption)
— W h at do you call a message th a t you would like send in a secret m anner? (plain
tex t message)
• Tell th e students th a t from now on, we will use these term s in the classroom when
• Display a sum m ary of the vocabulary words on the sm art board for the students to
41
• OKAY! L e t’s go back to sending secret messages. Last week, we encrypted messages by
shifting the alphabet a certain num ber of spaces. Those keys th a t we created are great
b u t they could be predictable. Once someone realizes the p attern , they can uncover
« There is another m ethod th a t is even safer th an the shift cipher. This cipher is called
the substitution cipher. T he substitution cipher is used in the same way but there is
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Q W E R T Y U I O P A S D F G H J K L Z X C V B N M
«►W h at you will notice is th a t the bottom row, the row used for decryption, does not have
any particular p a tte rn to it. Therefore, using a substitution cipher is secure because if
someone discovers one letter, they do not necessarily know any others.
• Now we are going to play a game and act like secret agents.
— G roup th e students into heterogeneous team s of 3. They should sit (or stand) in
a row and they will need a pencil. Every Player 1 will receive a copy of the public
key. Players 2 and 3 will each get their own copy of another substitution key.
- Each Player 1 will receive an encrypted message. They should decrypt the message
and pass it on to Player 2. This should be done quietly, as every Player 1 will
receive the same message. All Player 2’s will have different substitution keys.
It is their job to then encrypt the message again after receiving it from Player
1. Once encrypted, they are to pass the ciphertext to Player 3 (who’s keys will
m atch Player 2’s) to decrypt it. The team of three to get passed through all three
42
steps correctly wins! Note: it will be easy to tell if the message is correct as it
will be the same message th a t was originally given to Player 1. It will simply be
— A ttached is the original message for Player 1, and 7 different substitution keys.
Each key should have two copies, one for Player 2 and one for Player 3.
— At the end of the game, each Player 2 will have a different encryption of the same
message! The students will see th a t any message can be encrypted and m any
different ways.
Original E ncrypted Message to be given to Player 1 for decryption: They are to use the
substitution key above which will be displayed on the board. ZIT JXO EA W K G V F YGB
Key 1:
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
H I Y T U R P O E W Q A S L K J G D F B N V M C Z X
Key 2:
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
P O I U Y T R E W Q L K J H G F D S A Z M N B V C X
Key 3:
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
M A Q W S Z X D E R F V B G T Y H N J U I K O L P C
43
Ke y 4:
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
P I Z G O N F R A C E S J V W Y T Q U L K H D M X B
Ke y 5:
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Z X C V B N M L K J H G F D S A Q W E R T Y U I O P
Key 6:
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
N B K M L J H G V C S X Z A D F P U O Y I T R E W Q
Key 7:
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
A L S M D K F J G H Q P W O E I R U T Y Z X C V B N
Grade: 6
M aterials:
• Pencil
• P aper
44
• A ttached Sheets: W arm Up, Classwork 1 and Classwork 2
Goals:
-They will see a whole new exciting way to add, subtract, multiply, etc.
Objectives:
-Students will com plete exercises similar to those th a t I work w ith in my own research ex
perience.
-They will solve various m odular problems w ith varying levels of difficulty.
S tandards Addressed:
• Begin w ith the attached warm-up. They should take their tim e as this activity will
get them thinking outside the box. It will cause them to get into thinking in a cyclic
m anner. Be sure to work slowly through this lesson. It can feel overwhelming to them
• Explain to d ay ’s goal: We will learn m odular arithm etic which you have all been doing
— We use a clock to tell tim e and yet it only involves 12 num bersdoes th a t m ean we
can only have m axim um 12 hours in a day? W hat do we do 13,14,15 hours later?
Well sure - we wrap around the clock. This type of w rap around idea is w hat we
45
— T h a t being said, w hat would we do if our clock only had six hours on it, or the
num bers 1-6? (Draw the clock.) W hat would 10:00 look like on this clock? (4:00)
— W hat about a 9 hour clock? (Try and see if they know it w ithout drawing it)
W h a t would 20 hours later look like if we are startin g at the top which would be
“9:00” ? (2:00)
• L e t’s ditch the clocks. If it is helpful, we can think of a num ber line b u t instead of a
straight line le t’s th in k of it in th e shape of a circle. The num ber of digits on our clock,
or the num ber of num bers on our new num ber line is w hat we call the “m odulus” . The
— W h at is the m odulus for the days of the week? (In other words, w hat num ber of
— W h at is the m odulus for the num ber of seconds in a m inute? At w hat num ber do
we s ta rt over?
• Now, le t’s p u t our m athem atician faces on. (Make a fun face! Try to get the students
to do it too!)
• Earlier I asked w hat 10:00 would look like on a clock w ith only six digits and we
all agreed it would be 4:00. To say this m athem atically, we would say “10 m od 6 is
congruent to 4” w ritten as
• W h at about the 9 digit clock? We know it would be m odulus 9. How would we say 20
• One im portant idea w ith m odular arithm etic is th a t when we reach our m odulus, we
46
the clock w ith a 0 in the 12 spot. Som ething w ith m odulus 14 would have the num bers
0,1,2,3,4,5,6,7,8,9,10,11,12,13. There are still 14 num bers bu t instead of num bers 1-14
we use 0-13.
• L e t’s take things up a notch. M odular A rithm etic is sometimes called Rem ainder
A rithm etic. Can you think of any reason why? (More advanced students m ay arrive
• L et’s look at some larger num bers. W hat would 29 m od 3 be? (2) How do we know
this?
• Explain th a t you can certainly make a clock and wrap around a num ber of times. The
the clock how m any tim es? (9) Nine tim es around brings us back to 0. W hat is left?
29-27= 2. Therefore, the answer is 2. In other words, T he rem ainder is your real
answer!
• The norm al operations can be performed w ith m odular arithm etic as well. Rem ember
when 2 + 2 = 4 back in first grade? Well now youre in 6th and 2+2 can be som ething
else!
• Now try the Classwork 2 Assignment. The num bers are larger bu t if you get confused
W arm -U p (May take up to 10-12 m inutes) Think through and solve the following prob
lems:
47
1. T he clock strikes m idnight. In th e extended version of the story, Cinderella m ust be
back home in 36 hours. W hat tim e will the clock say when she gets home if she ju st meets
curfew?
2. It is 1:00 in the afternoon. T he detective determ ines th a t the crime was com m itted
3. Miss P ’s tu rtle nam ed “Y urtle” began a journey across her room. He began at one
end of her room at 11:00 am and it took him 7 hours. W hat tim e did he reach the other
side?
4. T he movie began at 3:00 pm. Movie reviews said the movie was 110 m inutes long.
48
Classwork Assignment 1
1. If you m ade a clock w ith 4 num bers on it, where does 17 hours bring you to? Draw a
picture if necessary. W hat m odular expression can you w rite for this?
2. C an you think of a real life m odulus example? Exam ples would be the 12 hours of a
clock or 60 m inutes to an hour. We m entioned a few others earlier. Can you come up w ith
4. 23 m od 9 = _____________
6. 18 m od 5 = _____________
7. 19 m od 3 - _______ _____
Classwork Assignment 2 Try these problem s on your own! It m ay help to think about
3. 97 m od 4 = ____________ 4. 38 m od 5 = _________
5. 99 m od 30 = ____________ 6. 56 m od 6 =.________
49