Tuesday, March 23, 2010

Teaching Cryptography to 5th Graders

My kids attend the Krieger Schechter Day School. Today, they are having a learning festival where professionals from many different fields are teaching classes in their areas of expertise. The topics include, Drama, Animal Communication, Art, Conflict Resolution, Israeli Dance, Sports Signals, Hieroglyphics, Sign Language, Media, Electric Circuits and Morse Code, Woodshop and many others. I'm teaching a unit called Codes and Ciphers.

Designing the class proved to be more challenging than I initially realized. These are very smart kids, but they are only 11 years old, and so one time pads, modular exponentiation, and Diffie Helman key exchange are off limits. I decided that the best approach is to give them something hands on to do. I teach in a few hours, and I'll post something afterwards about how it went. Here is the lesson plan.

First, I'm going to talk a bit about basic codes. I'll describe "One if by Land, Two if by Sea". Although that code was not designed for confidentiality, it was nonetheless a code. Next, I'll move into Caesar ciphers and general substitution ciphers. Then, I'll divide the class into 4 groups of four students, as I was told there will be 16 students in the class.

Elana (my 5th grade daughter) and I prepared cipher wheels out of paper plates. Each wheel consists of an inner and an outer paper plate. The inner plate was cut so that it is a few inches smaller in diameter than the outer one, and a tack was placed in the middle of the two plates so that they can spin independently of each other. We filled in the inner plates with the letters of the alphabet around the perimeter. The groups in the class will each fill in the outer plates with letters, lined up with the letters on the inner plate, to produce a substitution cipher. At the same time, they will generate a message of several sentences and encode it with the cipher.

Each group will receive an encoded message from the another group, and they will use letter frequency and other clues to try to decipher it and to reveal as much as they can about the cipher from the other group.

In the remaining time, I will show them how they can build an increasingly sophisticated cipher by turning the wheel after each letter is encrypted by a fixed amount and then by a variable amount. I'll show them how decryption would work by running an example with one of the cipher wheels and encrypting/decrypting a simple sentence on the blackboard.

Next, I will show them how to combine three cipher wheels and rotations via a key to obtain a cipher similar to the Enigma Machine, and I will talk about the role of the Enigma in WWII, and how it was ultimately broken, as well as the importance of capturing a device.

Finally, I will explain the intuition behind modern ciphers that use a key, and I hope that I can get them to appreciate Kerckhoff's Principle that the algorithms can be made public, and that all of the security of a cipher system needs to lie in the key.

So, it's an ambitious undertaking, but I hope I can get through all of this and give the students an appreciation for the beauty and complexity of Cryptography while showing them a good time and not overwhelming them.