Encryption is a method of securing data so that unauthorised people can not use the data if they managed to gain access to it. An example could be the caesar cipher which historically was used to encrypt secret messages using ‘shift keys’. A shift key is a number which represents how many times a single letter would be ‘shifted’ across the alphabet to create an encrypted message.
| Original Text | A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Cipher Text | A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z |
Shift Key: 0
For example, using a shift key of 5 the word Encryption becomes Jshwuynts. Try using the slider and the cipher table to decrypt this message: Jxyi mqi uqio. (Hint! The Shift Key is 16...) Pretty simple, right? Well this type of cipher is called symmetric encryption as the same key is used to encrypt and decrypt. That makes it super easy for someone who shouldn’t have access to encrypted data to decrypt it if they found out what the key is.
Due to this, asymmetric encryption is mostly used today as it uses two different keys; a public key and a private key. A public key is used to encrypt a message and a private key is used to decrypt. This makes encryption even more secure as attackers can’t decrypt data even if they have the public key. This website explores how asymmetric encryption works and different examples of it.
Before you can dive into the intricacies of how specific asymmetric algorithms work, it is easier to understand more generally how exactly two different keys can be applied to encrypt and decrypt data. The basic principle of asymmetric encryption can be explained using composite functions. A public key is applied to the data first, let’s represent this as a function f() and apply it to the data, f(data) which would be the encrypted data. To decrypt this data, another function g() is used which we’ll use to represent the private key. Applying g on f(data) should return the original data, where g(f(data)) = data. As f() is a public key, the data stays secure where f() is extremely difficult and inefficient to inverse so anyone without the private key, g() cannot decrypt the data.