At-home STEM Activities: Using Cryptography to Make a DIY Escape Room

For centuries, spies, armies, and diplomats have used codes to transmit secret messages. In the present day, with so much of our data stored on computers, encryption of information has become even more important. Cryptography is the study of writing and breaking codes. Modern cryptography draws from mathematics and computer science to create more security.

In cryptography, a cipher is an algorithm, or method, used to encode and decode messages. There are many types of historical ciphers:

Caesar Cipher

One of the simplest and most widely used types of ciphers is the Caesar Cipher. It’s named after Julius Caesar, who used this encryption method in his correspondence. The Caesar Cipher is a substitution cipher, which means that each letter in a message is replaced by another letter that is a fixed number of places away in the alphabet.

So if two people decided to use a Caesar Cipher with a shift of 5, then this is the substitution they’re using:

Suppose the message we want to pass along is “MEET AT MSDC AT NINE O’CLOCK.” Then to encrypt this message, we shift all the letters forward by five places (go from the top row to the bottom in the table above). So it becomes “RJJY FY RXIH FY SNSJ T’HQTHP.” To decrypt the message, we shift every back by five places (go from the bottom row to the top in the table above).

Keyed Caesar Cipher

As a variation to the Caesar Cipher, we can add a key word. This adds another level of security by making the encryption process a little more complex. For a Keyed Caesar Cipher, the first step is picking a key word—the word shouldn’t have any repeated letters, and the longer the word, the more secure. We place the key word at the beginning of the alphabet and then shift the remaining letters. So if our key word is “gravity,” then our Keyed Caesar Cipher will be:

So encrypting the message “MEET AT MSDC AT NINE O’CLOCK” gives us “HIIP GP HOVA GP JCJI K’AFKAE.” To decrypt this message, we use the table above.

Atbash Cipher

The Atbash Cipher is a substitution cipher that was originally used with the Hebrew alphabet. It maps the alphabet to itself in the opposite direction, so A to Z, B to Y, C to X, etc. Since the coding process is not very complicated, this is not the strongest encryption method.

So encrypting the message “MEET AT MSDC AT NINE O’CLOCK” gives us “NVVG ZG BHWX ZG MRMW L’XOLXP.” To decrypt the message, just reverse the substitution.

Book Cipher

A Book Cipher relates numbers to a specified text. Often, it will take the form of a series of three numbers that represent a page number of a book, a line number on that page, and a word number in that line. For a Book Cipher to be successful, both the message sender and receiver need to have the same edition of a book.

Book Ciphers are frequently used in fiction. One example is the movie National Treasure, where Nicolas Cage’s character finds a Book Cipher, referred to as a Ottendorf Cipher, on the back of the Declaration of Independence. Book Ciphers have also been used in the real world. In the American Revolution, Benedict Arnold used a Book Cipher to correspond with the British.

Public Key Encryption
This section talks about some higher mathematics that is more geared towards older learners. Click here to skip this section and jump down to the activity.

The previous ciphers we discussed are symmetric keys—that is, they use the same key to encode and decode messages. These ciphers often rely on the message sender and receiver to meet to exchange keys. But what is the two parties can’t meet? Or what if the sender has to get there message to many different people? This is where public key encryption comes in.

Public key encryption is a method of encoding data that uses different keys for encryption and decryption. In a public key system, the encoding key is freely distributed, while the decoding key is kept a secret. Then, if someone who isn’t supposed to have it receives the encoded message, they have no way of figuring out what it says. This means that it’s easy to encode a message, but difficult to decode it without the secret key.

This almost sounds too good to be true—a function simple in one direction and hard in the other. But in the 1970s, mathematicians figured out a way of using prime numbers to create such a function.

A prime number is a number greater than one that cannot be formed by two smaller numbers multiplied together. For instance, 15 can be written as 3 x 5, but 3 and 5 can’t be written as the product of smaller numbers. So 3 and 5 are prime, while 15 is composite (a number that isn’t prime). There are an infinite number of prime numbers, and every number that is composite, can be written as a unique (up to order) product of prime numbers. For example, here are all the numbers that divide 30: 1, 2, 3, 5, 6, 10, 15, 30. Of those that are prime, we have 2, 3, and 5. Let’s multiply those together: 2 x 3 x 5 = 30. So the unique product of primes for 30 is 2 x 3 x 5.

We call 2, 3, and 5 the prime factorization of 30. Finding the prime factorization for a relatively small number like 30 doesn’t take much time. If we were asked to find the prime factorization for a bigger number, like 572, we could do that, but it would take a bit more time. Now if we were asked to find the prime factorization for a really big number, say 936,103,049, we would probably say, “No way!” and let a computer factor that.

Computers can process big numbers much faster than people can, but it still takes them some time. The below animation compares how long it takes a computer to multiply (shown in red) and factor (shown in blue) numbers as the size of the inputted number grows.

As you can see, the amount of time needed for a computer to factor large numbers gets really big really fast. In 1977, MIT mathematicians Rivest, Shamir and Adleman developed a public key encryption method, known as RSA Encryption, that uses this fact. In RSA Encryption, two prime numbers—call them p and q—are multiplied together to form a third number—call this number N. N is part of the public key and used for encrypting messages, but to decrypt a message, one needs to know p and q. If p and q are large enough, N will be really big and could take years to factor, even with the most powerful computers.

RSA Encryption is how most of our data is encoded today. To learn more about this encryption system, watch the videos below. RSA Encryption depends on modular arithmetic, so if you haven’t encountered that before, click through the images below the videos for a quick walk-through of the operation and some theorems for it.


DIY Escape Room

Now that we know a few different ciphers, let’s use them to make an escape room! The point of an escape room is to create a series of puzzles that someone needs to solve to get out of a room. In our example below, we’ll provide a series of clues that will guide someone to find the code for a lock on the door.

In the escape room you create, use whatever materials you have available! If you have a spare padlock instead of a combination lock, leave clues that will lead someone to find the lock’s key. If you don’t have any locks to use, maybe the final clue gives directions for how to leave the room—like “to escape, you must hop on one leg, clap your hands, and hum “Hot Crossed Buns.”

Example Escape Room

Materials:

  • Paper and pens, pencils, markers, colored pencils, etc. (to write your clues)

  • Combination lock

  • A room

Here’s what we did for our example:

Now it’s your turn—create your own escape room and share your creative uses of cryptography with us on Facebook, Instagram, and Twitter!

Michael Conway

I’m the owner of Means-of-Production. an online marketing agency for architects, interior designers, landscape, and design-build firms. I’m committed to building sites that grow website visits, lead conversion, and sales through content marketing and website design.

https://means-of-production.com/
Previous
Previous

Virtual Celebration: Hubble Telescope's 30th Anniversary

Next
Next

At-Home STEM Activities: Make Your Own Sundial