Application-Layer Protection over TLS
HTTPS protects data between the browser and the first server that ends the TLS connection. That's often a CDN or a proxy, not the app itself. This project plans an extra layer inside the app, so the data stays protected past that point and is harder to scrape, tamper with or replay.
Status: planning. There's no spec and no code yet. This page sets the scope so reviewers can push back early.
1Why
- TLS ends early. CDNs, load balancers and corporate proxies see requests in the clear. One misconfigured hop exposes everything.
- Bots read what browsers read. Readable JSON with clear endpoint names makes it easy to scrape, automate and abuse a public app.
- Stolen tokens travel. Without a key bound to the device, a copied token works anywhere. The QR login draft already fixes this one.
2Three parts, kept apart
| Part | What it does | Builds on |
|---|---|---|
| Encryption | Request and response bodies encrypted between the browser and the app's own keys, so hops in between see only ciphertext | HPKE (RFC 9180); the model of Oblivious HTTP (RFC 9458); JWE (RFC 7516) |
| Signing | Every request signed by a key bound to the device; replays refused | HTTP Message Signatures (RFC 9421); DPoP (RFC 9449) |
| Encoding and obfuscation | Opaque endpoint names, compact encoded payloads, rotating keys and names, scrambled client code | Common practice; no standard |
Obfuscation is a speed bump, not security. A design must stay safe if an attacker knows everything except the keys (Kerckhoffs's principle). Obfuscation only raises the cost of casual scraping and automation.
3Not in scope
- Replacing TLS. This layer sits on top of HTTPS, never instead of it.
- Inventing new cryptography. Only published, reviewed building blocks.
- Protecting a browser that's already compromised. If malware runs on the device, it sees what the user sees.
4Plan
- Threat model: who is in the middle (CDN, proxy, browser extension, scraper) and what each can see and change.
- Survey: what OHTTP, HPKE, Message Signatures and DPoP already cover, and what's left.
- Proof of concept on hackthis.alpq.us, reusing the QR login's device keys.
- Measure: added latency, payload size, and how much harder scraping really gets.
- Draft 0.1 for review, then a trial on a GOVW app that needs it most.
5Questions we'd like help with
- Where does the app's private key live so a CDN can't reach it, yet the app can still scale?
- How do browsers get the app's public key safely, and how often should it rotate?
- How much obfuscation is worth its cost in debugging and accessibility?