
Modifying the package.json file with new scripts.HTML and CSS was supplied with starter code.

The cool thing about this type of cipher, especially if you use it as an activity in a math class, is that you can challenge your students to think of ways to make this type of cipher harder to crack.This project was designed to test the ability to build tricky algorithms in JavaScript as well as write unit tests with Mocha & Chai. You may have noticed, even in the short message I began the blog with that the number 15 occurred quite a lot, signifying to anyone familiar with our alphabet (or a huge fan of Wheel of Fortune), that it likely represents a letter that occurs often in English (like an E, S, or T). Though it may seem difficult at first, messages encoded using a Polybius square cipher are not very secure.
#Polybius square 4x5 code#
In fact, the Polybius square was even used as an easier-to-learn tapping type of code employed by American soldiers imprisoned during the Vietnam War. He likely envisioned holding up lighted torches to signal messages, sort of like an early version of Morse code. For us, we have choices: we can combine two letters that are easily determined by context in a word (like I've done by assigning both i and j to 24) or we could create a larger square (6圆 would offer us a few extra spots for punctuation and a space) or we could create a rectangular cipher.Īn interesting historical note is that Polybius probably did not construct his grid for the purpose of hiding secrets but rather to aid in long distance communication via telegraphy. In case you're wondering, he only needed a 5x5 grid because there are only 24 letters in the Greek alphabet (which left a grid location for either a space or a type of punctuation like a period). It is nice to be able to tell students that just like Rene Descartes decided we would write the x-coordinate first, then the y-coordinate when we give a point's location on a graph, Polybius decided that his cipher would work by substituting each letter by the number of the row followed by the number of the column for its location in the grid. Just like graphing in algebra class, for everyone to get the same answer, we must all agree on the order we will use to designate each letter: (row, column) is not the same as (column, row). The Polybius square works similar to the way a Cartesian coordinate system does: the two-digit number for each letter is given by the row number followed by the column number. I love these types of ciphers because they offer a fun way for students to practice both substitution (a core concept in algebra) and coordinate pairs (another core concept in algebra). It is a type of substitution cipher because letters in the original message are substituted for something else (in this case, two-digit numbers).

This particular kind of square grid was first used by an ancient Greek historian and scholar named Polybius and thus it gets its name, a Polybius square. You probably noticed it is a 5x5 square and that each letter in the alphabet corresponds to a two-digit code: for example, the letter D corresponds to 14 and the letter P corresponds to 35. It's a particular kind of grid used for encoding and decoding secret messages (ciphers). In today's blog, I talk about how we can build on that human tendency and create a wonderfully rich mathematics lesson that encompasses cryptography (the study of secure communication, including secret codes & ciphers), history, and algebra.įirst, let's talk about the graphic above. I have a vivid memory as a child of writing some secret message and hiding it inside the elephant statue / side table in the living room (the hollow leg made a great hiding place!) - what's funny is years later, when we moved, the secret message was still in there! There's something innately human about our desire to keep and share secrets. Yes! That's right, the secret message is, " I love secret codes!" It's true, I do. Ok, here's a hint: the graphic above is the key.
