Another widget from code.org takes you on the route to encrypting messages. If you’re going to send a message, you need to do something a little sophisticated than what we did in elementary school which, if I recall, was as simple as moving each character in the message one ahead. So, DOUG becomes EPVH. Then, you’d pass the note along to a friend who would roll the characters back one to get the original message. And, you’d also have rules like what to do when you use a Z or punctuation mark.
You’d be hard pressed to decrypt my message of the day. “FBFVXGYXCFWOHAWKCEHINF”, I’ll bet. But if you use the Vigenere Cipher Widget, it’s a piece of cake.
You need to provide a couple of things.
- your message
- your secret key
Then, let the widget do its thing.
Using your secret key, it will take the original message and code it for you.
When you press the play button to make the magic happen, you can see the widget at work as it determines how to encrypt your message.
Of course, the process can work in reverse as you take your encrypted message and decrypt it.
Falling from this could be a great discussion about how you do banking and make online purchases safely. Or even something as simple as sending an encrypted message to someone that they would later decrypt and read. Of course, you don’t send the key and the text in the same message.
The best thing to happen?
After poking around for a little while, the inspired Computer Science student will want to write a routine of their own. That always puts activities like this over the top.