burnafter

Privacy-first, end-to-end encrypted, self-destructing data sharing


Keywords
burn-after-read, burn-after-reading, privacy, secret-sharing, self-destructing, zero-knowledge
License
MIT
Install
npm install burnafter@1.0.5

Documentation

๐Ÿ” BurnAfterRead

Privacy-first, end-to-end encrypted, self-destructing data sharing.

BurnAfterRead lets you securely share sensitive data (text for now) using links that expire after being read.

No accounts. No tracking. No server-side access to your secrets.


โœจ Features

  • ๐Ÿ” End-to-end encryption (AES-GCM) โ€” data is encrypted in your browser
  • ๐Ÿ”‘ Zero-knowledge architecture โ€” server never sees the decryption key
  • ๐Ÿ’ฃ Burn after read โ€” data is destroyed after access
  • โณ Time-based expiration (TTL)
  • ๐Ÿ” Limited views
  • ๐Ÿง  Atomic reads via Durable Objects
  • ๐Ÿ•ถ๏ธ Paranoid mode โ€” minimal metadata, no logs

๐Ÿง  How it works

Encryption flow

plaintext โ†’ (browser) โ†’ encrypt โ†’ ciphertext โ†’ server

Decryption flow

ciphertext โ†’ (browser + key from URL) โ†’ decrypt โ†’ plaintext

Key detail

https://app/d/<id>#k=<secret-key>
  • id โ†’ sent to server
  • key โ†’ stays in browser (URL fragment, never sent)

๐Ÿ‘‰ The server cannot decrypt your data, even if compromised.


๐Ÿ—๏ธ Architecture

  • Frontend: React + Web Crypto API

  • Backend: Cloudflare Workers

  • Storage:

    • D1 โ†’ metadata
    • R2 โ†’ encrypted blobs
  • Concurrency control: Durable Objects


๐Ÿ” Read lifecycle

  1. Client requests /api/drops/:id

  2. Worker delegates to Durable Object

  3. Durable Object:

    • checks TTL
    • checks remaining views
    • decrements counter atomically
  4. If last read โ†’ deletes:

    • D1 record
    • R2 object
  5. Returns ciphertext


๐Ÿš€ Local development

1. Install

npm install

2. Run database migration

npx wrangler d1 execute burnafterread-db --local --file=./migrations/0001_init.sql

3. Build frontend

npm run build

4. Start dev server

npx wrangler dev

Open:

http://localhost:8787

๐Ÿงช API

Create drop

POST /api/drops

๐Ÿงฐ CLI

BurnAfterRead also provides a CLI tool for secure sharing directly from your terminal.

Install

npm install -g burnafter

Or use without installation:

npx burnafter

Usage

burnafter send <file>
burnafter send --text "secret message"

Options

  • --text <text> โ€” send raw text instead of file
  • --ttl <seconds> โ€” time to live (default: 86400)
  • --views <number> โ€” number of allowed views (default: 1)
  • --paranoid โ€” delete immediately after first access

Examples

burnafter send secret.txt

burnafter send --text "my password"

burnafter send config.env --ttl 3600 --views 1

burnafter send archive.zip --paranoid

How it works

  • Data is encrypted locally (AES-GCM) before upload
  • The server stores only encrypted data
  • The decryption key is included in the URL fragment (#k=...)
  • The server never sees or stores the key

๐Ÿ‘‰ The CLI provides the same zero-knowledge guarantees as the web app.

Body:

{
  "ciphertext": "...",
  "ttl_seconds": 86400,
  "views": 1,
  "kind": "text",
  "size_bytes": 123,
  "paranoid": true
}

Read drop

GET /api/drops/:id

โš ๏ธ Security notes

  • Encryption happens only on the client
  • The server stores ciphertext only
  • Decryption key is never transmitted
  • No authentication โ†’ links are the only access control
  • If you lose the link โ†’ data is gone forever

๐Ÿงญ Roadmap

  • [ะฅ] File support (up to 5MB)
  • [ะฅ] CLI tool (burnafter)
  • QR sharing
  • Dead-man switch
  • Multi-part secrets

๐Ÿ“œ License

MIT


๐Ÿ’ก Philosophy

Built by a human, for humans. No tracking. No data harvesting. No bullshit.