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


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.
š§ 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.
Jack sends his message to Rose.
Before it leaves his phone, the message is encrypted using Roseās public key, which is available on WhatsAppās server.
Now, the encrypted message is unreadable and sent through the WhatsApp server and then delivered to Rose.
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.
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.