0% found this document useful (0 votes)
24 views

Number Theory Applications in Cryptography

This document discusses number theory applications in cryptography. It first introduces superincreasing sequences, which are sequences where each term is greater than the sum of the preceding terms. Superincreasing sequences make the Knapsack Problem, which involves finding combinations of numbers that sum to a target value, easy to solve. The document then presents two cryptosystems that use a shared superincreasing sequence or one constructed from Fibonacci subsequences to encrypt and decrypt binary messages. It also briefly examines elliptic curves and the points that intersect the y-axis for a special case. Finally, it describes implementing cryptography lessons in a middle school classroom.

Uploaded by

Bharat Dharua
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views

Number Theory Applications in Cryptography

This document discusses number theory applications in cryptography. It first introduces superincreasing sequences, which are sequences where each term is greater than the sum of the preceding terms. Superincreasing sequences make the Knapsack Problem, which involves finding combinations of numbers that sum to a target value, easy to solve. The document then presents two cryptosystems that use a shared superincreasing sequence or one constructed from Fibonacci subsequences to encrypt and decrypt binary messages. It also briefly examines elliptic curves and the points that intersect the y-axis for a special case. Finally, it describes implementing cryptography lessons in a middle school classroom.

Uploaded by

Bharat Dharua
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 50

Montclair State University

Montclair State University Digital


Commons

Theses, Dissertations and Culminating Projects

5-2013

Number Theory Applications in Cryptography


Francesca Pizzigoni

Follow this and additional works at: https://digitalcommons.montclair.edu/etd

Part of the Number Theory Commons


MONTCLAIR STATE UNIVERSITY

Number Theory Applications in Cryptography


by
Francesca Pizzigoni

A Master’s Thesis Submitted to the Faculty of


Montclair State University
In Partial Fulfillment of the Requirements
For the Degree of
Master of Mathematics

May 2013

College of Science and M athem atics Thesis Com m ittee:

D epartm ent of M athem atics

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

Submitted in partial fulfillment of the requirements


for the degree of Masters in Pure and Applied Mathematics

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

Slusarczyk for their continued support and comraderie.

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

5 A p p lic a tio n s in E d u c a tio n 27

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

C L e s s o n P l a n 3: M o d e lin g M o d u la r A r ith m e tic 44

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

will focus on specific applications of N um ber Theory in their relevance to cryptography.

B asic T erm inology

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,

it is crucial th a t a cryptostem is both efficient and secure.

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

is coded using an algorithm and turned into a ciphertext.

D ecryption

D ecryption is the m ethod used to uncover a ciphertext. Through a reverse algorithm ,the

message is discovered and translated back into the plaintext message.

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

a com bination of b oth public and private keys.

T hroughout the project, we assum e the message space is built from integers, integers

mod a positive integer, or vectors of 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.

D e f in itio n 1 . A sequence r = { r i , r 2, ...,r n} of positive integers is superincreasing if ri+1 >

V{ + r*j_i H----- + r i for all i with 1 < i < n — 1.

An example of a superincreasing sequence is { 2 ,3 ,7 ,1 5 ,3 1 } as each num ber is greater

th a n the sum of the num bers before it. These sequences are relatively easy to create and are

of great im portance to th e well-known Knapsack Problem [5]. A simple decipher m ethod is

based on the following problem:

P r o b le m 2.1. The Knapsack Problem

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

th a n one solution. It is known th a t when the vector a is formed by a superincreasing sequence

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

in the K napsack C ryptosystem which will be explained shortly.

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

C ryptosystem and is shown below.

T he basic premise of the K napsack C ryptosystem is provided [4]:

1. Alice has a secret key th a t is a superincreasing sequence r = {r*i, r q ,. . . , rn}.

2. Alice chooses two private, large integers A and B such th a t B > 2rn and gcd(A , B) = 1.

3. Alice creates a public key M = (M l5 M 2, . . . M n), which is an n- vector in Z n, by

calculating Mi = A • r* m od B w ith 0 < Mi < B.

4. E ncryption process: Bob chooses a plaintext message x = (a q ,:^ , • • • ,x n) which is a

binary n —vector. He com putes and publishes the ciphertext C — x • M = YH=i xi ’ Mi

5. D ecryption process: Alice com putes

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'.

Note th a t in Step 5, C' = Y^i=\xKi m ° d B. As B > 2rn,C ' < ri — rn + rn —

2rn < B Therefore, th e solution to C' = xKi m ° d & is equivalent to C' = XlILi xKi

so Proposition 2.2 can be used.

P r o p o s it io n 2 . 2 . [f] Let r — { r i , . . . , r n} be a superincreasing sequence and let C' be a

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.

If C' > rn, xn = l. If C < r n, xn — 0 .

2. A new sum is assigned:

n
C' := ^ 2 xpri = C - rnxn.
2=1

Repeat the same procedure in Step 1 to find xn- \.

3. Continue through the procedure until all x fs are determined.

T he steps above are based on a well-known algorithm for solving the K napsack Cryp­

tosystem . It is im portant to note th a t this algorithm not only finds a solution, bu t th a t

solution is in fact unique. A proof for the uniqueness of x follows:

Proof. Let C' = x xr x + x 2r 2 H-------b xnrn = y ir 1+ y 2r2-\-------b y^ n where x = {x i,x 2, . .. ,x n)

and y = {yx, y2, . .. yn) are bo th in Z^.

T hen

(yn ~ xn)xn = (x i - y i)n H------- b {xn- i - yn- i) r n- i

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

If xn 7^ yn, then |xn — yn\ = 1. Thus r n < r^. This is a contradiction as r is

a superincreasing sequence. Thus, xn = yn. By m athem atical induction, X\ — y\,X 2 =

2/2, • • • ,x n = yn so x = y. □

E x a m p le 2 . Consider the Knapsack Problem in Example 1: ((1, 3, 7, 20,42,107), 115).

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,

the solution is ( 1, 0 , 1, 0 , 0 , 1).

For convenience, w ith superincreasing sequence r — I n , 7*2, . . . , r n}, we denote r =

{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.

3. Alice calculates the non-negative residue of M = A • m od B and obtains M =

(101,202, 505,92,992,442,334,560) and sends this to Bob.

4- Encryption: Bob has a plaintext message x = (0 , 0 , 1, 1, 0, 0,1, 0). He computes C =

x • M = 931 and sends it over to Alice.

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,

she achieves the plaintext message x — (0 , 0 , 1, 1, 0 , 0 , 1, 0).

P ro p e rtie s o f th e F ib o n acci Sequence an d R e la te d Sequences

Because superincreasing sequences are so relevant to the Knapsack C ryptosystem , we ex­

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 ,...} .

D e f in itio n 2. The Fibonacci sequence is defined as: F0 = 0, Fi = 1, Fn+2 — Fn + Fn+1 for

all non-negative integers n.

T he Fibonacci sequence has several im portant properties. The following property is of

utm ost im portance to this paper.

P r o p e r t y 2.3. [12] Fn+2 = Fl + F2 H------- \-Fn + l.

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 =

T he form ula follows.

P r o p o s it io n 2.4. Let a = and (3 = so that a and (3 are roots of the equation

x2 = x + 1. Then Fn = for all n > 1.

The num ber a is known as the Golden Ratio. The following corollary is a direct result

of the above formula.

C o r o lla r y 2.5. For any n G Z +, Fn <

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-

As previously m entioned, superincreasing sequences play a key role in the Knapsack

Cryptosystem . As we move to the Fibonacci sequence, it can be shown th a t this is not a

superincreasing sequence. We will also prove th a t any consecutive subsequence of length at

least three is also not superincreasing.

L e m m a 2.7. The Fibonacci sequence is not a superincreasing sequence. In particular, any

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

3 < 0 + l + l + 2. In other words, F 4 ^ Y^=o

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 —

2,L \ = 1 and L n+2 = Ln + Ln+i if n > 0 ,n G Z. Therefore, Lucas sequence is as follows:

{2,1,3,4,7,11, . . . } which is not superincreasing. Lucas sequence can be directly linked to

the Fibonacci sequence w ith the following formula. [12]

L e m m a 2.8. Ln = F n_i + Fn+1 = Fn + 2Fn_i

Lucas sequence is expressed in Lem ma 2.8 as a linear com bination of certain Fibonacci

num bers. Therefore, it is no surprise th a t Lucas is not a superincreasing sequence.

S u p erin creasin g S ubsequences of th e F ib o n acci Sequence an d Lucas

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

sequence, { 0 ,1 ,3 ,8 ,2 1 ,...,} , form a superincreasing sequence. In fact, any subsequence th a t

does not use consecutive Fibonacci num bers forms a superincreasing sequence.

T h e o r e m 2.9. A. subsequence S — \^Fm^ Fm.\rri^.r^1. . . , FA-)-ri+r2H— • • • } of the Fi­

bonacci sequence is a superincreasing sequence if d > 1, with all r* > 2 .

Proof. Let d be a positive integer. Then by P roperty 2.3 above,

F m+r\+r2-\ l-i’d ~ Fi + F2 T *' *T Fm. l-^d- 2 T 1.

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

Fm,+ri+r2-{--- \-Td-l+^d 4" -^m+ri T • • ' T -fm+ri+^H--- hrd-i-

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

a subsequence of th e Fibonacci sequence w ith evenly spaced term s. For example, 0, 1, 1,

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.

C o r o lla r y 2 . 10 . A subsequence D = { Fm, Fm+d, Fm+2d, Fm+3d, . . . , Fm+kd} of the Fibonacci

sequence is a superincreasing sequence for all d > 1 and k > 0 .

Proof. If k = 0, we have { Fm} which is trivially superincreasing. If k > 0, this is a direct

result of the previous theorem . □

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.

Consider the following lemma. [12]

L e m m a 2 .1 1 . If a n and [3n are superincreasing sequences, then aan + b(3n is superincreasing

for all a, b > 0 .

We can create superincreasing subsequences of Lucas sequence if we use a linear combi­

nation of superincreasing Fibonacci subsequences.

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

retrived sim ilarly?” A generalization of superincreasing sequences, callled t —superincreasing

sequences, is defined below.

D e f in itio n 3. A sequence r — ( r i , r 2, ...,r n} of positive integers is t-superincreasing if rn >

(t — l ) ( r i + r 2 + • • • + r n_ i).

The superincreasing sequence, defined earlier in this paper, is a 2-superincreasing se­

quence. We now consider a 3-super increasing sequence r = { ri, r 2, . . . , rn} such th a t >

2 (r*i + r 2 H------- b r<_i) for a lH = 2 , 3 , . . . , n.

T h e o r e m 2.1 2 . Consider the Knapsack Problem for a 3-superincreasing sequence r =

( r i , r 2, . . . , r n} and a positive integer S.

1. If a solution exists in Z 3, then it is unique.

2. Let x — (xi, x 2, . . . , xn) € Z 3 be a solution then

0 if S < r n

1 if rn < S < 2r, (i)


2 if > 2r n.

Proof 1. S < rn if and only if xn — 0 because

S < rn & xprx + x 2r2 H------- b xnrn < rn

x in + x2r2 H------- b x n_ ir„ _ i < r n (l - xn)

^ xn = 0 since x \ n + x2r2 H------- b xn- \ r n- \ > 0 .

15
2. rn < S < 2rn if and only if xn — 1 since

rn < S < 2rn rn < x in + x2r2 H------- 1- xnrn < 2rn

rn( 1 - x n) < x i n + x 2t2 H------- h £ n_ ir n_i < r n(2 - xn)

<=>■xn = 1 since aqri + £ 2^2 + • • • + xn_ ir n_i > 0 and

r n > 2 (ri + r 2 H------- h r n_i) > ^ r i + x2r2 H------- h x n_ ir n_i.

3 . S > 2rn if and only if xn = 2 because

S > 2 r n <^ x iri + x 2t2 H------- h £n_ ir n_i > r n(2 - a;n)

xn = 2 for sim ilar reasons nam ed above.

This algorithm can truly be applied to any t —super increasing sequence.

T h e o r e m 2.13. Consider a Knapsack Problem (r,S) where r is the t-superincreasing se­

quence created from r and S is a positive integer.

1. If a solution exists in Z ™, then it is unique.

2. Let x = (#i, x 2, . . . , xn) G Z ” be a solution then

0 if S < r n

1 if rn < S < 2rn

xn < 2 if 2rn < S < 3r, (2)

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

Two Variations of the Cryptosystem

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.

C ryptosystem Version 1: Secret Key Provided

Alice and Bob share a common key in the form of a superincreasing sequence which is pro­

vided beforehand and represented by the vector r — ( n , 7*2, . . . , rn).

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.

1. Alice com putes A = ga m od p and sends A to Bob.

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

can be used to solve for x. □

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.

Public Keys: g = 99 and p = 1223.

Private Keys: Alice’s a — 7 Bob’s k — 3.

1. Alice computes A = ga m od p = 856 and sends this to Bob.

2. Bob has the plaintext message x = (0, 0 ,1 ,1 ,0 , 0,1, 0). He computes (01, 02) where

C\ = 460 = gk m od p, and C2 = 45 = A k(x • r) m od p. Bob sends (460,45) to Alice.

3. Alice computes C' = (ci)~a(c2) m od p. c fa = 351-1 m od p = 233. C' = 251.

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

sim ilar cryptosystem th a t creates a common superincreasing sequence based on Fibonacci

subsequences.

C ryptosystem Version 2: Secret Key C reated

The following are public keys: a fixed n £ Z + such th a t n > 2, a large prim e p » 2l°J^ ,

and g £ Z + such th a t 1 < g < log 2(v /5p) — 10n + 9, and p \ g.

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.

1. Alice com putes A — ga m od p and sends A to Bob.

2. In order to encrypt his plaintext message x £ Z £, he needs to create a superincreasing

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,

T ~ { F g , F g+Vl Fg+2w) • • • 1 F g+(n —I ) « }

where v = LW
I —-1I and w —LIU
—J I + 1.

Bob can now encrypt x by sending (ci,C 2) to Alice where C\ — gk m od p and C2 =

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

occurs because (ci)_a(c2) m od p = (gka)~lgkax • r = x ■f m od p.

Proof. Because p > 2l^h , \fhp > 210n 7. This implies log2{\[hp) > 10n — 7 so log2(V^p) —

10n + 9 > 2. As g < log2(y/bp) — 10n + 9 , we can conclude th a t g > 2 .

1. Case 1. K < w, r = { Fg, Fg+Kj Fg+2 K:•••■> Fg+(

We need to show th a t K > 2 so th a t r is superincreasing.

Because gcd(a,p — 1) = 1 and gcd{k,p — 1) = 1, K = gak mod p > 1. Thus K > 2.

Then from Theorem 2.9, we know th a t f creates a superincreasing sequence. To prove

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.

2. Case 2. K ^ ri, T {Fg, F'g+vi 2uj • • ■ Fg+(n—l)v}'

We need to prove v > 2:

P I 2l°yE 7 so > 2 10n_7 > 2 10n~9 => log2(V^p) — 10n + 9 > 0

Since g < log2 (V^p)~ 10n+9, then g+lO n—9 < log2 (V^p) =>• g + n + 9 n —9 < log2(y/&p)

T hus 9 (n — 1) < log2(VEp) —g —n =$■ 9 < Zog2^ ^ p|~g~n = —1

From here, we know th a t 9 < l°92(V5p)-g-i _ \ < u Thus 6 < u — 3. Then

< 1 => < ti < iL in this case.

Therefore, K > =>• K u - 3K > Q u ^ K > 6 + — — 3(2 + —

This implies iL > 3(1 + |_^J) so K > 3 w or in other words F > 3.

Lastly, v — > F — 1 > 2 Because u > 2, from Theorem 2.9,we know th a t r

creates a super increasing vector.

To prove Fg+{jl_ l)v < 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

Private Keys: Alice’s a = 7, Bob’s k = 11

1. Alice computes A = ga m od p, A = 128.

2. Bob has the plaintext message x = (1 ,0 ,1 ,1 ). He computes K = A k m od p, K =

8362875137 and u — 10. Because K > u, Bob finds r — (1,89,6765,514229) which is

superincreasing. He then sends Alice (01, 02) = (2048,9618950101).

3. Alice computes K = c\ m od p. She similarly finds r — (1,89,6765,514229).

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

plaintext message x = ( 1, 0 , 1, 1).

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

piece of cryptography th a t uses m any applications in N um ber Theory.

4 A Special C ase o f E llip tic C urves and th e P oin ts on

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

of the form y 2 = x 3 + Ax + £ , where A, B E F satisfy 4 A3 + 27B 2 0. A pair (x, y ) where

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

curve y 2 = x3 + Ax + B over a field F to encrypt and decrypt messages. Precisely, E is

defined as follows:

D e f in itio n 4. E(¥) = {(x, y) \ x, y E F, y2 = x3 + Ax 4- B } |J{ (9 } , where O represents

the identity of this closed algebraic group. The operation of the group is represented as ©,

defined below:[4]

Let P\ = (xi,yi) and P2 = (x2, y2) be points on E.

1. For every P 6 E ( F ) , P @ 0 = P = 0 ® P

2. If x\ — X2 and y\ = —y2, then Pi © P2 = O.

3. If x 1 / x2, Pi © P 2 = (x3, 2/3) where

x3 = A2 - xi - x2 and y3 = X(xi - x3) - 2/1•

for
_ I (2/2 - yi)(x 2 - Xi ) - 1 i f Pi ± P2

\ (Zx2 + A)(2yi )-1 i f Pi = P2

E x a m p le 6 . For example, if E is an elliptic curve E F 7 , then the curve y2 = x 3 + lOx — 2

consists of the following points:

{'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)}.

Elliptic curves, as previously m entioned, are curves of the form y2 = x 3 + Ax + B. It is

im portant to notice th a t the left hand side m ust be a perfect square. In a finite field, perfect

squares are called quadratic residues.

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

of m if (a, m) = 1 and the congruence x2 = a m od m has a solution. If the congruence

x2 = a m od m has no solution, we say that a is a quadratic nonresidue of m.

E x a m p le 7. 3 is a quadratic residue modulo 13 because 4 2 = 3 mod 13. On the contrary, 8

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.

P r o p o s it io n 4 .1 . Let p be an odd prime number.

1. The product of two quadratic residues modulo p is a quadratic residue modulo p.

2. The product of a quadratic residue and a quadratic nonresidue modulo p is a quadratic

nonresidue modulo p.

3. The product of two quadratic nonresidues modulo p is a quadratic residue 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.

Using this definition, a is a quadratic residue of p if and only if ( - ) = 1. The next


\P j
theorem states some of the basic properties of the Legendre Symbol.

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

1. if a = b (mod p), then (jfj = ( j^ .

*• I
3. ( ^ ) = 1 .

T h e o r e m 4 .3 . [4] Let p be an odd prime, then

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)

if P = 3 (mod 4) and q = 3 (mod 4)

Some equations of the form x3 + Ax + B can be factored as (x —a)(x —a2)(x + a + a2)

where a G Z. We consider this factorization of an elliptic curve a special case of interest.

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

result in curve w ith a ^/-intercept?

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

y 2 = a4b2 = ( a2b)2 =+ y = ± a 2b.

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.

D e f in itio n 7. For an odd prime p, define Sp = { Ea(Zp)\y2 = (x — a)(x — a2)(x + a + a2)

m od p where a G Z , a / 0 , l , —2, (—2 )-1 m od p}

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

using Legendre symbols.

T h e o r e m 4.6. Consider Ea G Sp. Assume p = r m od 8 (0 < r < 8 ). There are m r many

a ’s G Zp such that the elliptic curve Ea has a y-intercept.

' 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

how m any values of a + 1 can be quadratic residues. Since a ^ O j a + l ^ l s o can be

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

1. If p = 1 m od 8 =+ —1,2, (—2 )—1 + 1 are quadratic residues so there are (p — 7)/2

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.

3. If p = 5 m od 8 +> —1 is a quadratic residue b u t 2 and (—2) 1 are quadratic residues

so there are (p — 3 )/2 quadratic residues.

4. If p = 7 m od 8 =+ 2, (—2 )-1 are quadratic residues b u t —1 is not so there are (p —5)/2

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

curve y2 — (x — 2){x —4)(x + 6 ).

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,

dividing w ith a rem ainder is relevant to m odular arithm etic.

Lesson: Shift Cipher Shenanigans

Grade: 6

Time: One 45 M inute Class Period

M aterials:

• Jum ble W arm -Up

» W heel W orksheet printed on C ardstock (20)-precut to save tim e

« P ractice Sheet

• P aper Fasteners (25)

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:

-M ath Com m on Core: 6 .E E .2, 6 .E E .4

-N JCC CS Science: 5.1.4.A..2, 5.1.4.A.3, 5.1.4.B.2 .

P ro ced u re/ Lesson:

• 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

let the w arm -up go beyond 7-8 minutes.

• 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

cryptography to the students in the following way.

— C ryptography is a whole area of m athem atics dedicated to sending and receiving

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.

Today, we are going to learn ju st one of those ways.

• 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)

reading it, how can I do th at?

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?

— Em ail - If it is accidentally left open, someone could read it!

— Note - W h at if it is left somewhere and someone gets a hold of it?

• 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

to the beginning of class.) Label the alphabet original.

• 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

taken from the following website: h ttp :/ /tutorialsoneverything.blogspot.com /2011/05/cryptology-

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

cipher and where this nam e comes from.

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________________________

Shift Cipher W orksheet

1. After shifting your alphabet 5 spaces to th e right, rew rite the phrase:

FRA N K LIN SCHOOL IS T H E BEST

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

letters by moving to the left?

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.)

ADIY EVHZN W JIY

5. T he following message was created by shifting the alphabet 4 places to the right. How

m any left could it also be shifted? Find the original message.

XS KIX XS XLI SXLIV W M HI

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

th a t the message be of binary nature bu t by our concept of generalized superincreasing se­

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

nonconsecutive subsequence of this new sequence m ay also be superincreasing. Future work

can elaborate on this idea and explore th e nature of Lucas sequence in order to incorporate

it into the cryptosystem .

34
R eferen ces

[1] Anshel, Iris., Michael Anshel, Dorian Goldfeld. “An Algebraic M ethod for Public-Key

C ryptography,” M athem atical Research Letters. 6. 1999.

[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­

ation of America. 2009.

[4] Hoffstein, J., Pipher, J., Silverman, J.H .. “An Introduction to M athem atical Cryptog­

raphy,” Springer. 2010.

[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,”

In stitu te of A utom ation and C om puter Science, Brno University of Technology,___

[8] Menezes, A., Vanstone, S., “Elliptic Curve C ryptosystem s and Their Im plem entation,”

Journal of Cryptology, 1993.

[9] Paterson, K enneth G. “C ryptography from Pairings: A Snapshot of C urrent Research,”

Inform ation Security Group, University of London. November, 2002.

[10] R aphael, A. Joseph, Sundaram , Dr. V., “Secured Com m unication through Fibonacci

N um bers and Unicode Symbols,” International Journal of Scientific and Engineering

Research, Vol. 3, Iss.4, April, 2012.

[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

N ational In stitu te of Technology Rourkela. 2012

[13] Weiss, Edwin. “Algebraic N um ber Theory,” M cGraw Hill. 1963.

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

p2=pl+2~33 #Makes p su f f i c i e n t l y large

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)

print ’E n t e r a g value greater than 1 but less t h a n or equal t o ’, h

g=2.0

a= 7

k=ll

print ’C h e c k to see if p d i v i d e s g: p/g = ’ , (p/g)

print ’C h e c k to see if a a n d p - 1 a re r e l a t i v e l y pri m e : gcd(a,p-l)=’, gcd(a,p-l)

print ’C h e c k to se e if k a n d p - 1 a re r e l a t i v e l y pri m e : gcd(k,p-l)=’, gcd(k,p-l)

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

print ’Bob: Enter plaintext message x in t h e n e x t box and hit "evaluate" ’

#####################################################

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 ) ] )))

print ’T h e superincreasing sequence r i s ’, r

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 ’A l i c e n o w n e e d s t o solve the Knapsack Problem with (r, C)’

print ,r = , ,r

print >C=} , C

B Lesson P lan 2: H ow to Sound Like a Secret A gent

Grade: 6

Time: One 45 M inute Class Period

M aterials:

• P aper

• Pencil

• A ttached Substitution Keys

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:

• Students will use correct vocabulary when working w ith cryptography.

• Students will encrypt and decrypt messages using a substitution cipher.

Standards Addressed:

-M ath Common Core: 5.0A .3, 4.0A .5

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

im portant for the students to be able to reflect back on th a t lesson.

• Im portant ideas to be sure are covered:

— W heel

— “original alp h ab et” and “new alphabet”

— 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

plaintext message is the original word th a t you want to send.

— T he “crrng” is w hat we call the ciphertext. It is the message after it has been

hidden.

— W h at is another example of a plaintext message and a ciphertext th a t we worked

w ith last week?

40
• The process th a t took “apple” and m ade it “crrng” is w hat we call encryption. It is

the process of encoding or hiding a message.

• If we were to take the ciphertext, and decode it or unjum ble it, th a t is w hat we call

decryption.

— Sum mary: A P P L E CRRNG = EN CRY PTIO N

— CRRN G A P P L E - D ECRY PTIO N

• 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

key is a secret, it is called a private key.

• 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 hiding a message? (encryption)

— W h at do you call the message after it is hidden? (ciphertext)

— W h at do you call the tool used to code or decode a message? (key)

— 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

working on cryptography related work.

• Display a sum m ary of the vocabulary words on the sm art board for the students to

reference throughout the rest of the lesson.

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

the entire message!

« 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

no p a tte rn to the key. L et’s look at the following example:

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.

• Use this key to decrypt the following message:

DOLL H. SGCTL ZXKZSTL (MISS P. LOVES TURTLES)

• 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

encrypted and decrypted again using a different key.

— 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

P X D H T R G C TK ZIT SQMN RGU

(TH E QUICK BROW N FOX JU M PED OVER TH E LAZY DOG)

Below are Keys to be copied and given to Players 2 and 3:

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

C Lesson P lan 3: M od elin g M odular A rith m etic

Grade: 6

Time: One 45 M inute Class Period

M aterials:

• Pencil

• P aper

44
• A ttached Sheets: W arm Up, Classwork 1 and Classwork 2

Goals:

-Students will be exposed to m odular arithm etic.

-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:

-M ath Common Core: 6.NS.2, 6.E E .3, 6.E E .4

-N JCC CS Science: 5.1.4.A.3, 5.1.8.A.2, 5.1.4.B.3, 5.1.4.B.3 .

P ro ced u re/ Lesson:

• 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

if it is not done in an understandable m anner.

• Explain to d ay ’s goal: We will learn m odular arithm etic which you have all been doing

for years w ithout even realizing it. L et’s go back to th a t warm-up.

— 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

call m odular arithm etic.

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

m odulus tells us w hat to go up to before we begin to wrap around.

— W h at would the m odulus be on our usual clock? (12)

— W h at is the m odulus for the days of the week? (In other words, w hat num ber of

days do we have before we sta rt the week over again?)

— 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

hours later? (20 m odulus 9 is congruent to 2 or .)

• One im portant idea w ith m odular arithm etic is th a t when we reach our m odulus, we

consider it to be a 0 since we begin again w ith 1 after th a t. In other words, think of

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.

• Now have the students try the attached Classwork 1 problems.

• 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

a t this answer quickly. If they do, ask them to explain.)

• 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

other way to think of it is th a t 27 is a m ultiple of 3 which m eans we will work around

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

ju st divide and find the remainder!

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

13 hours ago. W h at tim e was it when the bank was robbed?

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.

W h at tim e will the movie end?

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

any new ones?

3. W h at would 15 m odulus 6 be? W rite the m odular expression.

4. 23 m od 9 = _____________

5. 34 m od 17 = _____________ *This one is tricky!

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

the rem ainder m ethod!

1. 65 m od 8 = _____________ 2. 100 m od 3 = ____________

3. 97 m od 4 = ____________ 4. 38 m od 5 = _________

5. 99 m od 30 = ____________ 6. 56 m od 6 =.________

7. In ordinary arithm etic, 8 7 = _________ which i s _____ m odulus 5.

8. In ordinary arithm etic, 9 10 = _________ which i s ____ _ m odulus 3.

9. In ordinary arithm etic, 8 + 73 = _________ which is___ _ m odulus 4.

10. In ordinary arithm etic, 14 + 30 = _________ which is ____ m odulus 16.

49

You might also like