šŸ”Unlocking WhatsApp's Secrets: A Deep Dive into Encryption

VengateswaranVengateswaran
3 min read

Hey everyone! I’m Vengat šŸ‘‹

Today, let’s explore something we all see in our WhatsApp chats but may not fully understand — ENCRYPTION. You might have noticed that when you click someone’s WhatsApp profile, it shows something called ā€œEncryptionā€ below, with a QR Code and a 60-digit number. That number is the same for both people in the chat. But… why is that?

Let’s break it down.

šŸ”‘ What Is Cryptography?

Before we understand WhatsApp’s encryption, we need to know what cryptography is.

In simple terms, cryptography is the method of sending a secret message so only the intended person can read it—even if someone else tries to intercept it.

Example:
Imagine Romeo wants to send Juliet a secret message. He sends her the word: ā€œSECRET.ā€ But if someone else reads it in between, the surprise is gone!

So, to protect it, Romeo uses cryptography. He creates a language that only he and Juliet understand. For example, assign a number to each alphabet:

  • A = 1, B = 2, C = 3, …... Z = 26.

Now, the word ā€œsecretā€ becomes: 19, 5, 3, 18, 5, 20.
If someone intercepts this, all they see are numbers, not the actual word.
But Juliet can decode it using the same logic and get back the original message: SECRET.

That’s how basic cryptography works.

šŸ” How WhatsApp Uses Advanced Cryptography

Now let’s go one level up: End-to-End Encryption (E2EE).
This is the advanced form of cryptography that WhatsApp uses.

E2EE works on two core concepts:

  • Encryption – locking the message (i.e. Encrypt the message)

  • Decryption – unlocking the message. (i.e. Decrypt the message)

But here’s the twist:
WhatsApp doesn’t use simple number-to-alphabet encryption like in our Romeo-Juliet example. Instead, it uses 60-DIGIT PRIME NUMBERS — which you’ve seen below the QR code in the app.

This is a 60-DIGIT PRIME NUMBER

🧠 How Does It Work?

To make this work, WhatsApp uses two important keys:

  • Public Key – Stored on WhatsApp's servers.

  • Private Key – Only available on your phone. (Its never publicly available)

Let’s see how this helps:

When someone sends a message:

  • It gets encrypted using the public key.

  • It can only be decrypted using the private key on the receiver’s phone.

Even WhatsApp itself can’t read the message, because it doesn’t have your private key. This way, the message remains safe even from hackers!

šŸ’¬ Real-Life Example

Let’s say Jack wants to send a message to Rose.

  1. Jack sends his message to Rose.

  2. Before it leaves his phone, the message is encrypted using Rose’s public key, which is available on WhatsApp’s server.

  3. Now, the encrypted message is unreadable and sent through the WhatsApp server and then delivered to Rose.

  4. Once it reaches Rose, her private key (stored on her phone) is used to decrypt and read the message.

So even though the message passes through WhatsApp servers, they can’t read it, because they don’t have Rose’s private key.

Here’s the smart part:

Even if a hacker somehow gets into WhatsApp’s server and accesses the public key by hacking, they can’t decrypt or delete or edit the message.

Why?

  • Because the private key is never shared or stored on the server — it stays only with the receiver (like Rose). And without the private key, even the most powerful computers can’t unlock the message.

    This is what makes End-to-End encryption (E2E or E2EE) so powerful and secure.

This ensures that only the intended recipient can read the message; Even WhatsApp itself can’t see the content. This is how End-to-End Encryption (E2EE) protects your chats from prying eyes.

0
Subscribe to my newsletter

Read articles from Vengateswaran directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Vengateswaran
Vengateswaran

šŸ‘‹šŸ» Hey, I'm Vengateswaran A Software Engineer from India and a Python Full Stack Developer. I write about and build open-source projects focused on AI, web development, and practical tech solutions. I'm deeply passionate about making complex technical topics simple, whether it’s through code or blogs—sometimes even ideas that come to me in my sleepy dreams! I work with: Python & Django AI/ML tools (I'm an AI enthusiast—you’ll see a lot of that here) SQL Web Technologies ReactJS & JavaScript šŸ§‘ā€šŸ« My Philosophy on Teaching & Writing: I'm passionate about teaching. I believe that if a student doesn’t understand concept or something, it’s not their fault—it’s the teacher’s. A good teacher brings & breaks the concept down to the student’s level, not their own. That’s the mindset I write, teach, and share.