← Back
← Writing
· 7 min read

Nothing up my sleeve: a site you can audit

  • privacy
  • security

Cryptographers have a name for a constant whose origin anyone can check: a “nothing up my sleeve” number. SHA-256 starts from the fractional parts of the square roots of the first eight primes.Sidenote 1:Its 64 round constants come from the cube roots of the first 64 primes. You can recompute every one of them yourself. Nobody has to trust the designers’ choice, because there was no choice to trust. The opposite case is a constant that arrives with no explanation, like the two points in the Dual_EC_DRBG random number generator, which many cryptographers suspected of being a backdoor long before there was evidence that it was one.

I wanted this site to work the first way. A personal site for someone who works on privacy and security makes claims about its author whether it means to or not, and the easiest claims to make are the ones nobody can check. So the rule here is that every claim should come with a way to check it, and anything I could not back up has been removed.

What the site measuresLink to “What the site measures”

The footer of every page shows two numbers: how many of the page’s requests went to a third party, and how many bytes came over the network. The full ledger behind them adds the commit the page was built from and the total number of requests. None of them are typed in by me. The commit is written in at build time. The rest come from your browser’s Resource Timing API, which records every fetch the page makes.

Here is the full ledger for this page, as a figure:

This page, measured by your browser Live
build
76426fd
built
requests
—
third-party
—
transferred
—
Every request this page has made so far Measuring. This list needs JavaScript and the Resource Timing API.
#ResourceTypeTransferred
Not a screenshot: this is the same ledger as the footer, reading the Resource Timing entries for the page you are on. Open your browser's network panel and compare. The colophon explains what it can miss.

The code behind it is small. The page asks the browser to report navigation and resource entries, including the ones recorded before it started listening, and counts any whose origin differs from the page’s own:

const observer = new PerformanceObserver((list) => {
	for (const entry of list.getEntries()) {
		const thirdParty = new URL(entry.name).origin !== location.origin;
		console.log(`${entry.initiatorType} ${entry.name}`, { thirdParty });
	}
});
observer.observe({ type: 'resource', buffered: true });

What the site enforcesLink to “What the site enforces”

Counting requests proves nothing about the future, so the numbers are not the guarantee. The guarantee is a Content-Security-Policy: a list of rules your browser enforces before it sends a request. On this site every fetch directive allows the site’s own origin and nothing else, so a third-party script, font, image, or connection is refused by the browser before it leaves.

Every public page here is prerendered to static HTML, so the policy travels as a meta tag at the top of each one. The one inline script SvelteKit needs to start the page is allowed by its hash, not by a blanket exception:

<meta
	http-equiv="content-security-policy"
	content="default-src 'self'; script-src 'self' 'sha256-…'; style-src 'self'; object-src 'none'"
/>
<script>
	// SvelteKit's bootstrap. It runs only if its SHA-256 hash matches the one above.
</script>

Styles are nearly as strict. There is no 'unsafe-inline' for styles, which meant replacing every inline style attribute I had written, including the ones a code highlighter normally produces.Sidenote 2:The code blocks on this page are coloured with classes generated at build time. Shiki, the highlighter, would otherwise write a style attribute on every token. One exception remains, and it is the framework’s: SvelteKit hides its screen-reader announcer with a fixed inline style. The policy allows that exact string by its hash and nothing else. The colophon lists it rather than leaving you to find it.

A test enforces the same thing from outside the page. It loads every public page in a real browser and fails if any request goes to another origin, if the browser reports a policy violation, or if the footer’s own count shows a third-party request.

Where the self-reporting stopsLink to “Where the self-reporting stops”

The ledger is the page reporting on itself, and a page is not a neutral witness. The script that counts is served by the same site being counted, so a site that wanted to hide something could change the numbers. The steps on the colophon use your browser’s developer tools instead, which the site does not control.

Resource Timing also has blind spots. Chromium leaves the favicon out of it. Requests from extensions, from workers, and from the browser itself do not appear. A request the policy blocks is never sent, so it shows up as a console error, not as a row.

And none of this touches the server. Making no third-party requests is not the same as collecting nothing.Sidenote 3:The site runs on AWS. CloudFront and a Lambda function see every request, including your IP address. I run no analytics and have not turned on access logs, but this page cannot prove that. The first party still sees you. What the site can show is that it adds nobody else.

Why botherLink to “Why bother”

Because the alternative is a status light. The previous version of this site had a pulsing green dot in the footer that said “SYSTEM OPERATIONAL”. It was not connected to anything. Small decorations like that are how a site teaches its readers to stop believing it, and a site about privacy and security cannot afford that.

The same rule applies to the projects. Each figure on the site is labelled either “recorded”, a replay of a real run, or “simulated”, a hand-written sequence. Nothing is presented as a live system when it is a script.

Home /
Projects /projects
Writing /blog
About /about
Colophon /colophon
Copy link to this page
See what this page loaded /colophon