Methods of Encryption

Encryption is a method of making data unreadable to anyone who may intercept or steal data whilst it is being sent or saved. Data is jumbled using an algorithm which will allow is to be decrypted when the intended user wishes to read the message.

There are quite a few technical key terms for this section, and so we have included them in the table below (you can also hover over any word(s) that are bold & underlined to see more information:

Key TermDefinition
Plain TextText that can be read by a human. This is the original, readable text.
Cipher TextText that has been encrypted. This is unreadable by a human.
EncryptionThe act of turning plain text into cipher text by using a key
DecryptionTurning cipher text back into readable plain text using a key
KeyThe data that is used to encrypt / decrypt data. This can be numeric, text, or alphanumeric

There are two main types of encryption algorithm that can be used and the algorithms that we initially learn for encryption, generally fall into the first.

Extension Video

In the GCSE you will be expected to understand the difference between the Caesar Cipher which is a form of shift cipher and more complex examples such as a substitution cipher where letters are replaced with random other letters (this is sometimes also called a nomenclator).

The video lesson below is taken from our A Level masterclasses, but covers a range of encryption techniques and their uses. The two ciphers that you should be aware of in this video are the Caesar Cipher and the Substitution Cipher.

You’ll be able to see in this video that the A Level often takes the topics that you learn at GCSE and adds extra details (often higher level maths).

Symmetric Encryption

Symmetric encryption is a set of algorithms where the plain text (the data to be encrypted) is encrypted using the same key that is used to decrypt the cipher text (the encrypted text).

The most commonly known symmetric encryption algorithm is the Caesar Cipher which was used by the Roman Emporer, Julius Caesar to send secret messages to his army generals.

The Caesar Cipher is a type of shift cipher, which means that letters are moved along the alphabet based on a numeric key. You can try this for yourself below – see if you can calculate the key that has been used to encrypt your message:

Text:
Key:


Asymmetric Encryption

Asymmetric enrcyption is likely to be the form of encryption that you are most familiar with using, even if you may not recognise it at first. This is the form of encryption that allows secure messages to be sent over a network (including the internet) using end-to-end encryption.

In Asymmetric encryption two keys are used : one key to encrypt & a paired key to decrypt

To encrypt a message, the following process is followed:

  1. The plain text message is encrypted with the sender’s private key
  2. The cipher text created is then encrypted again with the recipient’s public key
  3. The message is then transmitted to its destination

To decrpt a message, the following process is followed:

  1. The cipher text message is decrypted with the recipient’s private key (the paired key to the recipient’s public key)
  2. The cipher text that remains is then decrypted again with the sender’s public key (the paired key to sender’s private key)
  3. The message can then be read

Why does End-To-End Encryption Encrypt Twice?

There are two purposes to using Asymmetric encryption.

The first reason for this method of encryption is to prove that the message is really from the sender – this is a highly effective method of authentication. When the sender encrypts the message with their private key, anyone can unlock it with their public key… but, only the sender could have encrypted the message as they are the only ones with the private key.

Of course, as anyone can unlock the authenticated message, a second encryption is needed to protect the data. This protects the message from others reading it. To do this, the public key of the recipient is used to encrypt. This means that only the recipient could possible decrypt the message as only they hold the paired private key.

Challenge 2 – Exponential Bunnies

Challenge 2 – Exponential Bunnies

Complete the programming challenge below and submit your answer below as a doc or text file (if you are coding on Repl – upload a document containing your repl link)

Challenge Instructions

Exponential growth is when a number (or size) doubles for each iteration (loop). A field of rabbits starts with just two, then increases in number exponentially every 15 days.

Write a program that takes in the number of days to simulate from the user, calculates the number of rabbits after that time and outputs the value in a user friendly format.

Extension: allow the user to input a starting number of rabbits.

Extension 2 : write this as a function that takes in the starting number and number of days.

Student Solutions - Basic

No Solutions Yet

Student Solutions - Extended

Student Solution 1 (Python)

Solution by Oliver S

rabbits = int(input("Input a number of rabbits: "))
days = int(input("Input a number of days: "))
for i in range(1, days):
  if i %15 == 0:
    rabbits = rabbits * 2
    print("-------------------------------------------------------------------------------- There are", rabbits, "rabbits on day", i)