Protocol & Threat Model
Last updated: October 31, 2026 · Protocol version 1 (payload v2)
The short version
“The server stores only ciphertext” is a claim, and a claim is not evidence. This page is the evidence we can offer today: the exact protocol Nyktos runs, where your keys live, what our server can and cannot see, and the attacks this design does and does not survive. Where the honest answer is “we can’t stop that,” it says so. If you find a mistake on this page, tell us at [email protected] and we will fix the page or the code, whichever is wrong.
1. The protocol
Nyktos uses libsodium, a widely reviewed cryptography library. Nothing about the cryptography is hand-rolled or novel, and that is deliberate.
Identity. When you sign up, your browser generates two keypairs locally: an X25519 keypair for encryption and an Ed25519 keypair for signatures. Only the public keys are uploaded. The private keys are created on your device and never transmitted anywhere, in any form, ever.
Sending a message. For each message, your device:
- Builds a payload containing the text, a timestamp, the recipient’s public key, and a conversation identifier
- Signs the payload with your Ed25519 private key, so the recipient can prove it came from you
- Generates a fresh, one-time X25519 keypair used for this message only, and seals the signed payload to the recipient’s public key using NaCl box (X25519 + XSalsa20-Poly1305)
- Sends the server the ciphertext, the one-time public key, and a nonce. That is all the server ever holds
The payload is bound to both the recipient and the conversation. A ciphertext copied into a different chat, or addressed to a different person, fails verification and is rejected by the receiving client.
Groups. There is no shared group key. A group message is sealed separately for every member, exactly like a 1:1 message, and the server stores one ciphertext copy per recipient. Adding or removing a member never requires re-keying, and a member only ever holds ciphertext addressed to them.
Files and media. Photos, videos, and voice notes are encrypted on your device with a random one-time key (NaCl secretbox) before upload. That key is then sealed to each recipient using the message protocol above. File names and types travel inside the encrypted payload, never in plaintext. The server stores encrypted bytes it cannot open.
Calls. Voice and video are peer-to-peer over WebRTC, encrypted in transit by the browser. The connection offers that set a call up pass through our server and are signed with the caller’s Ed25519 key so the other side can verify who is calling.
2. Where your keys live
Your identity is stored in your browser’s local storage on each device you use. Two cases:
- No app-lock PIN: the identity is stored as plaintext data in local storage. Anything that can read that browser profile’s local storage can read your keys. This is stated plainly because it matters.
- App-lock PIN set: the identity is encrypted at rest with a key derived from your PIN (PBKDF2-SHA256, 260,000 iterations, AES-256-GCM). The app lock is then a real cryptographic boundary, not a screen that hides things. While the app is unlocked, the keys exist in memory so messages can be decrypted.
Moving to a new device. Nyktos has device-link codes. An already signed-in device produces a code containing your identity, encrypted with a password you choose (Argon2id key derivation, NaCl secretbox). The code expires after 10 minutes and is carried by you from one device to the other. The server never sees the code or the password.
Loss. There is no server-side recovery, by design: we cannot give your keys back because we never had them. If you lose every device and have no link code, you can sign up again, but you get a new identity, your contacts will see new keys for you, and your old messages stay sealed forever, including to you.
3. Verifying the person you are talking to
Nyktos uses trust on first use: the first public keys you see for a contact are the ones you trust. To defeat a man-in-the-middle, open the safety number in a chat and compare it with your contact through any other channel, a voice call or in person. The number is 60 digits derived from both people’s encryption and signing public keys using iterated BLAKE2b hashing, so both sides always compute the same number. If a contact’s keys ever change, for example they lost their device and rejoined, verify the new number again before trusting the chat.
4. What the server can see
Encryption protects content. It does not hide the shape of your activity from the service that routes it. Everything in this list is real, and we would rather lose you over it than hide it:
- Account data — email address, username, display name, bio, and your public keys
- Avatars — profile pictures are stored unencrypted and served from public links, so any profile lookup can show them
- Contact graph and groups — who your contacts are, group names, and member lists. Delivery is impossible without knowing where messages go
- Message metadata — who messaged whom, when, and the size of the ciphertext. Never the content
- Poll votes — the question and options travel inside the encrypted message, but each vote is stored as a bare option number next to your user id so the server can tally it. Who voted for which option is visible metadata
- Chat signals — reactions, read receipts, and typing indicators are metadata, not content
- Call setup — signaling data passes through the server and can reveal your IP address to us and network details to the person you are calling. Call audio and video never touch the server
- Login and visit records — IP address, approximate location, device type, and timestamps, kept so account break-ins can be spotted. You can review and wipe login records from the admin panel
- Crash reports — only if you tap send after a failure. Scrubbed before sending: error type, code locations, app version, operating system. Never messages, contacts, keys, or safety numbers
5. Threat model
A curious or hostile server operator (including us). Sees everything in section 4 and nothing else. Cannot read messages, open files, or listen to calls, and cannot forge a message from you that a recipient’s client will accept, because payloads are signed. Could attempt a man-in-the-middle by serving a new user false public keys, which is exactly what safety-number verification exists to catch.
A network observer (your ISP, coffee-shop Wi-Fi, a state firewall). Sees that you connect to Nyktos and when, protected in transit by TLS. Cannot see content or who you message.
Another user. Can only decrypt ciphertext addressed to them. Cannot read other people’s chats, transplant ciphertext between conversations, or impersonate you, because every payload carries your signature and is bound to its recipient and conversation.
Cross-site scripting (XSS) on our origin. This is the web’s weak point and we will not dress it up: script running on the Nyktos origin can reach local storage, so a successful XSS could steal identity keys (or read live messages while the app is unlocked), PIN set or not. Our defenses are a Content Security Policy, published in full in section 6 below including the parts that weaken it, and zero third-party scripts or analytics SDKs anywhere in the app.
A malicious browser extension. An extension you install with access to the Nyktos tab can read what the page can read. No web application can defend against a compromised browser, and any that claims otherwise is misleading you. Use a clean browser profile for sensitive conversations.
Someone holding your unlocked device. Can read your chats. The app-lock PIN exists for this case; lock the app when it matters.
Someone holding your locked device. With a PIN set, your identity is encrypted at rest (section 2) and stays sealed without the PIN. Without a PIN, assume your keys and history are readable to whoever holds the device.
6. Content Security Policy, in full
Section 5 names XSS as the web’s weak point, so here is the exact policy every Nyktos page is served with today. It is a response header, not a promise: open your browser’s developer tools on this page and read it yourself.
default-src 'self'; script-src 'self' 'unsafe-inline' 'wasm-unsafe-eval' https://accounts.google.com; style-src 'self' 'unsafe-inline'; img-src 'self' data: blob: https://*.supabase.co; media-src 'self' blob: data:; font-src 'self'; connect-src 'self' https://*.supabase.co wss://*.supabase.co https://accounts.google.com; frame-src 'self' https://accounts.google.com; frame-ancestors 'none'; form-action 'self'; base-uri 'self'; object-src 'none'
What the load-bearing parts do:
- script-src — scripts may only come from our own origin, plus Google for the sign-in flow. No analytics, no tag managers, no third-party widgets, anywhere
- connect-src — the page can only talk to itself, to Supabase (where the ciphertext lives), and to Google for sign-in. A script that somehow ran could not phone your data home to an arbitrary server
- frame-ancestors 'none' and object-src 'none' — Nyktos cannot be embedded in another site’s frame (clickjacking), and plugins are dead entirely
- base-uri 'self' and form-action 'self' — injected markup cannot quietly retarget the page’s links or forms
And the parts that weaken it, stated as plainly as the strengths:
- 'unsafe-inline' in script-src. The framework ships an inline bootstrap script, so inline code is currently allowed, and that blunts the policy exactly where it matters most: a future XSS bug would find the door less locked than it should be. The real fix is a nonce-based policy. This is a known, logged finding in our own audits, open as of this page’s date
- 'wasm-unsafe-eval'. libsodium, the cryptography library, runs as WebAssembly, and this keyword is what lets it compile. It permits Wasm compilation, not arbitrary JavaScript
- 'unsafe-inline' in style-src. Inline styles are allowed. CSS injection can deface a page; it cannot execute script under the rest of this policy
One boundary worth understanding: a CSP constrains code that gets injected into a page. It does nothing at all against the served-code problem in section 8, where the first-party code itself is the thing being trusted.
7. Crash reports: the stored sample
Section 4 says crash reports are scrubbed before anything is stored. Rather than asking you to believe that, here is the claim made checkable. We fed the production scrubbing code a crash report deliberately laced with things that must never survive: a fake private-key blob pasted into the user note, a session token sitting in a stack-trace URL, absolute URLs, line numbers, and a free-text breadcrumb. Below is exactly what the server stored, fingerprint and all, generated by running the same functions the live ingest route runs (the scrubbers in lib/crash-reporter.js, re-run server-side, plus the route’s own grouping fingerprint).
{
"fingerprint": "1366d280c612a151",
"error_type": "TypeError",
"top_frame": "decryptMessage (page-9f3c.js)",
"report_count": 1,
"affected_versions": [
"0.1.0"
],
"status": "new",
"sample_report": {
"message": "TypeError: Cannot read properties of undefined (reading 'map')",
"stack": "at decryptMessage (page-9f3c.js)\nat onMessage (482-77ab.js)\nat HTMLUnknownElement.callCallback (production.js)\nat sendMessage",
"component_stack": "at ChatWindow (page-9f3c.js)\nat main (main-app-01.js)",
"breadcrumbs": [
"app-mounted",
"opened-chat",
"sent-message"
],
"user_note": "crashed when I opened the chat. pasting my key like an idiot: [removed]",
"platform": {
"os": "Android",
"pwa": false
},
"app_version": "0.1.0",
"occurred_at": "2026-10-31T03:16:25.865Z"
}
}What to look for: the key-like blob in the note is gone, replaced with [removed]. The token is gone, because stack lines keep only a function name and a file name, no URLs, no query strings, no line numbers. The free-text breadcrumb never made it in, because breadcrumbs only accept a fixed format of simple action names. The error message survived only because it matched a known-safe shape; a message of any other shape is stored as [redacted]. One honest boundary: the note field is the sender’s own words. The scrubber strips key-like blobs from it, but words a person deliberately types are their own, so do not type secrets into it.
8. Known limits
- No forward secrecy against key compromise. Each message uses a fresh ephemeral key, but if your long-term private key is stolen, stored ciphertext addressed to you can be opened. Protocols like Signal’s double ratchet solve this; Nyktos does not implement one yet
- You must trust the code we serve. Like every web app, Nyktos delivers its JavaScript on each visit. A server operator determined to target one user could serve them altered code. Published source and reproducible builds are the real answers to this; neither exists yet
- Metadata exists. Section 4 is the whole list, and it is not empty
- Availability is not guaranteed. If our infrastructure is down or ordered shut, messages stop. The cryptography cannot fix that
9. Review status, stated plainly
Nyktos has been through repeated internal security audits of the cryptography, the API, the database rules, and the whole site, most recently in October 2026, which found no critical or high issues in the protocol core. Those audits were done by the same small team that builds Nyktos. There has been no independent third-party security review yet. An internal audit, however careful, is worth less than an external one, and we will not pretend otherwise. An independent review happens when the project can pay for one, and its results will be linked from this page either way.
Found something yourself? Report it via the contact in our security.txt or at [email protected]. Good-faith research is welcome; we would rather hear it from you than read about it later.