How WhatsApp Ensures Chat Security with End-to-End Encryption - Requestly (2024)

For more than a decade, WhatsApp has been the trusty sidekick for people worldwide. But what sets WhatsApp apart in this sea of messaging apps is its shield of security and privacy. This shield is the impenetrable fortress of End-to-End Encryption (E2EE), a cryptographic wizardry that thwarts man-in-the-middle attacks to ensure your conversations remain confidential and secure. Today, E2EE has become the secret ingredient for cutting-edge communication apps.

In this blog post, we’ll cover the most imperative concepts behind WhatsApp’s foolproof privacy, End-to-End Encryption (E2EE). We’ll also dive deep into how WhatsApp works and cover aspects like how it syncs your chat and data across multiple devices.

End-to-End Encryption (E2EE): A Bird’s Eye View

E2EE is a cryptographic technique that encrypts data in such a way that only the intended recipients can access that data. Unlike traditional encryption, where data can be decrypted at multiple points along its journey, E2EE ensures that messages remain encrypted from sender to receiver and can only be decrypted by the recipient and no one else, not even the service provider.

Understanding E2EE with an Example

Let’s dig deeper into E2EE and understand each step of the process using an example.

Say you’re Bob (the sender) and you’re sending a personal message to your friend, Alice (the receiver) using a messaging service provider. You want to ensure that only Alice can read it, even if the message is intercepted by someone else.

Exchanging Keys

The messaging service provider generates a pair of keys for both the sender Bob and the receiver, Alice. One of these keys will be a public key, and another one, a private key. The private key is guarded whereas the public key is available openly. Bob shares their public key with Alice and vice versa. These public keys are used to encrypt your message.

Encrypting the Message

Your message to Alice is now encrypted using Alice’s public key via a process called asymmetric encryption. It’s a lot like putting the message in a locked box that only Alice’s private key can unlock. Even if someone intercepts the message, they can’t make sense of it without the key.

Message Transmission and Decryption

Your encrypted message travels through the digital realm. When your encrypted message reaches Alice, Alice uses its private key – the exclusive key – to unlock the box and reveal the hidden message. Alice now see your message which remained confidential throughout its journey.

The Magic of E2EE

E2EE’s magic lies in the fact that only Alice’s private key can decode the message, and that key never leaves their possession. Not even the message provider has access to it. This ensures that even if hackers or snoops intercept the message, they can’t decipher it without the private key.

This is the base of how a platform like WhatsApp encrypts messages such that no one other than the sender and the recipient can read the messages.

How WhatsApp Ensures Chat Security with End-to-End Encryption - Requestly (1)

WhatsApp’s E2EE

WhatsApp’s end-to-end encryption (E2EE) is built on the Signal Protocol, designed by Open Whisper Systems. This protocol ensures that when you send messages, photos, or videos to someone, everything is locked in a secure encryption box, and only the intended recipient has the keys to open it.

Every device and conversation has its own unique encryption keys. So, if somehow one device’s keys are compromised, your other devices remain safe. It’s like having unique locks for each door in your house.

When you switch devices, your conversation history is also encrypted making sure your past conversations remain safe.

We’ll discuss the exact mechanics of message transmission and E2EE in detail later. All the technical details in this article are a simplified abstraction of WhatsApp’s security whitepaper. You can dig deeper in the whitepaper to understand in-depth how encryption works in WhatsApp.

Role of Phone Number

The primary data point that identifies a user to a WhatsApp account is their phone number. WhatsApp links your phone number to your device, acting as a form of user identification.

Registration and Devices

The first time you register a device on WhatsApp or sign in, WhatsApp stores your phone number alongside a bunch of keys. This device is also known as the Primary Device. A primary device can only be an Android or an iPhone device.

Every other device you use WhatsApp on except the primary device is called a Companion Device. This could be your laptop or iPad where you access WhatsApp or any other device where you use WhatsApp web.

Public Keys

When you install WhatsApp, the following public keys are generated –

  • Identity Key Pair is unique for every device and is used to verify the sender’s identity
  • Signed Pre Key which is signed by the identity key and rotated on a periodic timed basis and plays a role in secure communication
  • A One-Time Pre Key for one-time use which is replenished as needed, used to derive session keys

When WhatsApp registers your primary device for the first time, it creates and stores all the public keys on its own servers. These keys are also associated with the user’s identifier, i.e., their phone number.

Role of OTPs

To prevent unauthorized access, an additional layer of security is provided by One-Time Passwords (OTPs). When you set up WhatsApp on a new device, an OTP is sent to your registered phone number, ensuring that only the person with access to your phone can complete the setup process.

How WhatsApp Ensures Chat Security with End-to-End Encryption - Requestly (2)

Setting Up & Creating Secure Sessions

When you send a message on WhatsApp, your device establishes a secure connection with the recipient’s device. In order to create a secure session, your device asks WhatsApp’s servers for public keys for you and your recipient’s devices.

Your device checks these keys to make sure they are secure and valid. Each key is accompanied by a digital signature. Your device uses these signatures to verify that the keys haven’t been tampered with during transmission. It also checks if the keys match the metadata about you stored on WhatsApp’s servers.

Then, it starts creating a secure session with each of your recipient’s devices.

This secure connection is unique for each device, so even if you chat with someone on multiple devices, each one has its own private channel.

Only in situations where you’re reinstalling the app or changing devices, you might need to rebuild these secure sessions. Otherwise, it’s only a one-time process.

Sending and Receiving Messages

Once the secure sessions are set up, you can start sending messages. Let’s break down how messages are exchanged securely on WhatsApp in simpler terms:

How WhatsApp Ensures Chat Security with End-to-End Encryption - Requestly (3)

Message Encryption

A special message key is used to encrypt your messages using advanced encryption (AES256 in CBC mode). This key ensures that your messages cannot be unscrambled by anyone except the intended recipient.

Moreover, to make sure messages are genuine and not tampered with, they are also tagged with a special code called HMAC-SHA256 for authentication. This code ensures the message hasn’t been altered during transmission.

If you’re chatting with someone who has multiple devices (like a phone and a tablet), each message is separately encrypted for each of their devices.

For added security, the key used to encrypt messages (the Message Key) changes for every message. This means that even if someone somehow gets hold of an old key, they can’t use it to read new messages.

The Message Key comes from something called a Chain Key. This Chain Key keeps “ratcheting” forward with each message sent. Think of it like turning a key in a lock – it changes with each message. There’s also some complex math (ECDH agreement) happening in the background to create a new Chain Key for each message roundtrip.

Client-Fanout

Further, WhatsApp uses something called “client-fanout”. It is a technique to efficiently transmit messages to multiple devices associated with a user’s account. It ensures that messages sent to a user are correctly delivered to all their connected devices while maintaining end-to-end encryption by sending separate messages to each of your recipient’s devices.

All messages are encrypted using the same methodology regardless of their nature. So if you’re sending multi-media like images, videos, audio, location, etc. They’re also encrypted in the same manner.

Thus, WhatsApp doesn’t just secure text messages; it also extends E2EE to multimedia content. When you send an image, audio clip, or video, the content is encrypted before transmission and decrypted only on the recipient’s device.

Receiving Messages

When the recipient receives your message, they use the device’s private keys in combination with the sender’s public keys to unlock and read the message. They also create new keys for the next message.

Syncing Messages on Multiple Devices

One of WhatsApp’s unique features is its ability to sync messages across multiple devices while maintaining E2EE. Let’s understand how each step happens.

Before any interface is established between the two devices, we need to know that just like a primary device, a companion device also has its own public identifier key. Let’s call the companion device public Identity Key (Icompanion). This key is further used to create a special secret key (Lcompanion) for linking purposes. Importantly, Lcompanion is never sent to WhatsApp’s servers and is only stored locally.

Scanning the QR Code

When you first connect a new device, like WhatsApp Web, to your main WhatsApp device, you do it by scanning a QR code. Your main device scans the QR code on the new one and gets a special key, called Lcompanion. It saves this key. Now, your main device can recognize and connect with the new device using Lcompanion.

Creating Linking Data & Account Signature

In the next step, the primary device generates something called Linking Metadata (Lmetadata). It also creates a special Account Signature (Asignature) by using its private key to sign a combination of Iprimary, Lmetadata, and Icompanion. This signature is like a seal of approval for the companion device. It also generates a Device List Signature (ListSignature) for the updated device list.

The primary device packages all this data, including Lmetadata, Iprimary, and Asignature, into something called Linking Data (Ldata).

Storing Data in WhatsApp Servers

The primary device then creates a special code (HMAC) called PHMAC using Lcompanion and Ldata to ensure the process is secure. It can now send all this information, including ListData, ListSignature, Ldata, and PHMAC, to WhatsApp’s servers through a secure connection.

WhatsApp’s servers store the updated device list (ListData) and the device signatures (ListSignature). They then forward Ldata and PHMAC to the companion device.

Companion Verification

The companion device checks PHMAC for security, decodes Ldata to get Lmetadata, Iprimary, and Asignature, and verifies the Asignature to confirm that it’s from the primary device.

It also saves the Linking Metadata and the primary device’s Identity Key (Iprimary) to its memory.

Companion Device Signature

The companion device then creates a Device Signature (Dsignature) for itself, which is like its own seal of approval. It uploads this data, including Lmetadata, Asignature, Dsignature, Icompanion, and some other keys, to WhatsApp’s servers.

WhatsApp’s servers store all this uploaded data linked to your account and the specific device. At this point, data is synced between the two devices. This process happens between any N number of devices that a user uses for sending and receiving messages.

E2EE in Group Chats

Much similar to how E2EE works between a sender and a recipient, the same methodology is extended between multiple senders and multiple recipients in a group chat. Let’s explore this process step by step.

Initial Group Chat Setup

When someone sends a message to a WhatsApp group for the first time, a special secret key called a “Sender Key” is created for the group. This key is securely sent to each member of the group using the secure individual sessions we talked about earlier. This Sender Key is used to encrypt the message and make sure it’s only readable by the group members.

Sending Messages After Setup

After the Sender Key is set up, sending messages to the group becomes more efficient and secure. The sender uses the Chain Key to create a new Message Key for each message. Then, they use this Message Key to encrypt the message and sign it to make sure it’s authentic. This part is very similar to how messages are sent in general on WhatsApp securely using a unique encryption key for each message.

The sender sends this encrypted message to the WhatsApp server, and the server takes care of sending it to all the members of the group.

What if someone leaves the group?

To keep things safe, if someone leaves the group, all the group members refresh their Sender Key and start over. This way, even if someone leaves, the group’s messages remain secure. The same happens if someone else joins the group when the group already has a chat history.

How E2EE Backups Work

From personal conversations to group chats to backups, WhatsApp secures everything end-to-end.

How Backups are Encrypted

WhatsApp creates digital locks for your backups. When you enable E2EE backups, your backups get encrypted with a unique key. Once encrypted, they can be stored safely outside your device (like on iCloud or Google Drive).

Backups are Password Protected

Moreover, you can also choose to protect the backup encryption key with a custom password. When you want to access your backup, you can use your encryption key or your password. If you use your password, it’s checked by the secure vault. After a few wrong attempts, it locks you out to protect your data. This is extremely helpful in case someone is trying to brute-force crack your backups.

In order to access a password-protected backup, WhatsApp figures out the key from your password, and then this key is used to unlock and access your backups.

How WhatsApp Ensures Chat Security with End-to-End Encryption - Requestly (4)

You can learn more about E2EE backups in-depth here.

Conclusion

End-to-end encryption lies at the heart of WhatsApp’s commitment to user privacy and security. By employing cryptographic techniques, WhatsApp ensures that your messages, media, and even group chats remain private, even when synced across multiple devices. As we continue to embrace technology, understanding the mechanisms that protect our personal data becomes increasingly important.

Remember, security is a shared responsibility. Regularly updating your app, using strong, unique passwords, and being cautious about sharing personal information contribute to maintaining the integrity of E2EE.

How WhatsApp Ensures Chat Security with End-to-End Encryption - Requestly (2024)

FAQs

How WhatsApp Ensures Chat Security with End-to-End Encryption - Requestly? ›

WhatsApp's end-to-end encryption (E2EE) is built on the Signal Protocol, designed by Open Whisper Systems. This protocol ensures that when you send messages, photos, or videos to someone, everything is locked in a secure encryption box, and only the intended recipient has the keys to open it.

How does WhatsApp ensure end-to-end encryption? ›

That's because the encryption and decryption of messages sent and received on WhatsApp occurs entirely on your device. Before a message ever leaves your device, it's secured with a cryptographic lock, and only the recipient has the keys. In addition, the keys change with every single message that's sent.

What is the end-to-end encryption case of WhatsApp? ›

WhatsApp has threatened to exit if it is forced to break its end-to-end encryption. This statement was made by Advocate Tejas Karia before the Delhi High Court during a hearing challenging Rule 4(2) of the Information Technology (Intermediary Guidelines and Digital Media Ethics Code) Rules, 2021.

Will WhatsApp stop end-to-end encryption? ›

he boss of WhatsApp, the most popular messaging platform in the UK, says that it will not remove end-to-end encryption from the app to comply with requirements set out in the UK government's online safety bill.

How does end-to-end encryption work? ›

End-to-end encryption (E2EE) is a method of secure communication that prevents third parties from accessing data while it's transferred from one end system or device to another. In E2EE, the data is encrypted on the sender's system or device, and only the intended recipient can decrypt it.

Is WhatsApp true end-to-end encryption? ›

WhatsApp provides end-to-end encryption for all personal messages that you send and receive. This makes sure that only you and the person you're talking to can read or listen to them. With end-to-end encrypted backup, you can add that same layer of protection to your iCloud and Google Account backups.

Is WhatsApp safer than texting? ›

WhatsApp messages are end-to-end encrypted, meaning the messages are encrypted before they are sent. Only the recipient can read the messages, making it difficult for scammers to access the content. SMS messages are not encrypted, which means they can be intercepted if you don't take additional security measures.

Can the government read WhatsApp messages? ›

Based on the circ*mstances, we may disclose information to law enforcement in response to an emergency disclosure request where we have a good faith reason to believe that the matter involves imminent risk of serious physical injury or death and that WhatsApp may have information to help avert the threat to life.

Can WhatsApp end-to-end encryption be broken? ›

Technically, any encryption can be broken with enough computing power and time. However, for most individuals, the resources required to crack WhatsApp's E2EE are immense.

How private are WhatsApp messages? ›

Your privacy is our priority. With end-to-end encryption, you can be sure that your personal messages stay between you and who you send them to.

Can someone read WhatsApp messages from another phone? ›

Can someone see my WhatsApp messages from another phone? Yes, if they have access to your phone, they can link your WhatsApp, transfer your WhatsApp data, and move your WhatsApp cloud backup to their devices. With these ways, they are able to read your WhatsApp messages without your phone.

Is Signal safer than WhatsApp? ›

Yes, when comparing Signal privacy vs. WhatsApp, Signal is a better option. Although both apps are end-to-end encrypted, Signal offers more privacy and security gems. In particular, it protects users' metadata, collects less information about users, and is owned by a non-profit organization.

Is it safe to send private photos on WhatsApp? ›

WhatsApp employs end-to-end encryption, a security feature that locks your messages and photos with a digital key that only you and the recipient possess. This means that not even WhatsApp itself can access your shared content.

How do you know if someone is using end-to-end encryption? ›

Check if a conversation is end-to-end encrypted

End-to-end encrypted conversations have: A banner that says " RCS chat with [contact name or phone number]." A lock on the send button when you compose a message.

What is the logic behind end-to-end encryption? ›

End-to-end encryption keeps prying eyes away from the message because only the ends (sender and receiver) have access to the decryption keys. So even if the message is visible to an intermediary server that relays the message, it cannot be understood.

What is the truth about end-to-end encryption? ›

With E2EE, data is encrypted on the sender's device and is only ever decrypted on the recipient's device – never in the cloud — because only the sender and recipient possess the keys to encrypt and decrypt the message. As a result, attackers watching Internet traffic or breaching a server cannot access the data.

Is WhatsApp safe for sending private photos? ›

Your privacy is our priority. With end-to-end encryption, you can be sure that your personal messages stay between you and who you send them to.

Is WhatsApp encrypted from the police? ›

What does end-to-end encryption mean for responding to law enforcement requests? WhatsApp cannot and does not produce the content of its user's messages in response to government requests.

Can end-to-end encryption be hacked? ›

While E2EE is a powerful security tool, it is not entirely impenetrable. Modern hackers, using advanced techniques and resources, have occasionally succeeded in breaching secured communication channels. Stealing encryption keys or accessing data before encryption are common tactics.

Top Articles
About Us | IBISWorld
Common Security Issues in Implementing OAuth 2.0 and How to Mitigate Them
Katie Pavlich Bikini Photos
Gamevault Agent
Hocus Pocus Showtimes Near Harkins Theatres Yuma Palms 14
Free Atm For Emerald Card Near Me
Craigslist Mexico Cancun
Hendersonville (Tennessee) – Travel guide at Wikivoyage
Doby's Funeral Home Obituaries
Vardis Olive Garden (Georgioupolis, Kreta) ✈️ inkl. Flug buchen
Select Truck Greensboro
Things To Do In Atlanta Tomorrow Night
How To Cut Eelgrass Grounded
Pac Man Deviantart
Alexander Funeral Home Gallatin Obituaries
Craigslist In Flagstaff
Shasta County Most Wanted 2022
Energy Healing Conference Utah
Testberichte zu E-Bikes & Fahrrädern von PROPHETE.
Aaa Saugus Ma Appointment
Geometry Review Quiz 5 Answer Key
Walgreens Alma School And Dynamite
Bible Gateway passage: Revelation 3 - New Living Translation
Yisd Home Access Center
Home
Shadbase Get Out Of Jail
Gina Wilson Angle Addition Postulate
Celina Powell Lil Meech Video: A Controversial Encounter Shakes Social Media - Video Reddit Trend
Walmart Pharmacy Near Me Open
Dmv In Anoka
A Christmas Horse - Alison Senxation
Ou Football Brainiacs
Access a Shared Resource | Computing for Arts + Sciences
Pixel Combat Unblocked
Cvs Sport Physicals
Mercedes W204 Belt Diagram
Rogold Extension
'Conan Exiles' 3.0 Guide: How To Unlock Spells And Sorcery
Teenbeautyfitness
Weekly Math Review Q4 3
Facebook Marketplace Marrero La
Nobodyhome.tv Reddit
Topos De Bolos Engraçados
Gregory (Five Nights at Freddy's)
Grand Valley State University Library Hours
Holzer Athena Portal
Hampton In And Suites Near Me
Stoughton Commuter Rail Schedule
Bedbathandbeyond Flemington Nj
Free Carnival-themed Google Slides & PowerPoint templates
Otter Bustr
Selly Medaline
Latest Posts
Article information

Author: Dan Stracke

Last Updated:

Views: 6133

Rating: 4.2 / 5 (63 voted)

Reviews: 94% of readers found this page helpful

Author information

Name: Dan Stracke

Birthday: 1992-08-25

Address: 2253 Brown Springs, East Alla, OH 38634-0309

Phone: +398735162064

Job: Investor Government Associate

Hobby: Shopping, LARPing, Scrapbooking, Surfing, Slacklining, Dance, Glassblowing

Introduction: My name is Dan Stracke, I am a homely, gleaming, glamorous, inquisitive, homely, gorgeous, light person who loves writing and wants to share my knowledge and understanding with you.