Skip to main content

Command Palette

Search for a command to run...

Encryption

Updated
4 min read
Encryption

Encryption sounds mysterious, intimidating, and like something only people in hoodies understand. In reality, it’s just math.

Having said that, the maths involved is highly complex and is something likely only PHD’s can understand but just like electricity, we don’t need to know how it flows through the wire to use it effectively.

The aim of this article is to provide a high-level overview and I’ll be sharing a detailed technical guide on how to encrypt data at a later date.

What is encryption?

Encryption is the process of converting readable information (plaintext) into an unreadable format (ciphertext) using a mathematical algorithm and a secret value called a key.

If someone happened to intercept a piece of encrypted data, it would simply look like a random sequence of letters, numbers and characters and nothing useful could be derived from it.

Fun Fact:

The oldest recorded example of encryption comes from Ancient Egypt. Egyptian scribes sometimes used non-standard hieroglyphs in inscriptions—swapping symbols or using unusual ones to obscure the meaning of religious texts and official records.

Types of Encryption:

Thankfully we’ve moved on from hieroglyphs so what does encryption look like in the modern age? At the heart of modern digital security are two types of encryption: Symmetric and Asymmetric.

Symmetric Encryption:

is the simplest form of encryption. It uses the same secret key to both encrypt and decrypt data.

Think of it like sharing a house key:

• You lock the door with the key

• Your friend unlocks it with the same key

• Anyone else who gets that key? #problem

It is very useful and heavily relied on because of how quick it is to encrypt and decrypt data using this method.

It’s used to protect:

  • Hard Drives

  • Databases

  • VPN traffic

  • Large files

Essentially anything that involves a large amount of data.

Algorithms like AES are the gold standard here. AES-256 is so trusted that governments, banks, and security professionals all rely on this to keep data safe.

Unfortunately, no matter how perfect something is, there’s often a small problem that can ruin the whole thing – such is life. In this case it’s not the encryption, it’s the key itself.

How do you safely give someone the secret key without someone else stealing it?

You can’t just email it (not secure).

You can’t shout it across the internet (absolutely absurd).

And writing it on a piece of paper is just plain stupid.

This is known as the key distribution problem, and it’s the reason symmetric encryption can’t handle the internet alone.

Asymmetric Encryption

What if we don’t need to worry about how we are going to get the secret key to the other person?

Instead of one key, it uses two, both keys are generated at the same time and are linked mathematically.

• A public key (share it with the world)

• A private key (keep it close to your chest)

Anything encrypted with one key can only be decrypted with the other.

So, if someone encrypts something with my public key which I can safely share with whomever, only I’ll be able to decrypt it as I should be the only person in possession of the private key from the same key pair.

Safely storing private keys is a complex topic and is well beyond the scope of this article, however if I’ve piqued your interest and you would like to learn more about this look into hardware security modules. They are physical computing devices dedicated to this amongst other cryptographic functions.

Asymmetric encryption solves the trust problem.

You can safely send encrypted data to someone without ever meeting them or sharing the secret key first. That’s kind of essential when you’re talking to millions of strangers on the internet.

This is why technologies like HTTPS, digital certificates, and secure email even exist.

Downsides:

Remember my point earlier about how there’s no such thing as perfect?

Asymmetric encryption is painfully slow compared to symmetric encryption.

For this reason it’s not used for bulk data — only for:

• Authentication

• Key exchange

• Digital signatures

It is secure and an excellent advancement – just not fast.

What now?

Sometimes, just sometimes there is a happy ending.. This is one of those times. Only because the two systems complement each other beautifully, so well in fact it’s almost as if they were made for each other..

Modern systems use hybrid encryption:

  1. Asymmetric encryption is used to securely communicate the secret symmetric encryption/decryption key (remember the same key is used for both processes).

  2. Symmetric encryption then takes over and does the heavy lifting.

Alone, each has flaws. Together, they’re the reason why the internet functions as well as it does. Without this we wouldn’t be able to securely browse sites, conduct online/ mobile banking or any form of online shopping etc..

Naturally, there is much more to this topic than what I’ve explained here. As mentioned earlier I will be creating a detailed guide on how to encrypt data and create digital signatures using both forms of encryption. I hope you find this brief overview useful.