In this activity, you will learn about encoding and decoding, two important concepts in computer science. You will test your understanding with STEM challenge that requires you making a cipher wheel and then encoding/decoding messages.
You will need:
Cipher wheel
Pen or pencil
Scissors
Before we begin, let's review some basic information about computer programming.
In this activity, you're going to learn how to make a cipher, but first, it's important that you learn about what encoding and decoding mean.
Encoding and decoding are used in data communications and storage. In normal conversation, encoding and decoding are often used interchangeably with encrypting and decrypting. In computer science, they are slightly different
Encoding refers to "the process of putting a sequence of characters such as letters, numbers and other special characters into a specialized format for efficient transmission."
For example, consider image file formats (JPEG, PNG, PPM, etc.). All of these are different encodings of the same file, the same picture. Each file format takes the pixel information (usually as RGB values) and converts each red, green, blue value into a number which is stored in the file. How it stores the numbers is the process of encoding. Basically, computers can take an image, which seems complicated to store, and it encodes the color values as numbers (more specifically, binary), which it then stores in a file. This allows the computer to efficiently store the image in a format understandable to the computer. Computer languages are built on binary (zeros and ones)—they communicate and process things using numbers. We can think of encoding as converting things like images, text messages, PowerPoints, etc. into number formats that can be easily understood by computers.
Decoding is the reverse of the above process. It takes the encoded format and converts it back into the original. In other words, this would be like a computer taking a string of numbers or binary and converting that into a picture or a string of words.
Encryption is the process of converting a meaningful message into meaningless text.
For example, think of secret messages and secret codes. You may want to write a message to your friend or crush in class, but you are afraid the teacher or a classmate might see the note and try to read it. You can encrypt the message using some rule or pattern. One of the easiest ways to do this is to convert each letter into its corresponding position in the alphabet, so A = 1, B = 2, C = 3, ..., Z = 26. Now if somebody looks at the secret message, they cannot figure it out just by reading it!
While sometimes a secret rule is applied to the encryption process, sometimes a secret key is used instead. This key could be a word or phrase. Without knowing the secret key, decrypting the secret message would be virtually impossible (note that this depends on the length of the key; longer keys will be harder to randomly guess). It's important to note that the secret key is NOT the secret message. The key is a tool used to help when we convert the meaningful text into what looks like random characters.
Decryption is the reverse of the above process (i.e., decryption is converting the meaningless text into a meaningful message). In the above example, this would be applying the encryption rule in reverse, so 1 = A, 2 = B, 3 = C, ..., 26 = Z. In other examples, having the correct secret key is crucial to properly decoding the random characters into the original message.
The primary difference between encryption/decryption and encoding/decoding is security. Both have similar processes of taking something, like a text message, image, or string of characters, and converting it into something else. In the case of encoding/decoding, the end result is something easily processed by a computer. In the case of encrypting/decrypting, the end result is making something more secure and safe (i.e., less likely to be hacked, stolen, etc.).
Say you want to pass a note to your friend in the class, but you don’t want the teacher to see the contents of the note. We can write it in a secret code! A super easy code that anybody can do is simply replacing every number by it’s numerical position in the alphabet. There are 26 letters in the alphabet. Since A is the first letter in the alphabet, it would have a value of 1. Since Z is the last letter of the alphabet, it would have a value of 26.
Cut out your cipher wheels. Color the wheels different shades and assemble by putting the smaller wheel on top of the larger wheel and securing the two with a metal brad.
Write the letters A-Z on the outer wheel.
Write the numbers 1-26 on the inner wheel.
Line the wheels up so that A aligns with the number 1, and then the letters and numbers match sequentially (B=2, C=3...)
Now, try working through these problems. You should have also received a worksheet to work on if you would prefer to use that.
PROBLEM 1: 20-8-9-19 9-19 19-15 3-15-15-12
PROBLEM 2: 3-1-5-19-1-18 3-9-16-8-5-18
PROBLEM 3: 5-14-3-15-4-9-14-7 1-14-4 4-5-3-15-4-9-14-7
PROBLEM 4: Try “encoding” your name! Write your name down below, leaving enough space for the numbers. Use your cipher wheel to figure out which numbers replace the letters in your name.
Your parent or guardian will have received an answer sheet in their email, so make sure to check your answers with them. Can't find your answer key? Email tceoutreach@utk.edu and we will check your work for you!
Try decoding this message: 16-15-6 21-24-16 21-9-19-6-6 7-16-22-19 7-10-23-6
Did you get it? If not, write down what you think happened.
Not all ciphers are straightforward cases where A=1, B=2 and so on. Sometimes, there's a shift where the inner wheel has been shifted so that numbers up with a completely different letter of the alphabet. That means all subsequent letter-number combinations are also shifted, which means that the cipher you used for the last activity no longer works.
Take a few minutes to shift your wheels around and determine what the new cipher is. Then, decode the following problems:
PROBLEM 1: 20-9-6 20-6-13-13-20 20-6-2-20-9-6-13-13-20 3-26 21-9-6 21-2-4-16-3-6-13-13
PROBLEM 2: 22-7-24 3-8-3 19-7-4 2-7-8-2-10-4-13 2-17-14-18-18 19-7-4 17-14-26-3? 19-14 6-4-19 19-14 19-7-4 14-19-7-4-17 18-8-3-4!
The following questions have yet another new cipher. Time to find it and then figure out what the answer is!
PROBLEM 4: 13-9-11-16 20-13-2-2-13-26 5-9-1 1-16-17-14-2-13-12 2-23 2-16-13 26-17-15-16-2 13-17-15-16-2
PROBLEM 5: 8-12-4 5-19-20-4 26-25-16 15-20-17-17-20-14-6-23-5?
PROBLEM 6: 9-21-20-13-24-7-26-1-18-7-26-15-21-20-25! 5-21-1 12-15-20-15-25-14-11-10 7-18-18 26-14-11 3-21-24-17-25-14-11-11-26-25!
Your parent or guardian will have received an answer sheet in their email, so make sure to check your answers with them. Can't find your answer key? Email tceoutreach@utk.edu and we will check your work for you!
No more problems to do! Instead, we want you to create your own code using the A-Z, 1-26 cipher that you've experiment with here.
Then, see if you can get your family, friends, or anyone you know to decode your message!
When you're done, submit your code as your product for this challenge and the TCE Outreach Team will try to decode it!
What is the importance of encoding/decoding knowledge in computer science? After graduation, a computer science student can work in many positions: software engineer, software developer (think iOS, Windows, Android, etc.), data science, etc. Let's say you studied computer science and now work at Apple as a software engineer. You might work on the text messaging software (the code) for iPhones and other Apple products. Encoding and decoding is fundamentally about data transmission (sharing files, text, and other information). Everything from sharing a video to sharing a song link through text has to undergo some form of encoding and decoding to efficiently send. Additionally, you will also need to know a lot about encryption and decryption in this role. Did you know that iOS text messages are encrypted and decrypted? This is to prevent hackers or other people from seeing your texts and it helps keep your information safe.
Having secure, confidential personal data is incredibly important. Can you imagine if your bank account was hacked because we did not encrypt usernames/passwords?
Overall, if you decide to work in the computer field in the future, you will definitely encounter problems or tasks that have to do with encoding/decoding or encryption/decryption. Encoding/decoding is more commonly used with newer technologies. Encryption/decryption is applied anywhere personal information is accessed or requested.