Why Do People Need Secret Codes?
Imagine you have a secret you want to tell your best friend, but nobody else. Perhaps last night you discovered you could fly. If everyone found out they would ask you lots of boring questions like, “What does my house look like from the sky?”, and your Dad would want your help cleaning out the gutters of the house. Yuk. Stuff like that.If you were alone with your best friend in the same room then sharing the secret would be easy to do, but if he or she was somewhere else, or you were not alone, that would be more tricky. Somehow you would need to send the secret to that person in a way that only they could understand it. How could you do that?
You could make up your own special language that only the two of you could understand, but creating a brand new language would be very hard work and would take up a lot of time and practice; years probably. All that effort just in case one day you need to share a secret. That’s quite extreme.
How Secret Codes Work
A simpler way would be to use your normal language, but wrap up the message in a secret code. That would be a bit like sending a letter in a locked envelope. If you gave your best friend, and only your best friend, the key to unlock the envelope before you sent the message, then only he or she would be able to open it and know its true meaning. This is how all secret codes work.I’m going to teach you a few new words. A secret code can also be called a cipher. Its pronounced ‘si-fer’. The original message in your language is called the plaintext. The message written in secret code is called the ciphertext. The act of turning a message into the coded message is called encryption; you encrypt the message. The act of turning the coded message back into the normal message is called decryption; you decrypt the coded message. The exact way encryption and decryption works is called the key for that particular code.
An Example: The Caesar Cipher
The best way to explain how this works is to show you. Let’s use a real secret code that was used a long time ago. It’s called the Caesar cipher, and is named after the famous Roman general, Julius Caesar, who used this way of encrypting his important letters, such as commands to his soldiers on the battlefield, so that his enemy wouldn’t understand them if they found them.Let’s imagine that you want to send your friend the message “I can fly.”. The way this particular cipher works is that it swaps each letter in the message to a different letter in the alphabet to make it look like nonsense. The Caesar cipher transforms each letter into the letter 3 places further up the alphabet. They key to this code is +3. Other types of cipher transform letters in different ways to do the same thing. Our plaintext message is icanfly when written with no spaces inbetween. Now let’s encrypt the message. The table below shows how that transformation works for each letter of the alphabet using the Caesar cipher:
After encryption the message reads “MFDQIOB”. That doesn’t mean anything to most people, does it? But to your friend, who knows what you have done, it does. When they receive the message they know they need to do the opposite transformation to be able to read it. In this case, they will need to change each letter in the ciphertext to the letter 3 places before it in the alphabet and then put the gaps back in sensible places so that the message makes sense:
So your friend will turn MFDQIOB into icanfly and then understand that you have cracked the ability to fly.
There are lots of ways of turning plaintext into ciphertext and back again. The history of secret codes is interesting on its own, but one of the most wonderful things about it is that nearly 80 years ago some British people who were trying to break some secret codes that they didn’t have the keys for created the World’s first computers to help them. I’ll tell you more about that in my next blog post.
EBHEBH
If you would like to listen to this post then click play on the audioboom widget below:
0 comments: