Skip to content

1 Architecture

Bosaj edited this page Nov 1, 2026 · 2 revisions

Architecture

src/rules.ts    what to find, with validators (Luhn, mod 97, entropy)
src/mask.ts     mask(), Vault (in memory), StreamUnmasker
src/proxy.ts    local proxy: JSON and server-sent events
src/cli.ts      the secret-mask command
web/            the page, which uses the same src/mask.ts

Principles

  • A value never reaches a log, an error message or the scan output.
  • The proxy refuses a body it can't inspect rather than forwarding it, and listens on loopback only.
  • Every pattern is bounded: anyone can paste anything. The first version took 36 s on 200 KB of hostile input, and a test now enforces a limit.
  • The page's security policy (connect-src 'none') stops it from sending anything, and a browser test checks that.

Clone this wiki locally