Learn how to use a linear function to encrypt the characters in a language enabling you to write secret messages. See how to decode the messages by using the inverse function or through reversing the encryption process on the original character set. This method is a type of affine cypher, the details of which can be found in Wikipedia.
We also step through the creation of a computer program to automate the encryption and decoding process. The example code is in Snap (similar to Scratch) and is appropriate for middle school or advanced fifth graders who have a little exposure to programming.
The math practiced in this activity includes linear functions, prime numbers, coprime numbers, and modular arithmetic. A suggestion as to how to use the activity in the classroom is given at the end of the discussion.