How End-to-End Encryption Protects Your Shared Images
What end-to-end encryption actually means for photos — in plain terms and then in technical detail. Learn how encrypted group rooms keep shared images private, even from the server.

On this page
"End-to-end encrypted" is one of the most used — and most misunderstood — phrases in tech. This article explains what it really means for images, first in plain language and then at a level a developer can act on.
The plain-language version
Imagine putting a photo inside a locked box before you send it. Only the people you chose have a key. The courier who carries the box, and the warehouse that stores it overnight, can see the box but can never open it. **That courier and warehouse are the server. The key-holders are you and your recipients.** End-to-end encryption means only the ends — the people — can open the box.
The defining property of end-to-end encryption: the service that stores or transmits your data cannot read it. It holds ciphertext and nothing more.
Why HTTPS alone is not enough
Almost every site today uses **HTTPS** (TLS). That encrypts data *in transit* — while it travels between your browser and the server — which stops eavesdroppers on public Wi-Fi or along the network path. This is essential, and PikDB uses it for every request.
But TLS has a boundary: once your data reaches the server, it is **decrypted there** so the server can process it. For a public image you *want* this — the server needs to serve the picture to anyone with the link. For private, members-only content, though, you may want the server itself to be unable to read it. That's where end-to-end encryption goes further.
| Property | HTTPS / TLS | End-to-end encryption |
|---|---|---|
| Protects against network eavesdroppers | Yes | Yes |
| Server can read the content | Yes | No |
| Keys held by | Server + client (session) | Only the endpoints |
| Best for | Serving public images | Private, members-only sharing |
How it works under the hood
Modern end-to-end encryption combines two kinds of cryptography. Here's the shape of it, without the heavy math:
- 1**Asymmetric keys for identity and key exchange.** Each member has a public key (shareable) and a private key (secret, never leaves their device). Public keys let members securely agree on a shared secret.
- 2**A symmetric content key for the actual data.** Images are encrypted with a fast symmetric cipher (such as AES-GCM). The symmetric key is what gets shared — securely — among members.
- 3**Encrypt on the device, upload ciphertext.** The image is encrypted *before* it leaves the sender's device. The server receives only the encrypted blob.
- 4**Decrypt on each recipient's device.** Members use their keys to recover the content key and decrypt the image locally. The server never sees the plaintext.
In an end-to-end encrypted group room, content is encrypted for the room's members. PikDB stores ciphertext and relays it, but the keys live with the members — so the shared images are readable only inside the room, not by the service.
A simplified mental model in code
This pseudocode is illustrative — real systems add key rotation, authentication, and forward secrecy — but it captures the core idea:
// 1. Each member has an asymmetric key pair
const { publicKey, privateKey } = generateKeyPair();
// 2. A random symmetric key encrypts the actual image
const contentKey = randomKey(); // e.g. AES-256
const ciphertext = aesGcmEncrypt(image, contentKey);
// 3. The content key is wrapped for each member's public key
const wrappedKeys = members.map(m =>
wrapKey(contentKey, m.publicKey)
);
// 4. Upload only ciphertext + wrapped keys. The server
// never receives 'contentKey' or the plaintext image.
upload({ ciphertext, wrappedKeys });
// 5. A recipient unwraps the key with their private key
const key = unwrapKey(myWrappedKey, privateKey);
const image = aesGcmDecrypt(ciphertext, key); // happens on-deviceWhat end-to-end encryption does — and does not — protect
Encryption is powerful but not magic. Being precise about its boundaries helps you use it wisely.
- ✅ **Protects content from the server and the network** — stored and relayed data is unreadable without keys.
- ✅ **Protects against most mass-surveillance and data-breach scenarios** — a stolen database yields only ciphertext.
- ⚠️ **Does not protect a device that is already compromised** — if malware is on an endpoint, it can read decrypted content there.
- ⚠️ **Does not hide the fact that communication happened** — metadata like timing may still exist unless separately minimised.
- ⚠️ **Depends on trusting the endpoints** — anyone you add to a room can, by design, read what's shared there.
The weakest link in any encrypted system is usually the human one. Only invite people you trust into a group room, and keep the devices you use up to date.
When should you use an encrypted room instead of a public link?
Use a **public direct link** when the image is meant to be seen widely and isn't sensitive — a meme, a product photo, a diagram for a blog. Use an **end-to-end encrypted group room** when the audience should be limited to specific people: personal photos, internal team assets, documents, or anything you'd be uncomfortable seeing indexed by a search engine.
Create a private, encrypted room
Share images with a specific group where only members hold the keys.
Frequently asked questions
Is end-to-end encryption the same as a password-protected link?
Does encryption slow things down?
Can I still download an encrypted image?
References & further reading
- PikDB data security policy
- Group rooms step-by-step guide
- AES-GCM (authenticated encryption) — Background reading
- Transport Layer Security (TLS) — How HTTPS protects data in transit