
Zero-knowledge encrypted pastebin. Your data is encrypted before it leaves your browser.
Your data is encrypted in your browser before it leaves your machine. The server only ever stores ciphertext.
Live Demo • Report Bug • Request Feature
Share a secret straight from your terminal. It encrypts on your machine before anything uploads:
echo "my-api-key" | npx cloakbin
⭐ Find CloakBin useful? Star the repo so more people can find it.
Traditional pastebins store your data in plaintext. Server admins, hackers, or anyone with database access can read everything you share.
CloakBin encrypts everything in your browser before it reaches the server.
┌─────────────────────────────────────────────────────────────────┐
│ ZERO-KNOWLEDGE FLOW │
├─────────────────────────────────────────────────────────────────┤
│ │
│ YOUR BROWSER SERVER DATABASE │
│ ──────────── ────── ──────── │
│ │
│ "secret msg" │
│ │ │
│ ▼ │
│ ┌─────────┐ │
│ │ ENCRYPT │ AES-256-GCM │
│ │ locally │ (browser) │
│ └────┬────┘ │
│ │ │
│ ▼ │
│ "a3f8b2c1..." ───────► "a3f8b2c1..." ───► "a3f8b2c1..." │
│ (ciphertext) (ciphertext) (ciphertext) │
│ │
│ KEY stays in URL fragment (#) │
│ example.com/p/abc#KEY ◄── never sent to server │
│ │
└─────────────────────────────────────────────────────────────────┘
The encryption key lives in the URL fragment (#), which browsers never send to servers. Steal our database and you get ciphertext you can't read.
| Component | What it sees |
|---|---|
| Your Browser | ✅ Plaintext (you control it) |
| Network/ISP | 🔒 Encrypted ciphertext only |
| CloakBin Server | 🔒 Encrypted ciphertext only |
| Database | 🔒 Encrypted ciphertext only |
| URL Recipient | ✅ Plaintext (they have the key) |
Cryptographic Details:
crypto.getRandomValues)Full architecture write-up (ciphertext formats, fragment keys, threat model): docs/SECURITY-MODEL.md. Vulnerability reporting: SECURITY.md.
You can check the guarantee yourself, in your browser:
POST request that saves the paste and look at its request body. You'll see only ciphertext and a salt, never your plaintext, and never the encryption key.# (the URL fragment). By web standard, browsers never send the fragment to the server. It stays client-side.#fragment.The key exists only in the fragment and in your recipient's browser. The server, its database, and anyone on the network see encrypted blobs. No server-side code path can read your content, so a subpoena turns up ciphertext and nothing more.
# Clone
git clone https://github.com/Ishannaik/CloakBin.git
cd CloakBin
# Install
pnpm install
# Configure
cp .env.example .env
# Edit .env with your MongoDB URI
# Run
pnpm dev
CI runs pnpm run type-coverage to catch regressions in typed source coverage.
The current source baseline is 93.22%, with generated .svelte-kit route types ignored,
so the gate fails below 93%.
# DB_TYPE=memory needs no database and is the fastest way to run the project locally.
# DB_TYPE=mongodb requires MONGODB_URI below.
DB_TYPE=memory
MONGODB_URI=mongodb://localhost:27017/cloakbin
ADMIN_USER=admin
ADMIN_PASS=your-secure-password
| Layer | Technology |
|---|---|
| Framework | SvelteKit 2.0, Svelte 5 |
| Language | TypeScript |
| Styling | Tailwind CSS 4.0 |
| Database | MongoDB |
| Encryption | Web Crypto API |
| Editor | CodeMirror 6 |
| Hosting | Vercel |
src/
├── lib/
│ ├── components/ # UI components
│ ├── db/ # Database adapters
│ └── crypto.ts # Encryption (AES-256-GCM, PBKDF2)
├── routes/
│ ├── +page.svelte # Create paste
│ ├── p/[id]/ # View paste
│ ├── api/ # REST endpoints
│ └── admin/ # Admin dashboard
└── app.html
CloakBin is open source. Deploy your own instance:
The quickest way to run your own instance is Docker Compose, which starts CloakBin and MongoDB together: