Skip to main content

Use arrow keys to navigate, Enter to select, Escape to close menu.

Client-Side Encryption vs End-to-End Encryption

The two labels answer different questions: client-side encryption names where the cryptography runs and who holds the key, while end-to-end encryption names who can read data along a path. Mixing them up leads to wrong assumptions about what a provider can see.

Two Labels, Two Different Questions

Location versus readable path

Encryption that runs on your own device, before data reaches anyone else, is client-side encryption. It keeps the key material in your hands rather than with the provider you send the result to. End-to-end encryption asks a narrower question: along the path from sender to recipient, who can read the plaintext?

The two ideas often overlap. A messenger that encrypts on your phone and decrypts on your friend's phone is both end-to-end and client-side. A web tool that encrypts a file locally and uploads only ciphertext is client-side, but nothing is end-to-end, because there is no second endpoint. One concept is about location. The other is about the readable path.

Try it: label a tool you use client-side, end-to-end, both or neither.

  • Client-side: cryptography and keys stay on your device
  • End-to-end: only the endpoints can read the plaintext
  • Both can be true at once, or only one of them

Who Holds the Keys

Derived, random, or held by an endpoint

In a client-side model, the key stays on your device and is never transmitted. You can derive it from a passphrase with PBKDF2, described in RFC 8018, or generate a random 256-bit key through the W3C Web Crypto API. Encryption then uses AES-256-GCM, standardized in FIPS 197 and NIST SP 800-38D. Whoever holds that key can decrypt the ciphertext.

In an end-to-end model, each endpoint holds its own key material, and the relay stores or forwards ciphertext it cannot read. Key agreement follows protocols such as TLS 1.3 (RFC 8446) or a double ratchet, and forward secrecy limits what one stolen key exposes. One practical difference: a client-side tool usually has no key directory, while an end-to-end system needs one for key discovery.

Try it: ask which key your tool uses, and who can export it.

  • Client-side: you create, store, and lose the key yourself
  • End-to-end: endpoints hold keys, the relay holds ciphertext
  • A client-side tool has no key directory to attack

Where the Threat Models Differ

Client-side adds the storage layer

End-to-end encryption is designed against interception and against an honest-but-curious relay. Anyone who records traffic or reads the operator's database gets ciphertext. Client-side encryption adds a second target: the storage layer. When a provider keeps your encrypted blob, a breach or a court order yields data that is useless without your key.

Neither model defends the endpoints themselves. If malware runs on the device where you type the passphrase, or if the page you loaded has been altered, the attacker sees plaintext and keys together. Most comparisons skip that part.

Try it: note which layer you need to protect.

  • End-to-end covers the path between endpoints
  • Client-side additionally covers stored ciphertext
  • Neither protects a device that is already compromised

The Real Limits of In-Browser Encryption

The runtime around the cipher is the weak point

A browser is a shared runtime. Any script that runs on the same origin can call the same Web Crypto API your tool uses, read your input fields, and send the result somewhere else. One cross-site scripting flaw or one over-privileged extension therefore matters more than the cipher does. You can check it yourself: open DevTools and run crypto.subtle.generateKey({ name: "AES-GCM", length: 256 }, true, ["encrypt", "decrypt"]). The true in the second argument makes the key exportable. Set it to false, and no script can export that key.

Extensions sit outside the page's control. A password manager, a screenshot tool, or a clipboard reader can capture what you typed before encryption runs. A powered-off device holds only ciphertext; an open session on a shared machine defeats the model, because encryption protects data at rest and in transit, not someone else's active session. OWASP's guidance on client-side storage makes the same point.

Try it: create a key with extractable false and try to export it.

  • Cross-site scripting can read plaintext before it is encrypted
  • Extensions with page access can log keystrokes and clipboard content
  • A shared machine with an open session defeats the model

Which Model Fits Which Situation

Two questions sort most cases

One-off tasks are where client-side encryption fits best: encrypting a file before upload, protecting a text snippet you will paste into an email, or working offline without an account. It fails as a backup strategy, because ciphertext without the key is gone, and it does nothing for an endpoint that is already compromised. End-to-end encryption fits ongoing conversations between identified parties, where keys must be discovered, verified, and rotated over time.

Two questions sort most cases. Does the data need to stay readable by someone else later? If not, client-side encryption with a key you control is simpler and removes the provider from your trust boundary. Does the data travel between two parties who both need to read it? Then you need an end-to-end design with key verification, and you must accept that the metadata around a message stays visible.

Try it: answer the two sorting questions for your own case.

SituationBetter fit
Local files, one-off text, offline workClient-side encryption with a key you control
Ongoing messaging between two identified partiesEnd-to-end encryption with key verification
Backups or an already compromised endpointNeither: encryption cannot substitute for a backup

Frequently Asked Questions

Is client-side encryption the same as end-to-end encryption?

No. Client-side encryption describes where the cryptography runs and who holds the key. End-to-end encryption describes who can read the data along the path between endpoints. A browser tool that encrypts a file locally is client-side, but nothing is end-to-end, because there is no second endpoint. A chat app can be both at once.

Does end-to-end encryption protect data stored on a server?

Only if the server stores ciphertext that the endpoints encrypted and if the keys never reach it. Many messaging systems encrypt in transit and at rest with keys the provider can access, which is transport encryption rather than end-to-end encryption. Check whether the provider can rotate or recover your keys. If it can, the design is not end-to-end.

Can a browser extension break client-side encryption?

Yes. An extension allowed to read and modify page data can capture input before encryption and can call the same Web Crypto API the page uses. Cross-site scripting has the same effect. The cipher is not the weak point; the runtime around it is. For high-value keys, use a device with few extensions, or an application outside the browser.

Try Client-Side Encryption Yourself

Encrypt text or files in your browser with AES-256-GCM. The keys stay on your device.