Raise your hand if you love encrypted messages. Actually, you don’t need to raise your hand. Everyone with a heart beating in their chest (and likely some robots who do not have a heart beating in their chest) loves the idea of receiving or sending a secret message knowing no one except the recipient can read its contents, preferably under the blankets, after bedtime, with a flashlight.
It’s that love from childhood that powered Alan Turing as he invented the Turing machine that not only helped the Allies win World War II but served as the concept for the first general use computer. And it’s that love that drove Justin Troutman to invent PocketBlock, a tool to teach computer encryption to kids; specifically, to explain his job to his own kids.
The first exercise is Pockenacci, which teaches kids how to hide messages so they can only be decoded by another person who has the secret password. More specifically, it’s a block cipher built to teach SPN (Substitution-Permutation Network). Anyone can see the scrambled message, but only the person who has the key can unlock it. Just like encrypted messages on the computer.
I tried this exercise in our computer club with kids ranging in age from 8 to 12, and all of them loved it. Some came into the exercise knowing Fibonacci numbers, a key idea in the exercise, and others learned it on the fly when we got started on the first step. They built a unique key based on any six letter word (Troutman’s exercise uses the word secret). They expanded it into a 36-character block, discarding the original secret word, and then they encoded a 36-letter message.
Don’t worry—Troutman also explains what to do if the message is shorter or longer than 36 letters.
The exercise (that can be downloaded from GitHub or used on the site) is well-written and straightforward, so some of the kids in the group bounced ahead, working their way through all the steps on their own. Most of the younger kids needed a little hand-holding from step-to-step, but probably could have worked on their own if they didn’t know help was available. All in all, we got dozens of messages hidden and sent, and kids (at least the ones who knew the key) could decode them on the other end.
It’s not only a great way to teach a computer science concept to a kid, but you can buy yourself an extra hour of sleep next weekend by leaving your child an encrypted message, a key, and instructions for Pockenacci at the kitchen table. Tell them to unscramble it before they wake you up.
Make the message worthwhile and the first step in an extended treasure hunt and you may even be able to buy yourself extra sleep straight through winter break as they decode messages AND learn valuable computer science concepts.