Security battery

An adversarial battery against identity-bound secrets: isolation, leakage, tampering, lifecycle, migration, audiences.

165 checks in 16 files. Run: cd Typescript && npm run test:security. Source: Typescript/tests/

isolation.test.ts6 checks

Same path, secret and noise under two identities: wholesale copies of blobs, snapshots, envelopes and rootId grant nothing.

scopes-and-noise.test.ts11 checks

Sibling and nested scopes isolate, secret order does not matter, noise cuts inherited secrets but not the identity root, a child inherits protection.

root-scope-lock.test.ts6 checks

Regression: a root-scope write does not become public after lockIdentity().

root-secret-stealth.test.ts13 checks

Regression: leaves under the root scope me["_"] are not readable by guests.

withscope-current.test.ts23 checks

Pins the deprecated withScope() behavior against as(); a diagnosis, not a permanent contract.

root-secret-aggregate-paths.test.ts14 checks

Root secret with [] aggregates and quoted literals: a guest sees what an empty kernel shows.

lww-index-consistency.test.ts10 checks

Regression: same-millisecond writes leave the live index equal to rebuildIndex().

leakage.test.ts6 checks

Marker strings do not appear in snapshots, memories, disk files, public reads or errors.

crypto-tamper.test.ts18 checks

Altered ciphertext, nonce, tag, version, rootId or context, truncation, swapped blobs and unknown formats fail closed; KDF bounds.

root-lifecycle.test.ts11 checks

Passwords, password change, lock, backup and restore, reseed; a restored root never auto-unlocks branch secrets.

replay-restart.test.ts4 checks

Save, fresh instance, hydrate: scopes stay closed until the secret is supplied, then recovery is exact.

migration.test.ts6 checks

v3 to v4: mixed blobs, scopes pending without a secret, interruptions, original kept until the new one is verified.

generative.test.ts5 checks

Seeded generative sequences checked against a reference model; cache growth is measured.

seed-persistence.test.ts5 checks

No plaintext private material is written to localStorage.

derived-from-secret.test.ts11 checks

Public derivations over secret scopes.

audience-algebra.test.ts16 checks

Laws L1 to L9 and the OR, AND, nesting, tamper and revocation cases for audiences.

run-all.mjs runs each file in its own process. Attack model and findings: tests/Security/README.md.

Last result: 165 passed, 0 failed in 16 files. Run summary 2026-10-26

Live in your browser

Isolation between identitieslive in your browser · latest

Data encrypted under one .me identity root does not open under another.

Information leakagelive in your browser · latest

Protected values, scope secrets and passwords never appear in snapshots, memory logs or error messages.

Crypto tamperinglive in your browser · latest

Tampered, truncated or relabelled blobs and envelopes fail closed.

Replay and restartlive in your browser · latest

A kernel rebuilt from a snapshot comes back closed and recovers once its owner supplies the secrets.

Derived from secretlive in your browser · latest

Public derivations of a secret: only someone who can open the secret can expose them.

Secret wrapped for a recipientlive in your browser · latest

A secret wrapped for one P-256 public key opens only with the matching private key.

Each panel runs npm latest by default; pick another version in its top bar, or add ?v=x.y.z (?v=4.0.2 runs the hash-pinned kernel).