Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

Cryptologia

ISSN: 0161-1194 (Print) 1558-1586 (Online) Journal homepage: https://www.tandfonline.com/loi/ucry20

A Cryptographic Scavenger Hunt

Judy A. Holdener & Eric J. Holdener

To cite this article: Judy A. Holdener & Eric J. Holdener (2007) A Cryptographic Scavenger Hunt,
Cryptologia, 31:4, 316-323, DOI: 10.1080/01611190701245050

To link to this article: https://doi.org/10.1080/01611190701245050

Published online: 05 Oct 2007.

Submit your article to this journal

Article views: 123

Full Terms & Conditions of access and use can be found at


https://www.tandfonline.com/action/journalInformation?journalCode=ucry20
Cryptologia, 31:316–323, 2007
Copyright  Taylor & Francis Group, LLC
ISSN: 0161-1194 print
DOI: 10.1080/01611190701245050

A Cryptographic Scavenger Hunt

JUDY A. HOLDENER AND ERIC J. HOLDENER

Abstract In this article, the authors present a mathematical scavenger hunt


designed to motivate and excite students learning RSA cryptography in an intro-
ductory number theory course. The hunt relies on the RSA cryptosystem, in
which Maple is used to encipher and decipher secret information contained within
the clues.

Keywords RSA cryptography, teaching cryptography, teaching number theory

Introduction
In 2003, Doubleday Fiction published the novel The Da Vinci Code [1] by American
author Dan Brown, and enthusiasm for the book immediately swept across the
globe. Selling over 60 million copies in less than three years, the book became the
focus of intense media scrutiny: magazine and newspaper articles, television specials,
and even other books. The book was panned by many critics, and there was a desire
to ban it by some groups. Nonetheless, despite the negative publicity, Brown’s intri-
cately layered code has captivated the masses.
After reading Brown’s novel and observing its success, the first author decided it
would be fun to capitalize on the allure of such a mystery. In an effort to motivate
and excite her mathematics students, she enlisted her husband (an avid mystery fan)
to help her create an enigmatic riddle for her number theory class. The result was a
mathematical scavenger hunt that had students searching for clues across the
Kenyon College campus and inside the surrounding village of Gambier, Ohio. Ulti-
mately, the trail of clues revealed a cipher that could be broken through RSA
cryptography, and in this way, students gained a meaningful hands-on experience
with the RSA encoding=decoding process.
Interestingly, we are certainly not the first married couple to create enigmatic
fun for others. Cryptanalysts William Friedman and his wife Elizebeth were known
to host inventive progressive dinner parties in which their guests, who were an inter-
esting mix of codebreakers, newspapermen, and scientists, were divided into teams
and sent on culinary scavenger hunts. While eating at one restaurant, they would
receive a clue from the restaurant’s owner concerning the next destination. Guests
would go to five or six restaurants throughout the course of the evening, and the first
team home would win a prize [2].
In this article, we present the number theoretic scavenger hunt to readers with
the hope that they too will be inspired to create enigmatic fun for their students.
While the mystery and clues presented here are specifically tailored to Kenyon
College, we believe that our approach can serve as a good starting point for others.

Address correspondence to Judy Holdener, Department of Mathematics, Kenyon college,


Gambier, Ohio, 43022, USA. E-mail: holdenerj@kenyon.edu

316
A Cryptographic Scavenger Hunt 317

The Mystery
At the beginning of class following their study of RSA cryptography, students in
Kenyon’s 2005 fall offering of Math 327: Number Theory Seminar received the
following message.

Number Theory students—we need your help!


Lord Ballyone, an initial benefactor of Kenyon College, was an egotistical
eccentric who tried to match the contributions of the other primary
donors to Bishop Chase’s cause, those with names such as Kenyon,
Gambier, Rosse, and Gaskin.1 Ballyone could not match the cash contri-
butions of his fellow Episcopalians living in the quiet English countryside,
but he supplemented his monetary donations with items from his rather
large estate, which he himself had inherited only a few years prior to the
good Bishop’s arrival in London. One of these items was a manuscript,
apparently a handwritten copy of a faded parchment that had been sal-
vaged after a monastery fire near the grounds of Lord Ballyone’s estate
several centuries before the Lord’s family had come to power. Since no
one could read the ancient writing, the manuscript had never before been
translated. Nary a soul understood the significance of the manuscript
when Lord Ballyone presented it to Philander Chase as he prepared for
his departure back to the wilderness of Ohio.
When Philander Chase was excluded from Kenyon’s power elite
shortly after the college had been established, the manuscript passed to
the college’s archives where it sat unnoticed for more than 50 years until
a frail, emeritus professor of the Classics happened upon the dusty tome.
She was shocked to find that the ancient language was nothing more than
a Latin translation of an ancient Greek dialect that had been dead for
several millennia. She translated the work into English but she died
immediately after she finished her task, slipping in the dark on an icy
Middle Path. After the poor professor’s body was carefully carried from
the scene of the tragedy, a passing student found the book and, not
knowing its provenance, he deposited it into the book return slot of
the old campus library. Whereupon, the book was shelved, then promptly
lost, as no one knew of its existence. Until now, that is.
A colleague of mine, a trained classicist and a mathematician,
uncovered the professor’s notes made at the time of her translation of
the manuscript into English. By carefully piecing together the bits and
fragments of notes and marginalia, my colleague has determined that
the original parchment was none other than a missing and heretofore
unknown volume of Euclid’s Elements. The importance of this work can-
not be understated, as there is some evidence from one particular scrawl-
ing in the margins of the professor’s notes that leads my colleague to
believe that Euclid may have determined a clever trick for factoring pro-
ducts of large primes, a trick that would undermine the security of the
Internet and throw the world of finance into chaos.
1
With funds from British benefactors (Lord Kenyon, Lord Gambier, Lady Rosse, and
Reverend Dr. Gaskin), Episcopal bishop Philander Chase founded Kenyon College in 1824.
[3] Kenyon is the oldest private college in Ohio.
318 J. A. Holdener and E. J. Holdener

You must help us find the long-lost book!


To safeguard the book and those who know of its existence, no single
person in the village knows of its exact location. Three ‘‘keepers’’ have
each been entrusted with fragments of encrypted clues as to where the
book may be found. To keep simple-minded hacks and thugs from stum-
bling upon the treasure, the identity of the three keepers has been kept
secret; even they do not know the names of their fellow keepers! You
must figure out the identities of the three keepers and seek them out.
They will pass along their encrypted fragments of clues to the book’s hid-
ing place. Find the book before any evildoer crosses your path and takes
the book for malicious purposes.

The Hunt
To meet the charge set out above, the class was broken up into two teams of five, and
each team was given a laptop computer equipped with the computer algebra system
Maple, which enabled them to decipher messages that had been enciphered using
RSA cryptography. In the week prior to the scavenger hunt, the students had gained
hands-on experience with the RSA encryption method, using a Maple program to
encipher and decipher ‘‘secret messages’’ for one another. Hence, they had not only
studied RSA encryption from a theoretical point of view; they were able to employ it.
(See the Appendix for the relevant Maple code.)
The students knew in advance that there would be a scavenger hunt on this
particular lesson, so they were prepared to trek across the campus and the surround-
ing area. After receiving the above scenario, each team was given their first clue2 and
they were off to stop the evildoers.

Clue #1: Ray Charles sang about having this person on his mind, but as
far as we know he never met the keeper of your first encrypted fragment
of a clue. You will find her in the hall of power—worth the price placed
on a king’s head.

Comments: The president of Kenyon College is Georgia Nugent, and her office is in
Ransom Hall. Hence, the keeper of the first clue was the president of the college.

Clue #2: Congratulations Team alpha! You have found the keeper of the
first encrypted fragment:

cipher text :¼ ½256827367782332982433298497633488614700

You will need to learn how to decipher this secret information. Keep
looking . . .
For your next clue find the keeper who works beneath the stars and
bars. In our little village this person need not worry about ‘‘rain nor
snow,’’ but the dark of the occasional power outage is a different matter.
2
Clue #1 for one team (team ‘‘alpha’’) was actually the third clue for the second team
(team ‘‘beta’’). The different ordering was meant to prevent the two teams from converging
at any one of the three keepers.
A Cryptographic Scavenger Hunt 319

Comments: Because of the many large old trees adorning the village of Gambier and the
Kenyon campus, power outages are a common occurrence. In this clue the students are
given the encrypted text and are told to go to the Gambier Post Office to seek out their
next clue. The Post Master, who is well known in the Kenyon community for his
friendly demeanor, was more than willing to comply. As the term ‘‘cipher text’’ implies,
the string of numbers revealed in the second clue is the message to be deciphered by the
students.

Clue #3: Very impressive. You are proving yourselves to be worthy reci-
pients of the second fragment of information. Although this information
is typically known to many, you have had to work for it!

[453838431999850498062034427355653905153, 81952655310075487163]

Whether you’re looking for the keeper of your next clue or looking for a
place to rest for the night, ‘‘check out’’ (or ‘‘check in’’ with) the person
behind the desk; you’re sure to get a nice reception.

Comments: The Kenyon Inn is the college’s hotel=restaurant in town. The third keeper
was the receptionist at the Inn. Having already encountered RSA cryptography, the
students would immediately recognize this pair of numbers as the ‘‘public key.’’ The
first number, m, is the modulus created by multiplying two large primes, p and q,
together, and the second number is a number, k, chosen to be relatively prime to
u(m) ¼ (p  1)(q  1). Admittedly, the value of m is smaller than what would typi-
cally be used in RSA cryptography. The smaller size of m was chosen to minimize the
chance of an error in transcription. Because the students received their clues in paper
form, they had to type the string of digits into the Maple file themselves.

Clue #4: Well Done! You are so close now. You need one more piece of
information, don’t you? Here it is:

½19669081321110693313

Hurry up . . . there are evildoers out there trying to thwart your efforts!

Comments: The number 19669081321110693313 is the final piece of information


needed to crack the cipher. As it turns out, this number is the value of one of the primes
defining the product m (say p). Knowing the value of p, it is then possible to find q,
u(m), and finally u ¼ k 1 (mod u(m)). While the private key is typically u, we
decided to provide the students with the value of p in an effort to introduce an additional
challenge into the scavenger hunt. The students were up for the challenge. Deciphering
the cipher text, they discovered the call number: QA 331 B85. A search in the library
then revealed Euclid’s missing volume. The volume turned out to be a secret box con-
taining candy and an invitation to dinner (for the team of students who found the book
first) (Figure 1).

The Outcome
The Number Theory seminar met for 75 minutes twice a week, and students were
given one 75-minute class period to complete the scavenger hunt. In the end, the
320 J. A. Holdener and E. J. Holdener

Figure 1. The ‘‘long-lost’’ book turned out to be a secret box. We glued the pages of a book
together and then cut a hole through them to create the box.

winning team completed the entire hunt in just 30 minutes, and the losing team fin-
ished in about 40 minutes. Therefore, in retrospect, we should have made the clues
more difficult. The timing was difficult to predict, however, and we erred on the safe
side because we were worried about those students who had another class immedi-
ately afterward.
Judging by the level of the student’s excitement, the scavenger hunt was a suc-
cess. After solving the trail of clues, each team returned immediately and enthusiasti-
cally to relay the glitches and glories encountered along the way. The winning team
admitted that they were not familiar with Ray Charles’ song ‘‘Georgia,’’ but this did
not slow them down much. They were able to crack the clue in minutes using a Web
search.
Perhaps the greatest pedagogical benefit of the event was that it motivated
students to become proficient with the RSA cryptosystem. Students enjoy a healthy
competition and if there is a prize to be had, they will work even harder. While exams
certainly play a similar role in the learning process (with the prize being a high
grade), we argue that a scavenger hunt is much more fun. And why not have a little
fun in class? There is no reason why mathematics can’t be more captivating for the
masses.

Appendix:
Maple Code for RSA Encryption and Description
What follows is the Maple code that was made available to the students. The
notation used in this code is consistent with that used in the textbook of the course:
A Friendly Introduction to Number Theory by Joseph Silverman [4].
The Encoding Process
Step 1: RSA Set-up
First we find two large primes p and q:
A Cryptographic Scavenger Hunt 321

> N :¼ randð10 ^ 50ÞðÞ;


M :¼ randð10 ^ 50ÞðÞ;
N :¼ 81321110693270343633073697474256143563558458718976
M :¼ 38032062222085722974121768604305613921745580037409
> p :¼ nextprimeðNÞ;
q :¼ nextprimeðMÞ;
p :¼ 81321110693270343633073697474256143563558458719093
q :¼ 38032062222085722974121768604305613921745580037501:
Next, define m ¼ pq and find an ‘‘encrypting number’’ k relatively prime to /(m).
Since k will be made public, there is no real need for random generation. However,
a random choice for k often works, so we take this route. (See the ‘‘Note’’ below.)
> m :¼ p  q;
m :¼ 30928095418555783531878930932444448027821660859645964593593930414
4418n72748220538228204722440119364706593
> phi :¼ ðp  1Þ  ðq  1Þ;
/ :¼ 30928095418555783531878930932444448027821660859644742407574990858n
0614102507214964954815325950000
> k :¼ randð10 ^ 50ÞðÞ;
k: ¼ 13074813656220643842443844131905754565672075358391
[Note: If by chance the modular inverse doesn’t exist, then try again. That is, put the
cursor back on the line where k was computed and hit return. After a few tries you
will obtain a suitable value of k.]
Now define u to be the inverse of k modulo u(m).
> u :¼ 1=k mod phi;
u :¼ 15843542980625201334874233671987882309161543017339692062103786768n
08802323849360235518721880593474711
Check that ku mod /ðmÞ ¼ 1.
> k  u mod phi;
So the public key is
> Public Key :¼ ½m; k;
Public Key :¼ [30928095418555783531878930932444448027821660859645935939n
30414441872748220538228204722440119364706593.
13074813656220643842443844131905754565672075358391]
and the private key is
> Private Key :¼ ½p; q; u; phi;
Private Key :¼ [81321110693270343633073697474256143563558458719093, 380320
62222085722974121768604305613921745580037501, 158435429806252n013348
74233671987882309161543017339692062103786768088023238493602n3551872
1880593474711, 309280954185557835318789309324444480278216608n5964474
240757499085806141025072149642964954815325950000].
Step 2: Create the cipher text
Define our text message first.
> plain text :¼ ‘‘The falcon flies at midnight. The falcon flies at mid-
night. The falcon flies at midnight.’’;
plain text :¼
‘‘The falcon flies at midnight. The falcon flies at midnight. The falcon flies
at midnight.’’
Then convert ‘‘plain text’’ into a list of integers. Maple’s convert(expr, bytes) com-
mand converts between a Maple string expr and a list of integers giving the byte
values of the characters within the string.
322 J. A. Holdener and E. J. Holdener

> encipher1 :¼ convertðplain text; bytesÞ;


encipher 1 :¼ [84, 104, 101, 32, 102, 97, 108, 99, 111, 110, 32, 102, 108, 105, 101, 115,
32, 97, 116, 32, 109, 105, 100, 110, 105, 103, 104, 116, 46, 3, 84, 104, 101, 32, 102,
97, 108, 99, 111, 110, 32, 102, 108, 105, 101, 115, 32, 97, 116, 32, 109, 105, 100,
110, 105, 103, 104, 116, 46, 32, 84, 104, 101, 32, 102, 97, 108, 99, 111, 110, 32,
102, 108, 105, 101, 115, 32, 97, 116, 32, 109, 105, 100, 110, 105, 103, 104, 116, 46].
Now break the list of numbers into blocks B1, B2, B3, . . . Bn having length no greater
than m. (Note: Maple’s convert(l, base, alpha, beta) command converts the list of
digits l in base alpha to base beta. The list of digits is interpreted as the number
sumðl½k  alpha ^ ðk  1Þ; k ¼ 1::nopsðlÞÞ:Þ
> encipher2 :¼ convertðencipher1; base; 256; mÞ;
encipher2 :¼ [2127617021082708238816713515045828021813682535207890290446=
101958645179476426263122615148071950713418, 18438685512639506519080=
9972830219380208901603065018971613381202154341251205876350185539=79
3578718731, 408733677834719]
Next, define an ‘‘encoder’’ function, encoder(x, k, m) ¼ xk mod m. Maple’s Power(x,
k) command makes this easy.
> encoder :¼ ðx; k; mÞ > Powerðx; kÞ mod m;
f :¼ ðx; k; mÞ ! Powerðx; kÞmod m
Finally, create the cipher text by applying the encoder function to List2:
> cipher text :¼ map ðencoder; encipher2; k; mÞ;
cipher text :¼ [279214749374818575890363510821542456146949709665680127052=
2447880592608324959982006113669641544710431, 117565624302992533244=
10684760831049090715930590777570454824464314462093767463038528121=
6364835026348, 3365981373179792927357643510237826766597515469926042=
2944104142090425183979331729167060777887242132].
The Decoding Process
To decipher the cipher text, define a decoder function that reverses the encoding pro-
cess, and apply the function to the cipher text.
> decoder :¼ ðx; u; mÞ> Power ðx; uÞ mod m;
decoder :¼ ðx; u; mÞ ! Power ðx; uÞ mod m
> decipher1 :¼ mapðdecoder; cipher text; u; mÞ;
decipher1 :¼[2127617021082708238816713515045828021813682535207890290446=
101958645179476426263122615148071950713418, 18438685512639506519080=
99728302193802089016032065018971613381202154341251205876350185539=
793578718731, 408733677834719]
Then use the convert command to recover the blocks B1, B2, B3, . . . Bn.
> decipher2 :¼ convertðdecipher1; base; m; 256Þ;
decipher2 :¼[84, 104, 101, 32, 102, 97, 108, 99, 111, 110, 32, 102, 108, 105, 101, 115,
32, 97, 116, 32, 109, 105, 100, 110, 105, 103, 104, 116, 46, 32, 84, 104, 101, 32,
102, 97, 108, 99, 111, 110, 32, 102, 108, 105, 101, 115, 32, 97, 116, 32, 109, 105,
100, 110, 105, 103, 104, 116, 46, 32, 84, 104, 101, 32, 102, 97, 108, 99, 111, 110, 32,
102, 108, 105, 101, 115, 32, 97, 116, 32, 109, 105, 100, 110, 105, 103, 104, 116, 46]
Finally, convert the list of integers back into plain text to recover the original
message.
> decipher3 :¼ convertðdecipher2; bytesÞ;
decipher3 :¼
‘‘The falcon flies at midnight. The falcon flies at midnight. The falcon flies at
midnight.’’
A Cryptographic Scavenger Hunt 323

About the Authors


Judy Holdener is an Associate Professor in the Department of Mathematics at
Kenyon College. She earned her Ph.D. at the University of Illinois–Urbana in
1994. She spent three years teaching at the United States Air Force Academy
(1994–1997) and one year as a visiting professor at the University of Colorado in
Boulder (2004–2005). Judy’s research interests include algebra and number theory,
and she enjoys getting undergraduates involved in mathematical research. Her lei-
sure interests include gardening, hiking, exercise, and art, but she spends most of
her time trying to keep up with her two redheaded boys.
Eric Holdener earned his Ph.D. in geology (paleontology) at the University of
Illinois–Urbana in 1997 and is a Visiting Assistant Professor at Kenyon College.
He teaches the college’s geology offerings from his base in the Department of Physics
and through various other departments and programs (e.g., biology, environmental
studies). His other educational experiences include positions at the University
of Illinois Museum of Natural History and the Western Museum of Mining and
Industry in Colorado Springs, Colorado. He loves to cook and bake, especially
ethnic foods (pizza), and he enjoys the fruits of his efforts while drinking his own
homebrewed beer.

References
1. Brown, D. 2003. The Da Vinci Code. New York: Doubleday.
2. Codebreakers. 1994. NOVA Television Series. PBS Videocassette.
3. Forgotten Moments in Kenyon History. 1999. R. Oden. Videocassette in the Kenyon
archives.
4. Silverman, J. H. 2006. A Friendly Introduction to Number Theory, 3rd ed. Upper Saddle
River, NJ: Pearson Prentice Hall.

You might also like