← Security blog

Client-side vs server-side encryption: what can the server see?

5 min read

Almost every service says it encrypts your data. That statement is only meaningful once you know where the encryption happens and who holds the key.

Server-side encryption

With server-side encryption, your data travels to the service over HTTPS, and the service encrypts it before storing it. This protects against someone stealing a hard drive or a database backup. But the server receives your data in readable form, at least briefly, and normally controls the key as well.

That means the operator, a malicious employee, or an attacker who compromises the running server could read your data.

Client-side encryption

With client-side encryption, your browser or app encrypts the data before it leaves your device, using a key the server never receives. The server stores only ciphertext. Even a complete copy of the server's database reveals nothing without the key.

One-Time Link works this way: the key is generated in your browser and travels only inside the link's fragment, which is never sent to the server.

A quick comparison

The honest limitation

Client-side encryption in a web page has a catch: your browser downloads the encryption code from the same server each time. A server that was fully compromised could, in theory, serve modified code that steals keys. Reducing this risk means keeping the code small, avoiding third-party scripts, using a strict Content Security Policy, and protecting the server carefully. For extremely sensitive material, you can also encrypt the content yourself before pasting it in.

When choosing a tool for secrets, ask two simple questions: does the server ever see the plaintext, and does it ever receive the key? The answers tell you what a breach could expose.