How We Built 11 Browser-Only Security Tools Enforced by CSP: default-src 'none' and SHA-256 Script Hashes
Almost every "free online security tool" — JWT debuggers, PDF watermarkers, .env scanners, SSH key generators, QR generators — claims "we don't store your data". That is a privacy policy promise, not a technical guarant
Almost every "free online security tool" — JWT debuggers, PDF watermarkers, .env scanners, SSH key generators, QR generators — claims "we don't store your data".
That is a privacy policy promise, not a technical guarantee. One third-party analytics script, CDN compromise, or accidental fetch() call can quietly ship your JWT payload, passport photo, or .env secrets off your device.
When we built Keyrook's 11 Free Offline Security Tools, we decided the browser itself should enforce the offline guarantee so users don't have to trust us — they can verify 0 bytes sent in DevTools Network in two seconds.
The Architecture: Make Network Exfiltration Impossible by Default
Every tool page under keyrook.com/tools/* is compiled into a self-contained static HTML file with a strict Content Security Policy:
Content-Security-Policy:
default-src 'none';
script-src 'sha256-<exact-inline-hash>';
style-src 'sha256-<exact-inline-hash>';
img-src 'self' data: blob:;
connect-src 'none';
form-action 'none';
frame-ancestors 'none';
base-uri 'none';
What this guarantees at the browser engine level:
-
Zero network requests after HTML load —
connect-src 'none'anddefault-src 'none'meanfetch(),XMLHttpRequest,WebSocket,EventSource,navigator.sendBeacon(), and external<script>/<img>tags are all blocked by Chrome, Firefox, and Safari before a single packet leaves the NIC. - Zero external CDNs or runtime imports — every pure-JS crypto, PDF, Canvas, QR, and ASN.1 parser is bundled inline and pinned to its exact SHA-256 hash at build time.
- Zero accounts, zero cookies, zero telemetry — open a tool, turn off Wi-Fi or switch on Airplane Mode, and every single feature keeps working identically.
All 11 Offline Tools
-
ID & PDF Watermark (
/tools/id-watermark/) — Stamp diagonal purpose watermarks onto passport/ID scans and multi-page PDFs right in Canvas/PDF without uploading identity documents. -
Screenshot Redactor (
/tools/redact/) — Pixelate/black-out API keys, emails, and PII before posting bug reports or social demos (strips EXIF metadata on export). -
.envSecret Scanner & Sanitizer (/tools/env-scan/) — Detects leaked tokens, AWS/Stripe/GitHub keys, and produces a safe redacted.env.examplelocally. -
JWT Debugger & Verifier (
/tools/jwt/) — Decode headers/claims and verify HMAC/RSA/ECDSA signatures using native Web Crypto (crypto.subtle). -
SSH Key Generator (
/tools/ssh-key/) — Generate Ed25519 / RSA keypairs in OpenSSH format strictly inside your browser tab. -
TLS Certificate & CSR Inspector (
/tools/cert-inspector/) — Parse PEM/DER X.509 certificates, SANs, validity windows, and fingerprints locally. -
Offline QR Code Generator (
/tools/qr/) — Create Wi-Fi, URL, andotpauth://QR codes as SVG/PNG without leaking payloads to third-party QR APIs. -
2FA / Google Authenticator Migration Decoder (
/tools/otpauth-migrate/) — Decodeotpauth-migration://protobuf exports locally when migrating authenticators. -
WebAuthn PRF & Passkey Tester (
/tools/webauthn-prf/) — Inspect authenticator capabilities and test deterministic PRF key derivation on your hardware key or platform passkey. -
Unbiased Password & Passphrase Generator (
/tools/password/) — Rejection-sampledcrypto.getRandomValues()generator with zero modulo bias. -
Hash & HMAC Calculator (
/tools/hash/) — Streaming SHA-256/SHA-512/HMAC verification for local files and strings.
Verify It Yourself in 5 Seconds
- Open any tool at https://keyrook.com/tools/.
- Open DevTools → Network tab (or turn on Airplane Mode).
- Drop in a test PDF,
.envfile, or JWT and run the tool — 0 outgoing requests.
All 11 tools are completely free with no sign-up required. What other sensitive developer/privacy utilities do you wish had a strict default-src 'none' offline version?
Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.