How does a message arrive encrypted on the other side of the world?
TLS protects the road between you and a server, but the server is where that road ends. End-to-end encryption is a second layer, agreed between the two phones, that leaves the server only carrying the message.
Published Updated 7 min readApplies to: Most countries
Short answer
A message crosses the network protected by TLS, which keeps its content from anyone tapping the cable. Both sides first agree on a shared key in public, and the server proves its identity with a certificate. But TLS ends at the server. Only end-to-end encryption, a second layer between the two phones, keeps the server from reading it.
Key points
- 1TLS is designed to give a secure channel even against an attacker who has complete control of the network.
- 2Two strangers can agree on a key in public with Diffie-Hellman. In real systems a public value is 32 bytes.
- 3A certificate shows that the server controls a domain name, as checked by an issuer the browser trusts. It does not say the site is honest.
- 4TLS ends at the server, so the server can read what arrives. End-to-end encryption is a second layer between the two devices.
- 5TLS does not hide the length of the data, and the server's IP address stays visible to the network.
Two things called encrypted
Your message leaves your phone, crosses cables and routers you do not control, reaches a server, and goes on to your friend. TLS, the protocol behind most secure connections, is designed to provide a secure channel between two peers, and its properties should hold even against an attacker with complete control of the network.
But there is a catch hidden in the word endpoint. The server you connect to is one end of that channel. Whether the message stays unreadable past the server depends on a second, separate layer.
Two meanings of encrypted: Your phone (sends the message) → The cable (anyone can tap it) [TLS tunnel]; The cable (anyone can tap it) → The server (where the TLS leg ends) [TLS tunnel]; The server (where the TLS leg ends) → Your friend (the other phone) [second TLS tunnel]; Your phone (sends the message) → Your friend (the other phone) [end-to-end layer]
A secret made in public
In 1976, Diffie and Hellman described the problem: to use cryptography for privacy, the parties normally had to share a key known to no one else, sent in advance over a secure channel such as a private courier or registered mail.
Their proposal: each user picks a secret number X and publishes Y = α^X mod q. Two users, i and j, both end up with the same key K = α^(X_i·X_j) mod q, each computing it from the other's public value and their own secret. Anyone else would have to undo a discrete logarithm. The authors said the security rests on that being hard, and that they did not have a proof of the converse. So the honest statement is: believed hard, not proven impossible.
Here is a toy version, with numbers small enough to check by hand. These are illustrative values, not real keys.
- Public: the prime p = 211 and the generator g = 2.
- Alice keeps 57 and publishes 2^57 mod 211 = 200.
- Bob keeps 143 and publishes 2^143 mod 211 = 112.
- Alice computes 112^57 mod 211 = 146. Bob computes 200^143 mod 211 = 146. Same key.
A watcher sees 211, 2, 200 and 112. With a prime this small, trying every exponent finds the secret 57 after 57 tries, which is why the numbers in real systems are enormous. The paper's own 1976 illustration, for a 200-bit exponent, was at most 400 multiplications for the legitimate user against roughly 2^100, about 10^30, operations for the logarithm. That is an illustration of easy one way and hard the other, not a statement about any modern key.
What real systems use
In TLS 1.3, the client's first message carries Diffie-Hellman key shares and the server answers with its own ephemeral share. Together they determine the shared keys, and every handshake message after the server's reply is encrypted. Static RSA and static Diffie-Hellman suites were removed, so all public-key key exchange now provides forward secrecy: if the server's long-term keys are compromised after the handshake, that session key is not.
Real exchanges use elliptic curves. An X25519 public value is 32 bytes, on a curve over the prime 2^255 - 19 aimed at about a 128-bit security level. NIST's table of equal estimated strengths pairs a 128-bit level with a 3,072-bit RSA modulus or a 256-to-383-bit elliptic-curve key. At the low end that is 3,072 / 256 = 12 times smaller, which is the sourced reason for curves.
Who is on the other end?
A shared key with someone is not enough; you need to know who. In TLS 1.3 the server sends its certificate and a signature over the entire handshake made with the key behind it, then a closing check over the handshake. The client checks that the certificate matches the name it asked for, using the procedures in RFC 9525.
Why does the browser trust the certificate? Because the issuer's root certificate is distributed with widely available software. And what does the issuer check? A standard certificate shows that the applicant controls the domain name, for example by publishing a DNS record or an HTTP resource the issuer asks for. It does not say the site is trustworthy.
Certificates are getting shorter-lived: Mar 15, 2026 Up to 200 days (Maximum validity of a new public TLS certificate (CA/Browser Forum)) → Mar 15, 2027 Up to 100 days (Maximum validity of a new public TLS certificate (CA/Browser Forum)) → Mar 15, 2029 Up to 47 days (Maximum validity of a new public TLS certificate (CA/Browser Forum))
On November 2, 2026, Let's Encrypt reported 726,600,268 active certificates. In the week of October 25, 2026, the share of pages loaded in Chrome over HTTPS ran from 88.2% on Linux to 99.5% on ChromeOS, in Google Transparency Report data relayed by Let's Encrypt. That measures Chrome page loads per operating system, not all internet traffic.
The twist: TLS ends at the server
Put the two ideas together. TLS protects the leg between you and the server and the leg between the server and your friend. The server is an endpoint of each leg, so it receives what the app sends. End-to-end encryption wraps the message so that the server only carries it.
TLS only vs TLS plus end-to-end: TLS only: Protects the road from you to the server; The server is an endpoint, so it reads what arrives; A certificate shows which server you reached | TLS + end-to-end: The keys are agreed between the two devices; The server stores and forwards a sealed message; A new key is derived for every message
In Signal's published design (X3DH), the recipient publishes keys to a server, the sender fetches them and derives a shared key while the recipient is offline, and without a separate identity check the parties have no cryptographic guarantee of who they are talking to. In the Double Ratchet, a new key is derived for every message.
WhatsApp's own technical white paper (version 10, October 30, 2026) says its end-to-end encryption uses the Signal protocol and is designed to prevent third parties and WhatsApp from having plaintext access to messages or calls. It describes the connection from the app to its servers as a separate encrypted channel built on Noise Pipes, not TLS, and offers a QR code or 60-digit number to verify that no one has intervened. It also says it does not consider chats with businesses that use its Cloud API to be end-to-end encrypted, even though the same encryption is used. These are the company's statements about its own product.
What the cable still sees
TLS does not hide the length of the data it carries. In TLS 1.3 the server name sent at the start of the connection is in the clear, and DNS queries and server IP addresses can also reveal where you are going. Encrypted Client Hello, standardised in RFC 9849 in March 2026, encrypts that name; we do not know how widely it is deployed.
Questions people ask
Is TLS the same as end-to-end encryption?
No. TLS protects the connection between a client and a server, and the server is an endpoint of it, so it receives what the app sends. End-to-end encryption is a second layer agreed between the two devices, so the server only carries the message.
Does a certificate mean a website is trustworthy?
No. A standard certificate shows that the applicant controls a domain name, as checked by an issuer whose root certificate the browser already has. Whether the site is honest is outside what the certificate says.
Is Diffie-Hellman proven secure?
No. Its security rests on the discrete logarithm being hard, and the original authors wrote that they had no proof of the converse. It is believed hard.
Can a chat app's server read my messages?
With TLS alone, yes, because the server is an endpoint. With end-to-end encryption, the company's own documents say it cannot. WhatsApp's white paper says so for its end-to-end chats, and also says business chats using its Cloud API are not considered end-to-end encrypted.
Sources and notes
- Confirmed factRFC 8446, The Transport Layer Security (TLS) Protocol Version 1.3, IETF (E. Rescorla, 2018)TLS 1.3: goals, handshake, key shares, forward secrecy, what TLS does not hide (length), mandatory key exchange (P-256 MUST, X25519 SHOULD).
- Confirmed factRFC 7748, Elliptic Curves for Security (Curve25519, X25519), IRTF (Langley and Hamburg, 2016)X25519: prime 2^255 - 19, about 128-bit security level, 32-byte public value.
- Confirmed factNew Directions in Cryptography, Diffie and Hellman, IEEE Trans. Information Theory, 19761976 key-exchange proposal, courier problem, discrete-log basis, 'no proof of the converse', and the b = 200 illustration (p. 649).
- Confirmed factSP 800-57 Part 1 Rev. 5, Recommendation for Key Management, NIST (2020)Table 2: equal estimated strengths (128-bit: RSA 3072, EC 256-383); definition of ephemeral key.
- Confirmed factThe X3DH Key Agreement Protocol, Revision 1, Signal (2016)Asynchronous key agreement via a server holding prekeys; DH1-DH4; authentication needs out-of-band checks. A specification, not a statement of what any app runs.
- Confirmed factThe Double Ratchet Algorithm, Revision 4, Signal (2025)A new key for every message; DH values travel with messages. A specification.
- Confirmed factWhatsApp Encryption Overview, Technical white paper, Version 10, WhatsApp (30 Oct 2026), company statementCompany statement: Signal-protocol E2EE; its own definition of E2EE (Cloud API business chats excluded); safety number of 60 digits; client-server channel uses Noise Pipes.
- Confirmed factRFC 9849, TLS Encrypted Client Hello, IETF (March 2026)Plaintext SNI and server IP remain visible without ECH; ECH standardised March 2026. Deployment not established.
- Confirmed factRFC 9525, Service Identity in TLS, IETF (Saint-Andre and Salz, 2023)How clients verify the identity of an application service in TLS with PKIX certificates.
- Confirmed factBaseline Requirements for Publicly-Trusted TLS Server Certificates, v2.3.1, CA/Browser Forum (4 Oct 2026)Roots shipped with software are what make certificates trusted (sec. 1.1); maximum validity 200/100/47 days (sec. 6.3.2).
- Confirmed factHow It Works, Let's Encrypt (ISRG)How a CA checks domain control by challenges (DNS record or HTTP resource).
- Confirmed factDecreasing Certificate Lifetimes to 45 Days, Let's Encrypt (ISRG, 2 Dec 2025)Let's Encrypt's own lifetime schedule (45-day opt-in profile from 13 May 2026), separate from the industry maximum.
- Confirmed factcert-daily-stats.tsv (data behind letsencrypt.org/stats), Let's Encrypt (ISRG), last row 2 Nov 20262 Nov 2026: 8,537,925 issued that day; 726,600,268 active certificates (the company's own counts).
- Confirmed factchrome-https-adoption.csv (labelled Google Transparency Report), Let's Encrypt (ISRG), last row 25 Oct 2026Share of pages loaded in Chrome over HTTPS by OS, week of 25 Oct 2026. Not 'percent of the internet'.
- Teaching simplificationToy numbers: p = 211, g = 2, a = 57, b = 143, VIZHOWOur arithmetic (pow(2,57,211) = 200, pow(2,143,211) = 112, shared key 146; 57 tries). Illustrative, not real keys.
- EstimateRSA vs elliptic-curve key size; 2^100, VIZHOW3,072 / 256 = 12 from NIST Table 2; 2^100 = 1.27 x 10^30 (our arithmetic on the 1976 paper's figure).