This article is part of the series My favorite FOSS tools.

TL;DR

  • checkout whisperbin on GitHub
  • use it in your browser: https://bin.marco-kretz.de/
  • your browser encrypts the text before it is sent. The server only stores unreadable data and never gets the key
  • optional: password protection and “burn after reading” (the paste is deleted after it was opened once)
  • it is open source (MIT license), so you can read the code, run it yourself and contribute

Info

This article is based on the whisperbin code at the time of writing: commit ea7186e (2026-11-21). Newer versions may differ.

What does whisperbin look like? What can be done with it?

Whisperbin is a single page in your browser. You enter the sensitive data you want to share, make a few settings (like extra password protection of the link it will generate), and then you are good to go.

Screenshot of the whisperbin start page, dark theme. Heading “Share confidential messages” above four features: end-to-end encrypted, your key stays with you, deleted automatically, read once then gone. Below a form with an optional title, a content text area, an expanded password generator with a length slider set to 73 and a checkbox for symbols, dropdowns for expiration (24 hours) and format (plaintext), an optional password field, a checkbox “Delete after first view” and a red “Create message” button.

After you submit the form, you get a sharable link:

Screenshot of the generated share link in whisperbin. Heading “Link ready” with an expiration badge of 24 hours. The link contains an ID and the decryption key after “#key=”. Below it a copy button and the hint “This link contains the decryption key. Only share it with the person meant to read the message.”

Whisperbin is available in English and German: it picks the language from your browser settings, and you can switch it in the header. More languages could follow (maybe with your help, see Contributing).

How does it work?

Note

The core idea: encrypt in the browser, store only the encrypted data on the server, keep the key out of the server’s reach.

yo124u...rgewptbeniuhrnctteoerhwryklsapteietthynreektikekn(exet#ytyokey=)encdlraiytnpakteidncl3..#sedkstnaeeoctyrrra=vey.ep.rot.neldy(chat,emnacdiralyt,pated56..rertdceheeaecidrvlyekiprent'ykstfebrxrotomwser
  1. Your browser generates a random key and encrypts your text with it.
  2. Only the encrypted text (the ciphertext) is sent to the server and stored in a database.
  3. The key is added to the link, behind a #: https://bin.marco-kretz.de/<id>#key=...
  4. The receiver opens the link. Their browser fetches the ciphertext and decrypts it locally with the key from the link.

Warning

The server stores your data, but it cannot read it. Whoever has the full link can, so share it carefully.

Behind the scenes: Learning from whisperbin

Symmetric encryption with AES-GCM

Whisperbin uses symmetric encryption: the same key is used to encrypt and decrypt. The algorithm is AES (Advanced Encryption Standard) with a 256-bit key.

AES needs a mode that defines how longer data is processed. Whisperbin uses GCM (Galois/Counter Mode). GCM does two things: It keeps the data confidential (nobody can read it without the key. And it makes the data tamper-proof (if someone changes even one bit of the ciphertext, decryption fails instead of returning garbage)

Next to the key, GCM needs an IV (initialization vector, also called nonce). This is a random value that must be unique for every encryption with the same key. It is not secret, so whisperbin stores it next to the ciphertext. Whisperbin generates a fresh key and IV for every paste.

Encryption in the browser: the Web Crypto API

You do not need a library for this. Modern browsers come with the Web Crypto API. The whole encryption in whisperbin boils down to three calls:

const key = await crypto.subtle.generateKey({ name: 'AES-GCM', length: 256 }, true, ['encrypt', 'decrypt']);
const iv = crypto.getRandomValues(new Uint8Array(12));
const cipherBuffer = await crypto.subtle.encrypt({ name: 'AES-GCM', iv }, key, encodedPayload);

Check out src/lib/crypto.ts if you want to see the full picture. It is less than 100 lines.

Tip

A rule of thumb: never write your own crypto algorithms. Use well-tested building blocks like the Web Crypto API and combine them correctly. That is exactly what whisperbin does.

The URL fragment trick

Why is the key behind a # in the link? Everything after the # is the URL fragment. Browsers do not send the fragment to the server when they request a page. It only exists in the browser. JavaScript can read it with window.location.hash.

That way, the server delivers the ciphertext, but the key never reaches it. Not even in the server’s access logs.

Hashing vs. encryption: the optional password

This one confuses a lot of people, so it is worth looking at:

  • encryption is reversible. With the key you get the original data back
  • hashing is a one-way function. You cannot get the original data back from a hash

The optional password in whisperbin is not used for encryption. It is checked by the server before it hands out the ciphertext. The server stores a hash of the password, not the password itself. For this, whisperbin uses scrypt, an algorithm that is deliberately slow and memory-hungry to make guessing passwords expensive. Each password also gets a random salt, so two identical passwords result in different hashes.

When comparing hashes, whisperbin uses Node’s timingSafeEqual. A normal comparison stops at the first different character, and an attacker could measure those tiny time differences. A timing-safe comparison always takes the same time.

Good randomness

Keys, nonces, salts and generated passwords must be unpredictable. Math.random() is not good enough for that. Whisperbin uses crypto.getRandomValues() in the browser and randomBytes() on the server, which are cryptographically secure.

A small bonus: the password generator avoids the so-called modulo bias, where some characters would appear slightly more often than others. Look for “rejection sampling” in crypto.ts.

Defense in depth

Encryption is only one layer. Whisperbin also comes with:

  • rate limiting: a limited number of requests, new pastes and password attempts per IP and minute. This slows down brute-force attacks. In production, Redis keeps track of the counters
  • security headers: e.g. Strict-Transport-Security (HTTPS only), X-Frame-Options (no embedding in other pages), Referrer-Policy: no-referrer and Cache-Control: no-store so encrypted data does not end up in caches. Check out src/hooks.server.ts and the OWASP HTTP Headers Cheat Sheet
  • data minimization: expired pastes are deleted, one-time pastes are wiped on first reveal

Known limitations

No tool is perfect, and understanding the limits is part of the learning. Whoever has the full link can read the paste. If you share the link in the tool you wanted to avoid, the protection is gone. Use “burn after reading” so the data is gone after the intended recipient has read it.

You also have to trust the server to deliver the correct JavaScript. A manipulated server could deliver code that leaks your key. This is true for every web-based encryption tool. Since whisperbin is open source, you can host it yourself (a Dockerfile is included). Lastly, JavaScript is required. Without it, nothing can be encrypted in your browser.

The Tech Stack

Whisperbin is a full-stack TypeScript application. You do not need to understand all of it to learn about the encryption part, but if you want to contribute, here is the overview:

TechnologyWhat it does in whisperbin
SvelteKitthe application framework. It handles both the pages and the server code
Sveltethe UI framework for the components
TypeScriptJavaScript with types
Tailwind CSS (v4)styling via utility classes
Drizzle ORMtype-safe database access and schema migrations
SQLite via better-sqlite3the database. A single file, no extra database server needed
Redisstores the rate limit counters in production
highlight.jssyntax highlighting
Vitedev server and build tool
Node.js (22+) and pnpmruntime and package manager
Dockerpackaging for deployment

Open Source: Anybody Can Contribute

Whisperbin is published under the MIT license. This means you do not have to trust anybody’s word about the security. You can read the code yourself.

And you can improve it.

Tip

Before you open a pull request, run the tests. If you work with a coding agent, the repository already contains an AGENTS.md with instructions for it.

Some ideas where you could help:

  • translations: the UI is available in English and German. All texts live in src/lib/i18n.ts, so adding your language is a nice first contribution
  • review the code: security tools benefit from more eyes. Found something? Open an issue
  • documentation: explain things that were unclear to you when you first read the code. If you struggled, others will too

Further Reading

Sources