Skip main navigation

£199.99 £139.99 for one year of Unlimited learning. Offer ends on 28 February 2023 at 23:59 (UTC). T&Cs apply

Find out more

The encryption process

An encryption scheme transforms a plaintext into a ciphertext. Read more about this process.

In this step you will learn about several of the main concepts in the encryption process, as well as some important terms.

As you have already seen, an encryption scheme transforms a plaintext into a ciphertext.

This transformation is conducted using an encryption algorithm. This is the set of instructions that you must follow to modify the plaintext so that it can be encrypted. For example, in a substitution cipher, the encryption algorithm determines which letter each letter in the plaintext will be substituted with. We will look at this in more detail in the next step.

A machine that takes a plaintext message and a key and outputs a ciphertext

The encryption algorithm takes two inputs — the plaintext and a key — and produces one output, the ciphertext. A key is a secret that determines the output of the encryption algorithm; different keys will produce different ciphertexts. This component allows you to restrict access to the message, as only those who know the key can decrypt the message.

Keys can be created using a key generation algorithm. This is the set of instructions used to create the key. For example, in a Caesar cipher, keys are generated by randomly choosing a number between 1 and 25. Keys can take many forms: in the Second World War, British spies used the first lines of poems as keys in their Vigenère ciphers, which often made them easy to guess. In modern-day encryption, keys are supposedly random strings of numbers and letters, although generating keys that are truly random and so cannot be guessed is still problematic. Often keys are pseudorandom, which means that they are not truly random, but appear to be random when analysed.

robot playing bingo, they have pulled out an A and there is board behind them with alphabet on it, 'C, F, I, P, R, S & V' have been circled on the board

To turn the ciphertext back into a plaintext, you must follow the decryption algorithm. This might simply be the reverse of the set of instructions that were followed to encrypt the plaintext. The decryption algorithm takes the ciphertext and the key as its inputs, and returns the plaintext.

A machine that takes a ciphertext and a key and outputs a plaintext message.png)

The algorithms should be designed so that the decryption algorithm always turns the encrypted form of a message back into the original message. If you make a mistake when following the encryption algorithm, the person decrypting the ciphertext will not be able to determine the plaintext.

If you have designed a strong encryption scheme, you should be able to let everyone know your key generation, encryption, and decryption algorithms without making it easier for your enemies to hack your system. As long as the key used to encrypt a message is kept secret, only the people who know the key should be able to decrypt the message correctly.

Next steps

In the next step you will learn the encryption, decryption, and key generation algorithms for a substitution cipher.


  • What is the key for an Enigma machine?
  • How can an encryption scheme be secure even if eavesdroppers know the key generation, encryption, and decryption algorithms?

Share your thoughts in the comments.

This article is from the free online

Introduction to Encryption and Cryptography

Created by
FutureLearn - Learning For Life

Our purpose is to transform access to education.

We offer a diverse selection of courses from leading universities and cultural institutions from around the world. These are delivered one step at a time, and are accessible on mobile, tablet and desktop, so you can fit learning around your life.

We believe learning should be an enjoyable, social experience, so our courses offer the opportunity to discuss what you’re learning with others as you go, helping you make fresh discoveries and form new ideas.
You can unlock new opportunities with unlimited access to hundreds of online short courses for a year by subscribing to our Unlimited package. Build your knowledge with top universities and organisations.

Learn more about how FutureLearn is transforming access to education