Encryption - Lakelands Computing

Title
Go to content
Encryption
Encryption is the process of encoding data or a message. Once it has been encoded it can not be understood by anyone other than the person it is sent to. Encrypted data has to be decrypted to be understood - basically it need to be unencoded.

Note: Encryption does not prevent someone from intercepting a message - it prevents them from being able to understand it. (People get this wrong all the time on the exams, so make sure you have it completely clear.)

Unencrypted messages are called plaintext messages. Encrypted messages are called ciphertext.

Encryption means data can be stored and transmitted safely and securely. It plays a really important role, for example without it online shopping would not be possible due to everyone being able to collect and read everyone elses credit card details.
Encoding means changing the characters (letter, numbers, symbols etc) that make up a message or a file, into other characters. It makes the ciphertext look like completely random nonsense, but it isn't. To encode a message you follow a set of steps, an algorithm. We will look at a simple one - the Caeasar Cyper - below to help make this clearer.

Decoding, ( or decrypting) means to do all the steps backward, to get back to the orignal text. To decrypt a message you need to know the key - the steps you have to follow. ( see below)

Letters as numbers
The idea of using numbers to represent letters is a key concept for encryption. Once a letter has a number equivalent you can use mathematical formulae to  make it harder to figure out what the original letter was.
The Caesar Cipher, or shift cipher was used by Julius Caesar hence the name. It is once of the simplest ways to encode data. It is too well known and too simple to be secure anymore but it helps you understand how encryption works, and it may come up on a GCSE exam.

This Method replaces each letter in the plaintext by a letter some fixed number of positions down the alphabet:

So lets encode the word "Hello" with a +4 Caesar Cipher, or a right 4.  This means we will decode with the opposite a -4 or a left 4. To encode we simply move four letters to the right in the alphabet, so for H, 1 would be I, 2 gives us J, 3 gives us K and 4 gives us L:
Decoding
Cipher text
lipps
Number Equivalent
129161619
-4 (opposite +4)
85121215
plain text
hello
Encoding
Plain Text
hello
Number Equivalent
85121215

+4

129161619
Ciphertext
lipps
Note : If the word had been "buzz":
Z = 26, 26+4 = 30, but there are not 30 letters,  so we "wrap around" and use the 4th letter instead, so "buzz" would become "fydd".

If you want to practice with this, there are a few interactive questions here

Public and private keys
Encryption becomes useless if unauthorised users know the decryption keys, the steps to encrypt / decrypt the data.  But how do you share the encyrption keys safely.

The solution is to use what is called asymmetric encryption. This uses different  keys for encryption and decryption, allowing computers over the Internet to securely communicate with each other.  Only the key to encrypt is sent out, made public. The one to decrypt is kept safe, kept private.

You might be thinking but can't you work out the decryption steps from the encryption ones. Short answer no, it will take far far too long to be off any use. It relies on the idea of one way functions, things that are really easy to do one way and really hard to do the other. The example often used is prime factors : we can work out 569 * 757 * 911 = 392397763, easily enough but if I asked you to find three prime numbers that multiply to make 392397763 (its prime factors)..without me telling them to you first, well it would take a while. Watch this video for a better understanding of this - (you don't need to be able to follow the maths of it for GCSE Computer Science)
All Text copyright Lakelands Academy & Mr T Purslow 2020.
All images copyright free / creative commons unless otherwise stated.
You are welcome to use under a Creative Commons Attribution-nonCommercial-ShareAlike License.
All Text copyright Lakelands Academy & Mr T Purslow 2020.  All images copyright free / creative commons unless otherwise stated. You are welcome to use under a Creative Commons Attribution-nonCommercial-ShareAlike License.
All Text copyright Lakelands Academy & Mr T Purslow 2020.  All images copyright free / creative commons unless otherwise stated. You are welcome to use under a Creative Commons Attribution-nonCommercial-ShareAlike License.
Back to content