JZ
Back to overview
ResearchTechnical reportSecurityNovember 2026

Nullbin

Ephemeral Encrypted Sharing and Bounded Group Messaging with a Small Trusted Base

Abstract

Encrypted pastebins usually stop at client-side encryption: they leak payload length and require trusting the server that delivers their JavaScript. End-to-end encrypted messengers, in turn, depend on accounts, databases, and large, highly complex codebases. I present Nullbin, a self-hostable system that combines expiring encrypted text and file sharing (Paste) with memory-only, forward-secret group chat (Null Chat). A single Go server with no database and no third-party Go dependencies never sees plaintext or keys, storing only ciphertext, hashes of capability tokens, and the operational metadata needed to enforce expiry and limits. A static pure-Go CLI and library (nullbin-cli) also offers the Paste protocol, eliminating the need for browser JavaScript. Nullbin's design puts security first and simplicity second, and covers five trust boundaries: (1) Padmé-padded streaming XChaCha20-Poly1305 encryption, with a pure-Go libsodium-compatible implementation checked against shared test vectors; (2) a bounded group chat protocol (2–20 members) with equivocation detection, four ProVerif models, and a malicious-server fuzzer; (3) a standard-library-only backend with hard quotas, IPv6 /48-aware rate limits, and fair bandwidth sharing; (4) matching hostile-content defenses in the browser and the terminal; and (5) reproducible builds and Sigstore-verified updates. I quantify Padmé overhead and Null Chat capacity, and report which design changes came out of adversarial review by a swarm of AI agents.

1Introduction

Engineers, incident responders, and journalists often need to exchange short-lived secrets such as API credentials, diagnostic logs, and key material, or to coordinate briefly, without creating accounts, running databases, or trusting a third-party service with information in plaintext. Existing end-to-end encrypted (E2EE) tools fall short of this in different ways. Lightweight browser pastebins (e.g., PrivateBin [13], Firefox Send [14]) keep a random key in the URL fragment and encrypt in the browser, but they leak payload length (exactly, or after compression, as in PrivateBin's unpadded zlib-then-AES-GCM format), and their users must trust the frontend host not to serve malicious JavaScript (a native client such as ffsend [15] removes that trust, but not the length leak). Hostile content is a further risk for any such tool: a decrypted payload can target image decoders, the DOM, or a terminal, for example with Trojan Source [3] characters. At the other end, full-featured E2EE messengers such as Signal [16] and Matrix [19] deliver strong group cryptography with forward secrecy (only “partial” in Matrix's Megolm), but tie it to persistent identities, server databases, account systems, and large dependency graphs. This trusted computing base (TCB) is much larger than a short-lived, self-hosted sharing tool requires. MLS [11] standardizes scalable group key agreement, though it is a protocol and not an application (§10).

Nullbin takes a different route, designing Paste and Null Chat as one system, from the wire formats and protocol models to the clients and deployment tooling. Paste hides payload size and can be used without browser JavaScript through nullbin-cli; Null Chat targets small, short-lived rooms with a fixed membership cap and memory-only server state.

Design Philosophy. Nullbin's design follows a strict priority order: security first, then simplicity. Whenever a feature creates ambiguous cryptographic revocation semantics or unbounded server state, Nullbin forbids the combination outright, for example by mutually excluding encrypted discussions from burn-after-reading and per-recipient links, never reusing Null Chat slots, and bounding every paste, room, comment, and rate-limit table. The result is a thin-server, thick-client architecture: the Go backend is a small, zero-dependency ciphertext store and resource-isolation boundary (6,183 non-test LOC across 20 files), while nearly all cryptographic, protocol state-machine, parsing, and verification logic runs client-side, mostly in the user's browser (10,548 non-test LOC of TypeScript) and, for Paste workflows, in nullbin-cli.

Development Process. Nullbin was largely implemented with the help of AI coding agents, mainly using Gemini 4 Neon and Claude Opus 5.5 through Antigravity and Claude Code (respectively), which contributed to the initial code and took part in hardening. Adversarial security review, penetration testing, and vulnerability hunting relied mainly on the GLM 5.3 and DeepSeek V4.1 Flash 1017 open weight models, and many of the mechanisms in §8 came out of those rounds. Working this way not only allowed for rapid development, but also let a single developer run many cycles of review, fix, and retest.

Contributions. This paper describes the design, protocol models, and implementation of Nullbin across nullbin-server (v0.6.1, commit 180413c) and nullbin-cli (commit 99ed6e0):

  1. Cross-Runtime Paste Protocol (§3): A Padmé-padded streaming AEAD format (v2) with password-augmented BLAKE2b/Argon2id key derivation, per-recipient revocable capability links, deterministic stored ZIP bundling, and a zero-CGO pure-Go libsodium implementation verified byte-for-byte against browser-generated canonical test vectors.
  2. Null Chat v3 & Protocol Models (§4): A memory-only forward-secret group chat protocol using separate room/roster keys, dual inner/outer Ed25519 signatures for cloned-tab detection, hash-chained prev commitments and standalone 20-slot seen receipts for fork detection, Paste-bridged attachments, four ProVerif models of the protocol's core (covering split detection only partially), and a deterministic malicious-server fuzzer.
  3. Minimal-TCB Backend Engineering (§5): A zero-third-party-dependency Go server combining os.Root filesystem confinement, durable pre-send burn reservations, IPv6 /48 site-aware quotas, a 250 ms fair bandwidth scheduler, credential-partitioned room rate limits, and zero-identifier logging.
  4. Client Hardening in Browser and Terminal (§6): A side-by-side account of how the browser client and nullbin-cli handle hostile content.
  5. Supply Chain and Hardening (§7–§8): Embedded source-provenance checks, egress-isolated distroless containers, a Sigstore/Gitsign-verified host updater, and the design changes that came out of AI-agent adversarial review.

2Threat Model and Trust Boundaries

Nullbin is fully open source, and no security guarantee relies on code secrecy. I model eight adversaries (A1–A8) and three deployment/client topologies: Option A (single host, separate distroless frontend/proxy and internet-isolated API containers), Option B (independently hosted static frontend with build-time-pinned NULLBIN_API_ORIGIN, plus API-only server), and nullbin-cli (locally verified static Go binary speaking directly to the API), illustrated in Figure 1 and summarized in Table 1.

Three deployment topologies. Option A: a browser client talks over HTTPS to Caddy, which forwards API requests to the Nullbin server and its data volume on a single host. Option B: the browser loads assets from an independent static host and sends API requests to a separate Caddy proxy and Nullbin API. nullbin-cli speaks HTTPS directly to any Nullbin API.
Figure 1: Deployment topologies and trust boundaries: Option A (single host), Option B (independently hosted frontend), and nullbin-cli.
Table 1: Adversary model and residual trust across Nullbin deployment and client topologies.
IDAdversary & CapabilitiesOption A (Web)Option B (Web)nullbin-cli
A1Passive network observer (TLS expected in production)Content protected†^\daggerContent protected†^\daggerContent protected†^\dagger
A2Anonymous internet client (arbitrary HTTP, DoS, CSRF)DoS bounded, not prevented‡^\ddaggerDoS bounded‡^\ddaggerDoS bounded‡^\ddagger
A3Storage attacker (reads data dir, snapshots, backups)Content protected; metadata visible^\PContent protected^\PContent protected^\P
A4Honest-but-curious operator (reads RAM, logs, disk)Content protected; sees R2Content protected; sees R2Content protected; sees R2
A5Compromised API host / malicious server operatorTrusted for JS (R1)API isolated from JSR1 eliminated
A6Link observer (history, chat logs, screenshots)Mitigated w/ password (R3, R6)Mitigated w/ passwordMitigated w/ password§^\S
A7Malicious paste/chat author (XSS, decoders, TTY, path)Browser hardened (§6)Browser hardened (§6)CLI/OS hardened (§6)
A8Supply-chain attacker (deps, CI, releases, base images)Reproducible + SigstoreReproducible + SigstoreStatic Go + Cosign OIDC

†^\daggerTLS + E2EE in the browser, fail-closed TLS + E2EE in the CLI. This covers content only: a network observer still sees client IPs, traffic sizes, and timing (R2). ‡^\ddaggerPer-client, per-/48, and global limits bound what one network can consume (Table 4); an attacker with enough addresses can still exhaust pending slots, room slots, and storage quotas. ^\PCiphertext and token hashes only; padded sizes, creation/expiry times, and burn/recipient counts in meta.json remain readable (R2), and an attacker who can write the data directory can alter that unauthenticated metadata (R21). §^\S--url-stdin additionally keeps links out of argv and process listings; it does not protect a link already exposed in chat logs, history, or screenshots.

Residual Risks and Non-Goals. Nullbin's published threat models list the following risks, which cryptography alone cannot remove:

  • R1 (Malicious frontend JS): In browser modes, whoever controls the frontend host, DNS, or publishing credentials can serve targeted malicious JavaScript. Option B isolates this from API compromise; nullbin-cli eliminates R1 entirely.
  • R2 (Metadata): The API observes padded sizes, creation/expiry times, burn/recipient open counts, chat slot timing, and client IPs (network anonymity is a non-goal; use Tor/HTTPS_PROXY).
  • R11 (Browser memory): When a page is left, the browser client zeroes the byte arrays it owns (e.g., a verified attachment) and clears the DOM, but other copies of decrypted data, such as frame buffers, the metadata, and libsodium's working memory, are not zeroed and remain until the browser reclaims them. Complete zeroization of browser memory is not guaranteed.
  • R3/R6 (Link handling & weak passwords): Anyone holding the full link (and any password) can read and burn a paste; links leak through chat logs, history, clipboard sync, and screenshots. A password helps only if the link leaks without it, and Argon2id cannot save a weak password once the fragment is known.
  • R4/R12/R24 (Server-enforced lifecycle): Expiry, burn limits, and per-recipient revocation rely on an honest API; interrupted burn transfers consume an open; revoking a link cannot recall a copy its holder already downloaded.
  • R17 (No sender authentication or key commitment): Pastes are unauthenticated among key holders, and XChaCha20-Poly1305 does not commit to its key [10], so a creator could craft a blob that decrypts differently under two passwords (misleading only their own readers).
  • R25 (Null Chat limits): Rooms live only in server memory and end on expiry, self-destruct, or restart; the server sees slot timing and record sizes, and can withhold, delay, or reorder any record. A leaked used invite plus its join proof permits offline guessing of a room password, and a leaked unused invite lets its holder take the slot before the invitee does. A malicious server can show a late joiner an outdated receiving key of another member, so that anyone who later steals that member's old secret can read what the joiner sends (a forward-secrecy gap). Any member can end the room or fill its 1,000-record budget. Equivocation detection is limited: receipts are each member's own word, so a receipt conflict cannot tell a split history from a false receipt and names both parties; a server that also hides receipts from members, a tab closed before it sends any, or a room past 800 records (where standalone receipts stop) can leave a split unseen.
  • R5/R8/R21 (Endpoint & storage write compromise): Local malware, OS swap/snapshots, Go GC retention of immutable strings and of abandoned slice backing arrays (e.g., a password line over 128 B outgrows its initial buffer before zeroing), and an attacker who can write the server's data directory (modifying unauthenticated metadata) are outside the cryptographic boundary.

3Paste Protocol, Padmé Framing, and Pure-Go Parity

3.1Key Hierarchy and Capability Separation

Each paste starts with a fresh 256-bit link secret Kfrag←{0,1}256K_{\text{frag}} \leftarrow \{0,1\}^{256} carried exclusively in the URL fragment (#...), which browsers never transmit over HTTP and which main.ts removes immediately via history.replaceState. An optional password pwpw, stretched with Argon2id [6], augments rather than replaces KfragK_{\text{frag}}. Passwords need at least 8 characters (at the pinned commits the browser counts UTF-16 code units and the CLI counts code points; a later server commit switches the browser to code points), and the built-in generator emits 20 unambiguous characters from a 56-character alphabet (≈116\approx 116 bits, by rejection sampling):

Spw=Argon2idv1.3 ⁣(NFC(pw), salt16,t=3, m=256 MiB, p=1)Kmaster={BLAKE2b-256Kfrag(Spw)if password set,Kfragotherwise.\begin{align*}S_{\text{pw}} &= \text{Argon2id}_{\text{v1.3}}\!\bigl(\text{NFC}(pw),\, \text{salt}_{16},\\[-2pt] &\qquad\qquad\qquad\quad t{=}3,\, m{=}256\text{ MiB},\, p{=}1\bigr) \tag{1}\\ K_{\text{master}} &= \begin{cases} \text{BLAKE2b-256}_{K_{\text{frag}}}(S_{\text{pw}}) & \text{if password set},\\ K_{\text{frag}} & \text{otherwise}. \end{cases} \tag{2}\end{align*}

Because KfragK_{\text{frag}} keys BLAKE2b in Eq. (2), offline password guessing against stolen ciphertext (A3) is impossible without first obtaining the link fragment. Five domain-separated 32-byte subkeys are derived via libsodium's crypto_kdf_derive_from_key(32,1,ctx,Kmaster)(32, 1, \text{ctx}, K_{\text{master}}):

  • nbstream: XChaCha20-Poly1305 secretstream encryption key;
  • nbcmtenc: encrypted discussion comment AEAD key;
  • nbcmtacc: 43-char base64url comment access token;
  • nbburnac: burn-read access token (for POST /read);
  • nbrcptac: parent key KrcptK_{\text{rcpt}} (never transmitted) for per-recipient tokens.

For a paste with k∈[2,20]k \in [2, 20] separate revocable links, each link ii carries an independent 128-bit secret rir_i in its fragment (#<key>[.b].r<r_i>) and derives its API capability token as

Ti=b64u ⁣(BLAKE2b-256Krcpt(ri)).T_i = \text{b64u}\!\left(\text{BLAKE2b-256}_{K_{\text{rcpt}}}(r_i)\right).
(3)

Thus opening link ii requires KfragK_{\text{frag}}, any password pwpw, and rir_i; a revoked recipient cannot compute another recipient's token even though all links share KfragK_{\text{frag}}. The server stores only SHA-256 hashes of all capability tokens (including server-issued 256-bit upload and delete tokens) and compares them in constant time. Delete links carry a mandatory #d. prefix (/d/<id>#d.<tok>[.r]) so a view link edited to /d/ can never transmit its decryption key to the server.

3.2Wire Format v2 and Padmé Size Padding

To prevent length-oracle leakage of short secrets and hide whether a paste contains text or an attachment, v2 blobs pack metadata, optional file bytes, and canonical zero padding into a single secretstream plaintext stream, encrypted with libsodium's XChaCha20-Poly1305 construction (the extended-nonce variant of RFC 8439's ChaCha20-Poly1305 [5], described in an expired IRTF Internet-Draft [9] rather than an RFC):

Stream=u32BE(∣meta∣)∥metaJSON∥fileBytes∥0P(n,m)−n,\begin{gathered}\text{Stream} = \text{u32BE}(|\text{meta}|) \mathbin{\|} \text{metaJSON} \\[-2pt] \mathbin{\|} \text{fileBytes} \mathbin{\|} 0^{P(n, m) - n},\end{gathered}
(4)

where n=4+∣meta∣+∣file∣n = 4 + |\text{meta}| + |\text{file}| and P(n,m)P(n, m) applies a minimum floor mm (m=16 KiBm = 16\,\text{KiB} for pastes, 4 KiB4\,\text{KiB} for comments) followed by Padmé rounding (Nikitin et al. [1]):

P(n,m)={mif n≤m,⌈n2e−s⌉2e−sotherwise,P(n, m) = \begin{cases} m & \text{if } n \le m,\\ \left\lceil \dfrac{n}{2^{e - s}} \right\rceil 2^{e - s} & \text{otherwise}, \end{cases}
(5)

with e=⌊log⁡2n⌋e = \lfloor \log_2 n \rfloor and s=⌊log⁡2e⌋+1s = \lfloor \log_2 e \rfloor + 1. Every non-final frame carries exactly C=64 KiBC = 64\,\text{KiB} of plaintext (TAG_MESSAGE), and the final frame carries 1…64 KiB1 \dots 64\,\text{KiB} (TAG_FINAL). With 46 header bytes (22-byte public prefix authenticated as Frame 1 AAD + 24-byte secretstream header) and 21 bytes per frame (4-byte big-endian length + 1-byte tag + 16-byte Poly1305 MAC), the exact ciphertext size depends solely on P(n,m)P(n, m):

B(n)=46+P(n,214)+21⋅⌈P(n,214)65,536⌉.B(n) = 46 + P(n, 2^{14}) + 21 \cdot \left\lceil \frac{P(n, 2^{14})}{65{,}536} \right\rceil.
(6)

Counting distinct outputs of Eq. (5) up to 100 MiB100\,\text{MiB} yields 1+2⋅24+10⋅25+18=3711 + 2\cdot 2^4 + 10\cdot 2^5 + 18 = \mathbf{371} padded stream sizes (log⁡2371≈8.54\log_2 371 \approx 8.54 bits), of which 370\mathbf{370} fit within the default 100 MiB100\,\text{MiB} wire limit (max 98 MiB98\,\text{MiB} stream; 8.53 bits); within the 2 GiB2\,\text{GiB} hard wire ceiling, 1+2⋅24+15⋅25−1=5121 + 2\cdot 2^4 + 15\cdot 2^5 - 1 = \mathbf{512} valid blob sizes exist (exact 9.00 bits; 513 padded stream sizes through 2 GiB2\,\text{GiB}). Readers strictly verify canonical Padmé length, all-zero padding bytes, frame fullness, TAG_FINAL, and absence of trailing bytes. Table 2 summarizes all wire formats across Nullbin.

Table 2: Canonical wire formats and URL fragment grammars across Paste, Comments, and Null Chat.
ArtifactVer.Binary Layout / Fragment GrammarMin. Size
Paste Blobv2"NBN1"(4) ∥\| 0x02(1) ∥\| flags(1) ∥\| salt(16) ∥\| ss_hdr(24) ∥\| frames[len(4) ∥\| ct] (AAD1_1=bytes 0..21)16,451 B
Commentv20x02(1) ∥\| nonce(24) ∥\| AEAD(len(4) ∥\| JSON ∥\| zeros, min 4 KiB; AAD="nullbin comment v2 <id>")4,137 B
Chat Controlv10x01(1) ∥\| nonce(24) ∥\| AEAD(len(4) ∥\| JSON ∥\| sig(64) ∥\| zeros, min 1 KiB; key=CKctlCK_{\text{ctl}})1,065 B
Chat Messagev30x03(1) ∥\| gen(4) ∥\| idx(4) ∥\| nonce(24) ∥\| AEAD(len(4) ∥\| JSON ∥\| sig(64) ∥\| zeros, min 2 KiB) ∥\| outer_sig(64)2,161 B
Boxed Namev1b64u(nonce(24) ∥\| AEAD(pad160(name), key=RORO, AAD="nullbin room name v1 <r> <k> <s>"))200 B (267 ch)
View Link—/p/<id32>#<key43>[.b][.r<secret22>]—
Delete Link—/d/<id32>#d.<delToken43>[.r]—
Chat Invite—/r/<id32>#<rk43>.i<invTok43>.c<pk0_43>.s<invSec43>.n<1..19>[.p]—

3.3Pure-Go Libsodium Parity and Deterministic Stored ZIP

To avoid CGO, which keeps static cross-compilation reproducible (CGO_ENABLED=0 -trimpath -buildid=) and keeps C memory-safety issues out of the binary, nullbin-cli implements three narrow cryptographic components in pure Go alongside golang.org/x/crypto:

  1. Parameter-block BLAKE2b-256 (crypto/blake2b.go): Exposes RFC 7693's [4] 16-byte salt and 16-byte personalization block absent from x/crypto/blake2b, matching crypto_kdf_derive_from_key.
  2. Constant-time 64-bit Poly1305 (crypto/poly1305.go): Branchless limb reduction modulo 2130−52^{130}-5 verified against RFC 8439 [5] §2.5.2.
  3. Libsodium secretstream (crypto/secretstream.go): Implements [12] HChaCha20 initialization, INONCE XOR-chaining, automatic 32-bit counter-wrap rekeying, MAC-before-decrypt verification, and libsodium's non-standard per-frame Poly1305 padding length (0x10 - 64 + mlen) & 0xf == mlen & 0xf.

Multi-file pastes (2–100 files) are packed in-browser (web/src/zip.ts) and in the CLI (format/zip.go) into an uncompressed (method 0, Store) deterministic ZIP archive (DOS date 1980-01-01, mode 0644, zero extra fields, NFC case-insensitive deduplication, Windows device-name prefixing) so exact blob sizes are known prior to encryption. All KDF outputs, v1/v2 blobs, Padmé edge sizes, link fragments, and multi-file ZIP archives are generated by the browser implementation in nullbin-server and checked byte-for-byte by the CLI test suite against testdata/vectors/nullbin_vectors.json.

4Null Chat v3 Protocol and Formal Models

4.1Bounded Room Model and Key Separation

Null Chat provides ephemeral, memory-only group messaging for N∈[2,20]N \in [2, 20] participants, capped at 20 lifetime slots (slot 0 is the creator; slots are never reused) and 1,000 total records (4 MiB max). Choosing a bounded custom protocol over full MLS (RFC 9420) trades multi-thousand-user TreeKEM scalability for a small, auditable state machine amenable to symbolic verification.

Control records (v1) are encrypted under CKctl=KDF(RK,"nbroomen")CK_{\text{ctl}} = \text{KDF}(RK, \texttt{"nbroomen"}), where RKRK travels in invite links. To ensure an invite holder learns no human names, labels, or room title, those fields are double-encrypted (zero-padded to 160 B) under a separate roster key RORO, sealed to each admitted member's X25519 [7] key inside the creator's Ed25519-signed [8] admit. Before admission, a joiner seals their name to the creator's public name key NKNK bound to (room,j,pkj,bj)(\text{room}, j, pk_j, b_j), where bjb_j is the joiner's initial X25519 key.

Admission enforces client-side invariants even against a Byzantine server:

  • Invite & Password Proofs: A joiner proves possession of the 32-byte per-invite secret ISjIS_j (never sent to the server) via

    proofj={H32(“v1”⟨r,j,pkj,bj⟩,ISj),no pw,H32(“v2”⟨r,j,pkj,bj⟩,ISj∥PK),pw set,\text{proof}_j = \begin{cases} \text{H}_{32}(\text{``v1''}\langle r,j,pk_j,b_j\rangle,IS_j), & \text{no } pw,\\ \text{H}_{32}(\text{``v2''}\langle r,j,pk_j,b_j\rangle,IS_j{\|}PK), & pw\text{ set}, \end{cases}
    (7)

    where PK=Argon2id(NFC(pw), H16(“salt”∥r))PK = \text{Argon2id}\bigl(\text{NFC}(pw),\, \text{H}_{16}(\text{``salt''}\|r)\bigr) (with full domain prefixes "...v1 ", "...v2 ", and "...salt v1 "). In password-protected rooms, a failed proof closes the slot immediately (one guess per invite).

  • Byzantine Server Defenses: Every client independently enforces the creator's signed member cap max; the creator rejects joins first seen >10>10 min past signed invite expiry exp; two distinct valid joins for the same slot trigger immediate slot closure (contested); pending tokens can post only one immutable join announcement and cannot self-destruct the room; low-order X25519 keys are rejected via boxKeyOk.

4.2Forward Secrecy, Dual Signatures, and Equivocation Detection

Each member maintains a Signal-style [16] sender key chain (g,i,CK)(g, i, CK) advancing per message via MK=KDF(CK,"nbrmmsgk")MK = \text{KDF}(CK, \texttt{"nbrmmsgk"}) and CK′=KDF(CK,"nbrmnext")CK' = \text{KDF}(CK, \texttt{"nbrmnext"}), immediately zeroing used keys. Chains restart from fresh randomness on member removal and every 50 messages (ROTATE_AFTER). Deliveries (keys) seal CKCK to each member's current numbered X25519 receiving key Bt,nB_{t,n} bound to (room,s,g,i,t)(\text{room}, s, g, i, t) together with a 16-byte commitment H16("...commit v1 "⟨r,s,g,i⟩,CK)\text{H}_{16}(\texttt{"...commit v1 "}\langle r,s,g,i\rangle, CK). Receiving keys rotate via signed box records at most every 3 min after opening a delivery, deleting retired secrets after a 2 min grace period.

Version 3 message records carry two Ed25519 signatures (inner and outer) and support three integrity mechanisms:

  1. Outer Signature (outer_sig): Verified before decryption, enabling (a) cloned-session detection (cloned) when a tab sees a record signed with its own key whose signature hash it never recorded before posting (despite having deleted its own message key), and (b) monotonic (gen, index) enforcement over unreadable chains.
  2. Hash-Chained prev Commitments: Every chat record commits to prev = {gen, index, h} with h=b64u(H16(JSON(prev_rec)))h = \text{b64u}(\text{H}_{16}(\text{JSON}(\text{prev\_rec}))) (or null for a sender's first record). A sender who forks two members at (g,i)(g, i) and later writes to both contradicts one branch under their own signature, raising a non-repudiable split alarm naming only the sender.
  3. Standalone 20-Slot seen Receipts: Every msg (and idle seen record emitted after 2 min idle, ≤1/10\le 1/10 min, off past 800 records, padded to the same 2 KiB floor) embeds causal receipts for all 20 slots, opaque to the server. Receipt conflicts raise forkNotes naming both claimer and author, since a split history and a false receipt look the same; a server that withholds receipts can delay or prevent this warning (R25).

Paste-Bridge Encrypted Attachments (room-files.ts). Optional chat files are uploaded as standard v2 pastes on disk whose expiry is constrained to end ≥60\ge 60 s before the chat (re-verified immediately before finalize). The paste ID, 256-bit key, sanitized name, and exact size travel inside the signed chat message; recipients fetch only on click and cross-check authenticated paste metadata against the signed card.

4.3ProVerif Models and Adversarial Fuzzing

Null Chat's core is modeled in ProVerif 2.05 [2] across four scenarios where the attacker controls the server and always holds RKRK: outsider.pv, member.pv (attacker is admitted in slot 3), password.pv (attacker holds Alice's leaked invite link without pwpw), and split.pv (v3 prev-hash fork detection). Every scenario includes positive reachability sanity queries (which must return false with an honest trace) and was validated against negative mutations (removing individual signature, binding, or proof checks causes ProVerif to exhibit attacks). Table 3 summarizes all verified properties; its goal labels G1–G6 are the Null Chat goals of ROOM_PROTOCOL.md (message secrecy, sender authenticity, admission integrity, forward secrecy, fork detection, roster secrecy) and are distinct from the Paste threat model's goals G1–G9 (e.g., G9 in §7). The models abstract the implementation: primitives are ideal (Argon2id included); each chain goes to two members and carries one message (chain stepping is modeled only for forward secrecy); the creator does not send; and member limits, invite lifetimes, removal, receiving-key numbering, padding, and the UI warnings are left to unit tests and the fuzzer. split.pv bounds an honest history to three records for termination. Its substantive results concern the stateful reader: no reader warns about an honest sender, what a reader accepts as that sender's is what the sender made, and all readers see one history at each place. Its detection query is much weaker: it is checked on a separate two-record reader process that emits the warning itself whenever the hashes differ, so it holds largely by construction and only confirms the local prev-hash comparison. ProVerif does not establish that the stateful reader, or receipts across readers, detect every split; checking detection against the stateful reader does not terminate, so multi-reader equivocation detection rests on the unit tests and the fuzzer. The results are therefore guarantees about the models, not proofs about the TypeScript code. Beyond the symbolic models, a seeded adversarial fuzzer (room-fuzz.test.ts) simulates a malicious insider controlling the server injecting 20 forgery/tampering classes across honest rooms, asserting zero unauthorized admissions, zero message forgery, and monotonic chains. It also asserts that no honest member is accused of handing out different keys, of sealing to a stale key, or of false receipts. It does not exclude two weaker warnings: the server, by reordering records, can raise an “out of order” warning about any member (the warning says the server may be the cause), and a receipt conflict names both the member whose receipts disagree and the sender at that place, one of whom may be honest.

Table 3: ProVerif 2.05 verification results across all four Null Chat models (proverif/).
GoalVerified Propertyoutsidermemberpasswordsplit
G1/G4Message secrecy, incl. forward secrecy after phase 1 device theft (one query: attacker(secretMsg))HoldsHolds†^\daggerHolds—
G2Sender authenticity (Received ==> Sent)HoldsHoldsHolds—
G3Admission integrity (Admitted ==> Joining)HoldsHoldsHolds—
G3Tab key binding (AcceptMember ==> Joining)Implied (not queried)HoldsHolds—
G6Roster key secrecy (all names/labels hidden)HoldsN/A‡^\ddaggerHolds—
PWPassword secrecy (attacker(pw))——Holds—
PWOffline resistance (weaksecret pw)——False∗^\ast—
G5No framing of honest sender (Split(rd, sA))———Holds
G5Transcript authenticity & one history (Took/Prev)———Holds
G5Local prev-hash check on a two-record reader (Followed ==> Split; holds by construction§^\S)———Holds
—Sanity reachability (honest run & malicious catch trace)VerifiedVerifiedVerifiedVerified

†^\daggerModel excludes attacker slot 3 from secretMsg's chain (in production every active member receives all chains). ‡^\ddaggerAttacker is an admitted member. ∗^\astExpected per R25: a leaked used link + join proof permits offline Argon2id guessing. §^\SThe reader process in this query emits Split whenever the hashes differ, so the query confirms only that local comparison; detection by the stateful reader and by receipts is tested, not proved.

5Minimal-TCB Backend Engineering

nullbin-server performs no content cryptography and parses no plaintext, attachment, or chat semantics. It uses only the Go standard library (Go 1.25+) and keeps no database, accounts, or access logs. Its runtime footprint divides into durable ciphertext storage (internal/storage, 2,167 LOC), HTTP and DoS isolation (internal/server, 2,467 LOC), and a single-file memory-only relay for opaque Null Chat records (internal/rooms/rooms.go, 776 LOC, against 5,816 LOC of Null Chat cryptography, state verification, and UI in the browser).

5.1os.Root Storage, Burn Atomicity, and Quota Accounting

Every filesystem operation runs through an os.Root [26] handle opened on the validated data directory (dedicatedDir rejects symlinks and non-empty foreign directories). Paste IDs are 128-bit lowercase hex strings checked before touching disk.

  • Dual Burn Durability: Single-open burn pastes perform an atomic os.Root.Rename from pastes/<id> to claimed/<id>-<rand> followed by fsync on both directories before streaming byte 0. Multi-open and per-recipient pastes acquire a per-paste lock (idLock, reference-counted and deleted when idle), reload meta.json, increment reads_used, and durably commit via temp-file →\to fsync →\to rename →\to syncDir before returning the reader.
  • Streaming & Unlinked-Reader Quotas: Creating an upload charges only 32 KiB entryOverhead; AppendChunk resizes the allocation in 1 MiB segments as bytes actually arrive (rolling back on error). Deleted pastes with active downloads keep their quota charged until allocation.readers == 0. Unreadable startup directories fail closed by charging MaxBytes while leaving operator recovery (nullbin delete) functional.
  • Rollback Safety & Trapped-Dir Resilience: Unknown JSON fields yield ErrNewerFormat (kept unserved until expiry rather than deleted as corrupt). openRegular rejects symlinks and blocking FIFOs via Lstat + IsRegular() before opening (a check-then-open that assumes no concurrent writer to the data directory, consistent with R21), and stats.go caps additions at math.MaxInt64.

5.2IPv6 /48-Aware DoS Controls, Fair Bandwidth, and Privacy Logging

Because free IPv6 tunnel brokers grant attackers entire /48 prefixes (65,536 /64s), Nullbin couples per-client limits (IPv4 /32 or IPv6 /64) with 4×4\times /48 site caps across rate limiters, upload pools, pending trackers, and rooms, and 2×2\times caps on download and chat long-poll slot pools (Table 4). Client buckets are checked first and refunded if the /48 denies, preventing one noisy /64 from starving its neighbors. Limiter tables cap at 100,000 entries and fail closed, keying buckets by an ephemeral per-process HMAC-SHA256 of the IP prefix (never raw IPs).

Fair-Share Bandwidth and Decoupled Concurrency Gates. Global download bandwidth (16 MiB/s) is scheduled by fairBudget in 250 ms windows, granting an equal share to every active or waiting network (counting an IPv6 /48 as one network) so bulk downloads cannot stall chat polling or small pastes. bandwidthWriter wraps minRateWriter so slow-client cutoffs (32 KiB/s after 2 min grace) count only time blocked on the client socket, never server-side throttling waits. Room API requests partition rate-limit budgets by verified credential (owner and member/pending vs. roomStrangers, plus a dedicated roomJoins limiter for POST /join) using constant-time decoy-room lookups, preventing shared-NAT attackers from blocking owner removals. Five isolated concurrency gates prevent starvation and thread exhaustion (Table 4).

Table 4: Server concurrency gates, quotas, and concrete resource-exhaustion costs (default limits).
Resource PoolGlobalPer /32 or /64Per IPv6 /48Exhaustion Floor / Degenerate Behavior
Unfinished uploads (pending)1,024832128 IPv4s (or 32 /48s), refreshing every 2 min (PendingIdle)
Active chunk uploads (chunkSlots)512416128 IPv4s (or 32 /48s); cut off at 5 s if <16<16 KiB/s
Active downloads (downloadSlots)512163232 IPv4s (or 16 /48s); 2 min grace, then ≥32\ge 32 KiB/s
Chat long-poll waiters (roomWaitSlots)5121632Degrades to immediate non-blocking read; never starves downloads
Disk write / chunk commit gates64 / 16——Acquired after full body read; slow senders hold 0 fsync slots
Paste count / storage budget10510^5 / 10 GiB20 req/m80 req/m≥83.3\ge 83.3 IPv4-hrs to hit 10510^5 pastes (triggers first); ∼273\sim 273 net-hrs for 10 GiB at 32 KiB min
Null Chat rooms / RAM1,000 / 128 MiB10 / 4 MiB40 / 16 MiB100 IPv4s (25 /48s) for rooms; 32 IPv4s (8 /48s) for RAM

Zero-Identifier Logging. No access logs exist. NewErrorLog scrubs IPv4/IPv6 tokens from net/http's internal logger; describeError unwraps *fs.PathError/*os.LinkError to log only operation and errno (stripping paths containing paste IDs); panic recovery logs the panic type (%T) and a goroutine stack trace, but never the panic value or request data; and Caddy's JSON log filter strips request and resp_headers.

6Hostile-Content Hardening in Browser and Terminal

Once decrypted, a paste or chat message is still attacker-controlled input (A7). Nullbin applies the same categories of defense in the browser and in the terminal; Table 5 compares them side by side.

Table 5: Defenses against hostile content and local leaks in the browser client (nullbin-server/web) and nullbin-cli.
ThreatBrowser clientnullbin-cli
Code and escape injectionContent is inserted only as textContent. Trusted Types [23] are required with no policies allowed (in the CSP header and a <meta> copy). No frameworks or workers.SanitizeForTTY strips terminal control sequences (CSI, OSC, DCS, APC, PM, SOS) and escapes control characters and lone \r on TTYs; --raw prints bytes unchanged.
Hidden and bidi characters (Trojan Source)hasHiddenChars flags bidi controls, private-use and blank characters, and long joiner runs. Chat rejects hidden characters and shows safety codes; shortened filenames keep their extension visible.Applies the same rules as the browser: escapes hidden characters visibly on TTYs and warns on stderr (hidden_chars_detected in --json).
Decoders and disk writesImages are parsed before decoding: PNG, JPEG, GIF, and WebP only (no SVG or PDF), ≤25\le 25 MiB, ≤50\le 50 MP, ≤1,000\le 1{,}000 frames. Executables (≤64\le 64 MiB) skip showSaveFilePicker so the OS quarantine mark is kept.Writes to a private (0600) temp file and keeps it only after the whole blob verifies. On POSIX it then links it into place without overwriting; on Windows it re-checks the destination and renames (not atomic). Filenames and device names are sanitized.
Local secret hygieneThe key is removed from the URL on load. Burn views zero the buffers the app owns and clear the page on exit (other copies remain until garbage collection; R11). Translation and spellcheck are disabled on secret fields.Restrictive umask, no core dumps, PR_SET_DUMPABLE=0 on Linux. Passwords and links never go in argv (--password-fd, --url-stdin); buffers are zeroed; config.json is 0600.
Transport and API trustThe API origin is fixed at build time; redirects are refused; JSON responses are size-limited (128 KiB / 9 MiB); only known error strings are shown.No default server; HTTPS required (plain HTTP only for loopback), TLS 1.2+; redirects disabled; the /prefix and /read responses are cross-checked; only known errors and versions are shown.

7Reproducible Builds and Self-Verifying Deployment

Because browser cryptography relies on verifying that a live server delivers the exact published artifacts (adversary A8; Paste threat-model goal G9, verifiability: anyone can rebuild a release and check that a running instance serves it), build reproducibility and host update verification are part of Nullbin's security design, not just its release process.

Digest-Pinned Distroless Containers and Resource Isolation. Nullbin's multi-stage Dockerfile pins every base image by SHA-256 digest (node:26.13.1-alpine, golang:1.27.4-alpine, caddy:2.11.9-alpine, and gcr.io/distroless/static-debian13:nonroot) and compiles Go binaries with CGO_ENABLED=0, GOTOOLCHAIN=local, GOFLAGS=-mod=readonly, -trimpath, -buildvcs=false, and -ldflags="-s -w -buildid=". Three distroless non-root (65532:65532) targets separate runtime privileges: proxy (shell-less static Caddy for Option B), frontend (Caddy plus content-hashed static files and generated headers.caddy for Option A), and backend (an API-only binary built with -tags=api that omits all Node/frontend assets). In Docker Compose (deploy/compose.yaml and compose.api.yaml), the backend container runs on an internal-only Docker bridge (172.30.53.0/24, zero internet egress), with a read-only root filesystem, cap_drop: [ALL], no-new-privileges:true, pids_limit: 4096, mem_limit/memswap_limit: 512m, GOMEMLIMIT=384MiB, and ulimits.core=0 so memory-only Null Chats never spill to core dumps. Caddy binds ports 80/443 without root capabilities via net.ipv4.ip_unprivileged_port_start=80, strips Set-Cookie/Service-Worker-Allowed, injects a sandboxed CSP on /api/v1/* responses, and overwrites X-Forwarded-For with the client address; the backend honors that header only from Caddy's pinned internal IP (NULLBIN_TRUSTED_PROXIES=172.30.53.10). In Option B the Go API itself enforces exact-origin CORS against the configured frontend origin.

Minimal Frontend Dependencies and Embedded Provenance. The browser client has exactly two pinned runtime npm dependencies, libsodium-wrappers-sumo 0.8.4 and CSS-only bootstrap 5.3.9, installed with npm ci --ignore-scripts --no-audit --no-fund and bundled deterministically by web/build.mjs (esbuild 0.28.2) with static guard rails rejecting innerHTML, eval, inline scripts/styles, and non-data: CSS URLs. Every build injects SHA-256 Subresource Integrity (SRI) hashes into index.html, emits a duplicate <meta> CSP tag, and writes a provenance manifest (internal/assets/dist/build.json) recording the SHA-256 digest of every source file, lockfile, font, and output bundle. In combined binaries (!api), sources.go embeds those exact frontend inputs via //go:embed, and assets.VerifySources hashes every embedded input against build.json at startup and refuses to start if a plain go build with -buildvcs=false has paired stale bundles with modified sources.

Self-Verifying Host Updates and Sandboxed Notices. Host lifecycle operations run through deploy/nullbin under sudo, dropping privileges to the checkout owner (as_owner) for every Git and workspace file operation so planted symlinks cannot redirect root writes. Before Docker Compose ever parses .env or .env.api, check_config validates every line strictly against an allowlist of single-line NAME=value pairs (rejecting control characters, quotes, duplicates, and malformed domains/origins that could inject Caddy directives). To prevent tag-substitution or self-vouching attacks, install and update require a clean checkout, confirm ancestry on origin/main and HTTP 200 release publication via GitHub's API, and verify post-cutover tags (≥\ge v0.5.5) using a root-owned, SHA-256-pinned gitsign 0.18.0 binary installed under /usr/local/lib/nullbin against exact GitHub Actions OIDC claims (certificate-identity pinned to .github/workflows/release.yml@refs/heads/main, issuer token.actions.githubusercontent.com, repository, ref, and workflow_dispatch trigger). Upgrades snapshot the config and HEAD, start the new release with --wait --wait-timeout 600 against the self-contained /nullbin healthcheck, and roll back automatically on failure (tearing down the failed release, then restoring and restarting the previous commit and configuration). Hourly update notifications run completely outside the API container via a hardened systemd oneshot (nullbin-update-check.service: dedicated unprivileged user, ProtectSystem=strict, ProtectHome=yes, empty CapabilityBoundingSet, MemoryMax=64M, TasksMax=16, 64 KiB HTTPS response cap), caching only a regex-validated semver string that update-notice displays at SSH login under a 1 s timeout and 64 B regular-file check.

Keyless Sigstore [24] CLI Releases. nullbin-cli ships zero auto-update or phone-home code. Its release.yml workflow cross-compiles all six linux/darwin/windows amd64/arm64 binaries twice from clean git archive trees, asserts byte-for-byte SHA256SUMS equality via diff (a determinism check on one runner; independent rebuilds by third parties remain the real reproducibility test [25]), signs the release tag with gitsign v0.18.0, and attaches a keyless Sigstore cosign v2.5.0 bundle (SHA256SUMS.sigstore.json) bound to the same release.yml@refs/heads/main OIDC identity.

8Hardening Through AI-Agent Adversarial Review

Many of Nullbin's mechanisms were added after adversarial review by a swarm of AI agents that searched the code and interacted with a running Nullbin instance for vulnerabilities. GLM 5.3 and DeepSeek V4.1 Flash 1017 did most of this review, finding and exploiting the vulnerabilities. Gemini 4 Neon and Claude Opus 5.5 (§1) took a more minor part in the review, but implemented the fixes for the discovered vulnerabilities. Each confirmed weakness was fixed and is covered by a regression test. Table 6 lists representative weaknesses and the design change each one led to.

Table 6: Representative weaknesses found by AI-agent adversarial review, and the fix for each.
AreaWeaknessFix
Null ChatA malicious member (with the server) could show different members different messages at the same (g,i)(g, i). No warning fired until receipts crossed, and it then named the victim, not the equivocator (or never fired if the victim stayed silent).Message records v3: each record commits to its sender's previous one (prev hash), and standalone padded seen receipts are sent after 2 min idle (≤1\le 1 per 10 min).
ServerA global download token bucket let bulk downloads (or one IPv6 /48) starve small pastes and chat reads.fairBudget: equal bandwidth shares per network in 250 ms windows, counting a /48 as one network.
ServerBogus room requests from a shared NAT used up the owner's rate limit, blocking member removals.roomLimited: separate rate-limit buckets per verified credential (owner, member/pending, strangers), plus a roomJoins bucket.
ServerOne global burn lock serialized unrelated pastes, and slow uploads could hold disk-write fsync threads.Per-paste idLock; separate diskWrites (64) and chunkCommits (16) gates, taken only after the body is read.
BrowserLeaving a burn warning kept keys in the back/forward cache; cloning a burn paste left its pagehide wiper attached.Clear burn keys on pagehide at the warning; detach view listeners when switching to a cloned draft.
BrowsershowSaveFilePicker writes straight to disk, which can skip Windows MOTW / macOS quarantine marks.Executables, scripts, and macro files (≤64\le 64 MiB) are saved through a normal <a download>, which keeps the marks.
BuildA plain go build -buildvcs=false could embed stale frontend assets without warning.sources.go embeds the frontend inputs; assets.VerifySources checks each one's SHA-256 against build.json at startup.
DeployInstall scripts checked out GitHub's releases/latest tag before running trusted verifier code.Clone main first; deploy/nullbin checks ancestry, release publication, and the tag's gitsign signature before checkout.

9Quantitative Analysis and Evaluation

9.1Padmé Size Padding and Wire Overhead

Table 7 reports exact v2 blob sizes (Eq. (6)) and overhead percentages across payload sizes from 0 B to 100 MiB+1100\,\text{MiB}+1, and Figure 2 plots the exact worst- and best-case overhead over the same range. Every table row that also appears in nullbin_vectors.json matches it; the rows for 1,048,577 B and 100 MiB+1100\,\text{MiB}+1 are computed from Eq. (6). Below the 16 KiB16\,\text{KiB} floor, all short pastes share an identical 16,451 B footprint. Immediately above the floor (16 KiB+116\,\text{KiB}+1), worst-case total wire overhead peaks at 6.65% (6.24% Padmé + 0.41% framing). At 64 KiB+164\,\text{KiB}+1, ss increments from 4 to 5, halving the worst-case overhead to 3.26% (3.12% Padmé + 0.13% framing), and at 100 MiB100\,\text{MiB} exact total framing overhead is just 0.032%. Within the default 100 MiB100\,\text{MiB} server limit, the largest valid padded stream is 98 MiB98\,\text{MiB} (102,793,422 B wire size); within the 2 GiB2\,\text{GiB} hard ceiling, it is 2,016 MiB2{,}016\,\text{MiB} (2,114,606,638 B wire size).

Table 7: Exact Paste v2 Padmé sizes and wire overhead (m=16 KiBm = 16\,\text{KiB}, C=64 KiBC = 64\,\text{KiB}).
Stream nn (B)Padded P(n)P(n)FramesBlob B(n)B(n)Wire Ovhd.
016,384116,451(floor)
16,38416,384116,4510.41%
16,38517,408117,4756.65%
32,76832,768132,8350.20%
32,76934,816134,8836.45%
65,53665,536165,6030.10%
65,53767,584267,6723.26%
131,072131,0722131,1600.07%
131,073135,1683135,2773.21%
1,000,0001,015,808161,016,1901.62%
1,048,5771,081,344171,081,7473.16%
104,857,600104,857,6001,600104,891,2460.03%
104,857,601106,954,7521,632106,989,0702.03%
Line chart of total wire overhead against unpadded stream size from 16 KiB to 100 MiB. The worst case is a sawtooth that starts near 6.7 percent and stays under 3.3 percent above 64 KiB; the best case falls from 0.4 percent to about 0.03 percent.
Figure 2: Exact Paste v2 wire overhead (Padmé padding + 46 B header + 21 B/frame) from 16 KiB16\,\text{KiB} to 100 MiB+1100\,\text{MiB}+1. Within each Padmé step the overhead falls from the plotted worst case (one byte past a step boundary) to the framing-only floor, giving 2s2^{s} teeth per octave; the worst case halves at 64 KiB64\,\text{KiB} when s=⌊log⁡2e⌋+1s = \lfloor \log_2 e \rfloor + 1 goes from 4 to 5.

9.2Null Chat Record-Budget Scaling (N=2…20N = 2 \dots 20)

Because each room is capped at Rmax⁡=1,000R_{\max} = 1{,}000 records, onboarding and key-rotation overhead directly bound usable message capacity M(N)M(N). With zero churn, setup plus N−1N-1 joins require S(N)=2+3(N−1)=3N−1S(N) = 2 + 3(N-1) = 3N - 1 control records (join, room, invite, join, admit). When members join sequentially, the kk-th joiner (k=1…N−1k = 1 \dots N-1) triggers kk deliveries from existing members plus 1 delivery from the joiner, totaling Kseq(N)=∑k=1N−1(k+1)=N2+N−22K_{\text{seq}}(N) = \sum_{k=1}^{N-1}(k+1) = \frac{N^2 + N - 2}{2} keys records. I compare three regimes:

  1. Batch Join (Upper Bound): All NN members join together and post 1 keys + 1 box record each: Obatch(N)=5N−1O_{\text{batch}}(N) = 5N - 1; subsequent rekeys cost 1 keys per 50 messages (stride 51).
  2. Sequential Join, Burst: Sequential keys with 1 initial box rotation per member: Oseq(N)=N2+9N−42O_{\text{seq}}(N) = \frac{N^2 + 9N - 4}{2} (stride 51).
  3. Sequential Join, Spaced (>3>3 min waves + spaced rekeys): Each arrival wave and each 50-message rekey also triggers recipient box rotations: Ospaced(N)=N2+4N−3O_{\text{spaced}}(N) = N^2 + 4N - 3 (stride 50+N50 + N per 50-message epoch).

For a single dominant sender (worst-case rekey cadence, 1 rekey per 50 messages) with remaining budget R=1,000−O(N)R = 1{,}000 - O(N) and epoch stride Δ\Delta, the exact maximum message count is

Mmax⁡(R,Δ)=50⌊R−1Δ⌋+min⁡ ⁣(((R−1) mod Δ)+1,  50).\begin{gathered}M_{\max}(R, \Delta) = 50\left\lfloor \frac{R-1}{\Delta} \right\rfloor \\[-2pt] + \min\!\Bigl(((R-1) \bmod \Delta) + 1,\; 50\Bigr).\end{gathered}
(8)

(When traffic is spread evenly across NN speakers, per-sender chains amortize rekeys—for N=20N=20 under batch joins, all 901 remaining records fit without post-onboarding rekeys.) The model also excludes idle receipt-only seen records: each tab that has read new messages may emit at most one per 10 min after 2 min of silence, and none once the room holds 800 records, so a room that chats in bursts separated by idle gaps loses up to one record per member per idle 10-minute window from M(N)M(N), while the last 200 records remain reserved for messages and control records. Table 8 and Figure 3 show exact single-sender capacities for N∈[2,20]N \in [2, 20], explaining analytically why a 5-person room retains ∼900\sim 900 usable messages (873–957) whereas a full 20-person room retains 383 messages under spaced joins with spaced box rekeys (513 if chat bursts after spaced joins, and 699 under burst sequential joins).

Table 8: Null Chat control overhead and usable message capacity M(N)M(N) under the 1,000-record cap (zero churn).
NNS(N)S(N)KseqK_{\text{seq}}OspacedO_{\text{spaced}}MbatchM_{\text{batch}}MseqM_{\text{seq}}MspacedM_{\text{spaced}}
2529972972953
38518967965928
5141442957949873
8233593943916787
102954137933890723
123577189923859655
1544119282908806553
1853170393894745450
2059209477884699383
Line chart of usable messages against room size from 2 to 20 members. Batch joins fall from 972 to 884, sequential joins with burst chat to 699, and spaced joins with spaced rekeys to 383.
Figure 3: Usable Null Chat messages vs. group size N∈[2,20]N \in [2, 20] under the 1,000-record ceiling (Eq. (8), single-sender rekey bound). Quadratic sequential key-delivery overhead (Θ(N2)\Theta(N^2)) bounds large rooms while keeping small rooms (N≤5N \le 5) near 900 messages.
Table 10: Empirical runtime, artifact, verification, and fuzzing measurements (AMD Ryzen 7 7840HS, 32 GiB RAM). Crypto rows: median of twenty runs (each a median of 5), min–max in brackets.
Benchmark / ArtifactMeasured Result
Cryptographic Runtime (100 MiB stream; Chrome 157 WASM)
Argon2id (256 MiB, t=3,p=1t{=}3, p{=}1) — CLI528.5 ms [429–732]
Argon2id (256 MiB, t=3,p=1t{=}3, p{=}1) — Chrome729.7 ms [657–814]
secretstream enc. (CLI)441.1 MiB/s [300–493]
secretstream enc. (Chrome)167.7 MiB/s [143–190]
secretstream dec. (CLI, direct)461.8 MiB/s [335–527]
secretstream dec. (CLI, stallReader)426.2 MiB/s [317–491]
secretstream dec. (Chrome, Blob.stream)185.2 MiB/s [174–221]
Artifact Footprint (linux/amd64 stripped; GNU gzip -9 in parens)
nullbin API (-tags=api) / combined7.50 / 9.32 MiB
nullbin-cli static binary7.23 MiB
app.js (incl. libsodium WASM)738.1 KiB (260.5 KiB)
app.css / index.html286.0 / 54.4 KiB (41.8 / 12.5)
Non-test LOC: Go server / Web TS / CLI6.2k / 10.5k / 6.6k
ProVerif 2.05 wall time (35 queries, 32.0 s total)
outsider.pv / member.pv (9 / 9 queries)8.4 s / 12.9 s
password.pv / split.pv (10 / 7 queries)9.6 s / 1.1 s
Fuzzing Throughput (20 s, 16-worker Go; Node room-fuzz)
FuzzHandler (HTTP / storage / rooms)≈\approx18.5k execs/s
ClientIP / ParseChunkIndex / ValidID76k / 91k / 234k/s
ParseLink / ParsePrefix / DecodeBlob346k / 217k / 231k/s
FuzzSanitizeFilename≈\approx86k execs/s
room-fuzz.test.ts (100 hostile rooms)3,083 applies/s (7.08 s)

9.3Empirical Runtime and Artifact Measurements

All measurements below come from one session on an AMD Ryzen 7 7840HS (8 cores / 16 threads, 32 GiB RAM, Windows 11 x64) against the commits named in §1, using the toolchain the server pins for its builds (Go 1.27.4, Node v26.13.1), headless Chrome 157.0.8103.79 driven by the repository's playwright-core, and the ProVerif 2.05 Docker image. Each crypto benchmark uses an exact 100 MiB100\,\text{MiB} padded stream (104,857,600104{,}857{,}600 B, 1,600 frames) and produced the same 104,891,246104{,}891{,}246 B blob in both runtimes. CLI figures come from the released code paths (DeriveMasterKey, NewV2EncryptReader, OpenBlob, and client.Read's stallReader) reading from memory; browser figures come from web/src/crypto.ts (deriveKey, preparePaste, openPaste) bundled with the repository's esbuild, with decryption reading the blob through a Blob.stream() rather than the network. Each run (a fresh Go test process, or a fresh Chrome page) takes the median of five warm repetitions after one discarded warm-up, and Table 10 reports the median of twenty such runs with the min–max range. Run-to-run variation is large: CLI Argon2id medians ranged from 429 to 732 ms (interquartile range 483–548 ms) on this laptop, so the cross-runtime ratios below are indicative rather than precise. Go fuzz rates are averages over fresh 20 s runs from the seed corpus with 16 workers; they depend strongly on corpus state and run length, so they are order-of-magnitude figures. ProVerif times are wall-clock per model and include about 1 s of container start-up each.

Observations. (1) For Argon2id (m=256m{=}256 MiB), Chrome WASM (729.7 ms) is about 1.38×1.38\times slower than native Go (528.5 ms), though the two ranges overlap (0.90–1.90×1.90\times using the range endpoints); both runtimes unlock in under a second while each offline guess still costs hundreds of milliseconds and 256 MiB of memory. (2) For streaming 100 MiB100\,\text{MiB} blobs, native nullbin-cli encrypts at 441.1 MiB/s, 2.63×2.63\times Chrome's 167.7 MiB/s (1.58–3.45×3.45\times across the ranges); the browser path also copies the file in 1 MiB Blob.slice reads and crosses the JS–WASM boundary per frame. The CLI decrypts at 461.8 MiB/s directly with 212.5 MiB of total heap allocation. Wrapping OpenBlob in client.Read's stallReader, which reads through a goroutine-owned buffer zeroed with clear(buf) and arms a per-read timer so a timeout cannot race the reader, adds 113.9 MiB of short-lived allocations (326.4 MiB total; both allocation totals were identical in every run) and lowers decryption by 7.7% to 426.2 MiB/s (317–491 MiB/s across runs), still 19.8×19.8\times to 30.7×30.7\times the server's 16 MiB/s default download cap. (3) Static binaries stay under 10 MiB stripped (nullbin-cli: 7.23 MiB; API-only nullbin: 7.50 MiB; combined with embedded frontend: 9.32 MiB), and the complete web client transfers in 314.7 KiB with GNU gzip -9 (260.5 KiB JS + 41.8 KiB CSS + 12.5 KiB HTML). (4) All 35 ProVerif queries across the four models finish in 32.0 s of wall time including container start-up, fast enough to rerun the full symbolic regression on every commit (the pinned commit's CI does not; a later commit adds a CI job that checks all 35 results). Go's fuzzers reach roughly 10410^4 execs/s against the full HTTP/storage stack (FuzzHandler) and 10510^5 execs/s on parsers, and room-fuzz.test.ts applies 3,083 hostile records per second (14.1 full 5-party hostile rooms/s).

Table 9 compares Nullbin with existing encrypted sharing and messaging systems. Browser pastebins such as PrivateBin [13] and Send/ffsend [14, 15] need no accounts but do not hide payload length, have no formal protocol models that I am aware of, and offer no forward-secret group messaging. Signal's two-party protocol core has been formally analyzed by Cohn-Gordon et al. [18], while practically exploitable flaws were found across Matrix's cryptographic subprotocols and the Element client [21]. MLS [11] standardizes group key agreement for groups ranging from two to thousands, with forward secrecy and post-compromise security, using a tree-based design that supports asynchronous key establishment; it leaves its Authentication and Delivery Services to the surrounding application. Nullbin chooses a narrower application profile: small, bounded rooms with short lifetimes and memory-only server state.

Conclusion. Nullbin shows that end-to-end encrypted sharing and group chat, with a chat core modeled in ProVerif, can be built without databases, accounts, JavaScript frameworks, or large dependency graphs. It gets there by putting hard bounds on every server resource, refusing feature combinations that would weaken a security property, applying the same hostile-content defenses in the browser and the terminal, and building and updating releases reproducibly with Sigstore verification. The server is compact; most of the TCB, including all of the cryptography and protocol state, lives in the clients and their libraries (Table 10). The whole stack, from the wire format to the deployed host, is designed to be independently audited.

Disclosure. I designed and implemented Nullbin, and this paper evaluates my own software. Nullbin has not yet had an independent security audit. Every measurement and model in this paper can be rerun from the pinned commits using the scripts, recorded results, and step-by-step checks in https://github.com/jacobzymet/nullbin-paper.

References

  1. [1]K. Nikitin, L. Barman, W. Lueks, M. Underwood, J.-P. Hubaux, and B. Ford, “Reducing Metadata Leakage from Encrypted Files and Communication with PURBs,” Proceedings on Privacy Enhancing Technologies, 2019(4):6–33, 2019.
  2. [2]B. Blanchet, “Modeling and Verifying Security Protocols with the Applied Pi Calculus and ProVerif,” Foundations and Trends in Privacy and Security, 1(1–2):1–135, 2016.
  3. [3]N. Boucher and R. Anderson, “Trojan Source: Invisible Vulnerabilities,” 32nd USENIX Security Symposium, pp. 6507–6524, 2023 (CVE-2021-42574).
  4. [4]M.-J. Saarinen and J.-P. Aumasson, “The BLAKE2 Cryptographic Hash and Message Authentication Code (MAC),” IETF RFC 7693, 2015.
  5. [5]Y. Nir and A. Langley, “ChaCha20 and Poly1305 for IETF Protocols,” IETF RFC 8439, 2018.
  6. [6]A. Biryukov, D. Dinu, D. Khovratovich, and S. Josefsson, “Argon2 Memory-Hard Function for Password Hashing and Proof-of-Work Applications,” IETF RFC 9106, 2021.
  7. [7]A. Langley, M. Hamburg, and S. Turner, “Elliptic Curves for Security,” IETF RFC 7748, 2016.
  8. [8]S. Josefsson and I. Liusvaara, “Edwards-Curve Digital Signature Algorithm (EdDSA),” IETF RFC 8032, 2017.
  9. [9]S. Arciszewski, “XChaCha: eXtended-nonce ChaCha and AEAD_XChaCha20_Poly1305,” IRTF CFRG Internet-Draft draft-irtf-cfrg-xchacha-03, January 2020 (expired; not an RFC), https://datatracker.ietf.org/doc/draft-irtf-cfrg-xchacha/.
  10. [10]A. Albertini, T. Duong, S. Gueron, S. Kölbl, A. Luykx, and S. Schmieg, “How to Abuse and Fix Authenticated Encryption Without Key Commitment,” 31st USENIX Security Symposium, pp. 3291–3308, 2022.
  11. [11]R. Barnes, B. Beurdouche, R. Robert, J. Millican, E. Omara, and K. Cohn-Gordon, “The Messaging Layer Security (MLS) Protocol,” IETF RFC 9420, 2023.
  12. [12]F. Denis, “libsodium Documentation: Encrypted Streams and File Encryption (secretstream),” https://doc.libsodium.org/secret-key_cryptography/secretstream.
  13. [13]PrivateBin Project, “PrivateBin: A minimalist, open source online pastebin,” https://privatebin.info/.
  14. [14]Mozilla, “Firefox Send” (discontinued September 2020; repository archived), https://github.com/mozilla/send.
  15. [15]T. Visée, “ffsend,” command-line client for Send, https://github.com/timvisee/ffsend.
  16. [16]Signal, “Technical Information: Specifications and Software Libraries for Developers,” https://signal.org/docs/.
  17. [17]Signal, Signal-Android PushTransportDetails.java (commit 2dd5703) and Signal-Desktop OutgoingMessage.preload.ts (commit 01e5971), accessed November 2026, https://github.com/signalapp/Signal-Android/blob/2dd57038758b7630c028dcfd5eaf4e27acc0b11a/lib/libsignal-service/src/main/java/org/whispersystems/signalservice/internal/push/PushTransportDetails.java and https://github.com/signalapp/Signal-Desktop/blob/01e59719454fec204b3f7902fb663d68419848c9/ts/textsecure/OutgoingMessage.preload.ts.
  18. [18]K. Cohn-Gordon, C. Cremers, B. Dowling, L. Garratt, and D. Stebila, “A Formal Security Analysis of the Signal Messaging Protocol,” IEEE EuroS&P, pp. 451–466, 2017.
  19. [19]The Matrix.org Foundation, “Matrix Specification,” https://spec.matrix.org/.
  20. [20]Element, “Synapse Documentation: Using Postgres,” https://element-hq.github.io/synapse/latest/postgres.html.
  21. [21]M. R. Albrecht, S. Celi, B. Dowling, and D. Jones, “Practically-exploitable Cryptographic Vulnerabilities in Matrix,” IEEE S&P, pp. 164–181, 2023.
  22. [22]M. R. Albrecht, B. Dowling, and D. Jones, “Device-Oriented Group Messaging: A Formal Cryptographic Analysis of Matrix' Core,” IEEE S&P, 2024.
  23. [23]K. Kotowicz (ed.), “Trusted Types,” W3C Working Draft, 7 October 2026, https://www.w3.org/TR/trusted-types/.
  24. [24]Z. Newman, J. S. Meyers, and S. Torres-Arias, “Sigstore: Software Signing for Everybody,” ACM CCS, pp. 2353–2367, 2022.
  25. [25]C. Lamb and S. Zacchiroli, “Reproducible Builds: Increasing the Integrity of Software Supply Chains,” IEEE Software, 39(2):62–70, 2022.
  26. [26]The Go Authors, “Package os: type Root,” https://pkg.go.dev/os#Root.