How Encryption Works – Explained

How Encryption Works

Explore How Encryption Works?

Imagine you’re trying to send a secret message to your friend, but you know there are people lurking around who might read it. What do you do? You put the message in a box, lock it with a key, and only your friend has the key to unlock it. This—at its core—is encryption.

But how does encryption really work under the hood in computers and over the internet? Why is it so important today? And how does it keep things like your WhatsApp messages, online banking, or even your passwords safe?

Let’s unravel this mystery, one layer at a time.

Why Do We Need Encryption?

Before the internet, secrets were kept in diaries, hidden vaults, and sealed envelopes. Once communication went digital, your messages were no longer traveling in envelopes—they were more like postcards. Anyone along the way could read them.

In early internet days, data traveled unencrypted. If you sent a password, anyone monitoring the connection could see it.

The solution? Wrap your message in a secure box before sending it. This is encryption. It was born out of the need for digital privacy.

What is Encryption, Really?

At its simplest:

Encryption is the process of converting readable data (plaintext) into unreadable gibberish (ciphertext).

Only someone with the correct key can turn it back into the original message. The process of turning gibberish back into plain text is called decryption.

You can think of encryption as:

  • A lockbox (encryption)
  • A key to open it (decryption)
  • A message inside (your data)

Without the key, the box might as well be a brick.

Types of Encryption (And How They Work)

1. Symmetric Encryption – One Key for Both Lock and Unlock

This is like giving Chomu a key and saying, “Use this to lock and unlock our messages.” Both sender and receiver use the same key.

Common algorithm: AES (Advanced Encryption Standard)

– Fast
– Key sharing is risky – what if someone steals it?

2. Asymmetric Encryption – Two Keys: Public and Private

This is what powers most of modern encryption on the internet.

  • Public Key: Like an open mailbox. Anyone can drop a letter in.
  • Private Key: Only the mailbox owner can open it.

Example: Manrahul wants to send Catoza a secret. He uses Catoza’s public key to encrypt the message. Only Catoza’s private key can decrypt it.

Used in: HTTPS, Digital Signatures, Blockchain
Common algorithm: RSA, ECC

– Secure key sharing
– Slower than symmetric

Where Do You Use Encryption Every Day?

You might not realize it, but encryption is everywhere:

Everyday TaskIs It Encrypted?How?
WhatsApp ChatYesEnd-to-end encryption (E2EE)
Online BankingYesHTTPS with SSL/TLS
Saving PasswordsYesHashed and encrypted
Email (Gmail, Outlook)Yes/No MixedSome parts encrypted, others not
Wi-FiYes (hopefully)WPA2 / WPA3 encryption

How HTTPS Uses Encryption

When you see the 🔒 lock icon in your browser, it means:

  • The site uses SSL/TLS.
  • Your data is encrypted during transmission.
  • It’s safe from eavesdropping.

Under the hood:

  1. Your browser says, “Hey website, give me your public key.”
  2. It uses that key to encrypt a random session key.
  3. The site decrypts it using its private key.
  4. Now both sides use that session key for blazing-fast encrypted communication.

You can learn more in How a Website Loads – From Browser to HTML.

What Is End-to-End Encryption (E2EE)?

This means only the sender and receiver can read the message. Not even the service provider (like WhatsApp or Signal) can see what you’re saying.

It’s like you and your friend having a code language that even the postman can’t crack.

What Happens Without Encryption?

Imagine sending your ATM PIN over open Wi-Fi.

Without encryption:

  • Anyone in the café can intercept it.
  • Hackers can steal sensitive data.
  • Your messages, passwords, credit card details—wide open!

Encryption isn’t a luxury—it’s the reason our modern web is usable and safe.

Under the Hood – Simplified Explanation

Let’s say Chomu writes:

“Hello, Catoza!”

And uses AES (symmetric encryption) with a key like:
KEY: 1a2b3c4d5e6f...

Encrypted result (ciphertext):

89f7af92b198bb8321c3a29f4abcf9

No one without the key can turn that back into “Hello, Catoza!”

Encryption vs Hashing – Are They the Same?

No! They’re cousins, not twins.

EncryptionHashing
Can be decryptedOne-way only
Used for secrecyUsed for verifying data (like passwords)
E.g., AES, RSAE.g., SHA-256, bcrypt

When you log in, your password is hashed (not encrypted), and compared with the stored hash.

The Real World Analogy Recap

Let’s tie it all together:

ConceptReal World Analogy
PlaintextA love letter
EncryptionPutting it in a locked box
CiphertextThe box (unreadable without key)
KeyThe lock’s key
DecryptionUsing the key to read the letter

Final Thoughts

Encryption isn’t just for spies or techies. It powers every login, every message, every financial transaction you make online. It’s the reason you can trust the web.

Understanding it—even at a high level—makes you not just a better developer or user, but a more secure digital citizen.

References and Sources

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top