From b6170070543995fe08a3d1d54a0a3b6818b32535 Mon Sep 17 00:00:00 2001 From: dev Date: Thu, 1 Oct 2026 02:28:42 +0200 Subject: [PATCH] A key of words: open a capsule with words instead of a .dkk MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The author wanted a key that people can keep without files. A capsule "solo con una llave" can now take words the person chooses, at least six, on /create, and /inspect opens it with them. wordkey.ts derives the X25519 identity with PBKDF2-SHA256 of Web Crypto, 600 000 rounds, salted with the chain and the round of the capsule, after making case, accents and extra spaces not matter; its public key is one more recipient, so the format does not change. The writer wipes the private half at once; the opener adds it to the identities it tries. Checked in Chromium: a capsule created with "Perro luna casa verde trén mar" and no .dkk opened with "perro LUNA casa verde tren mar", with the release fetched from drand by the page. Co-Authored-By: Claude Opus 5.5 --- CHANGELOG.md | 5 ++++ src/lib/components/OpenPanel.svelte | 13 +++++++-- src/lib/inspector/create-input.test.ts | 16 ++++++++--- src/lib/inspector/create-input.ts | 25 +++++++++++++---- src/lib/inspector/creator.test.ts | 14 +++++++++- src/lib/inspector/creator.ts | 12 +++++++- src/lib/inspector/opener.test.ts | 27 ++++++++++++++++++ src/lib/inspector/opener.ts | 5 ++++ src/lib/inspector/wordkey.test.ts | 26 ++++++++++++++++++ src/lib/inspector/wordkey.ts | 38 ++++++++++++++++++++++++++ src/routes/create/+page.svelte | 37 ++++++++++++++++++++----- vitest.config.ts | 1 + 12 files changed, 199 insertions(+), 20 deletions(-) create mode 100644 src/lib/inspector/wordkey.test.ts create mode 100644 src/lib/inspector/wordkey.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index ec15776..0fa7aa2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,11 @@ Cambios notables de la librería TypeScript y de la página. El proyecto usa ver El formato 3 de la especificación 0.10, según `PLAN_formato3_ts.md` (en `../docs`). La versión que lo publique la decide el autor. +### Llave de palabras y firma de drand + +- `/inspect` pide la firma de la ronda a los relays de drand con un botón (`drand.ts`), además de poder pegarla. +- Una cápsula «solo con una llave» puede abrirse con palabras que elige quien la crea, al menos 6, en vez del fichero `.dkk` (`wordkey.ts`): PBKDF2-SHA256 de 600.000 vueltas, con la red y la ronda como sal, da una clave X25519 que entra como una persona de `age` más. El formato no cambia; dan igual mayúsculas, acentos y espacios. + ### Paso 8: revisión adversarial y rediseño de `/create` - Correcciones de la revisión: el payload llega a `age` en trozos de un chunk (`chunked`), el sumidero nunca se aborta tras el commit y recibe copias, el escritor copia cada trozo que lee y acepta fuentes escritas como clase, y las extensiones de tipos incorrectos son un `TypeError`. diff --git a/src/lib/components/OpenPanel.svelte b/src/lib/components/OpenPanel.svelte index 2d75711..784956d 100644 --- a/src/lib/components/OpenPanel.svelte +++ b/src/lib/components/OpenPanel.svelte @@ -112,6 +112,8 @@ // The release from the relays of drand, only when the person asks for it: // the one connection the page makes to another site (drand.ts). let asking = $state(false); + // The words of a key of words, as the person types them. + let words = $state(''); let askNote = $state(''); async function askDrand(): Promise { asking = true; @@ -239,6 +241,7 @@ release: parsed.release, ...(timeAndKey ? { identities } : {}), ...(timeAndKey && accessKey !== undefined ? { accessKey } : {}), + ...(timeAndKey && words.trim() !== '' ? { words: { text: words, chainHash: report.profile!.chainHash, round } } : {}), // A stale opening stops writing, so open aborts the file and stops. ...(out === undefined ? {} : { output: { writable: cancellable(out.writable, stale), file: () => out.file(), remove: () => out.remove() } }), // Format 3: the files without an mtime take the time of the round in @@ -373,8 +376,9 @@
La llave

- Esta cápsula se creó «solo con una llave»: además de la firma de la ronda, hace falta su llave .dkk o la - clave secreta de age de una de las personas a las que se dio. No salen de este navegador. + Esta cápsula se creó «solo con una llave»: además de la firma de la ronda, hace falta su fichero .dkk, + las palabras con las que se creó o la clave secreta de age de una de las personas a las que se dio. No + salen de este navegador.

@@ -387,6 +391,11 @@ aria-describedby={problemField === 'accessKey' ? 'open-problem' : undefined} />
+
+ + +

Las que se escribieron al crear la cápsula. Dan igual mayúsculas, acentos y espacios.

+