← Security blog

How a one-time link works, step by step

4 min read

A one-time link lets you hand over a secret without leaving a readable copy behind. The idea is simple, but the details are what make it safe. Here is the full flow used by One-Time Link.

Creating the link

  1. Your browser generates a random key. Using the standard Web Crypto API, it creates a fresh 256-bit key that exists only on your device.
  2. The secret is encrypted locally. The text is encrypted with AES-256-GCM before anything is sent. GCM also protects integrity, so a modified message will fail to decrypt.
  3. Only ciphertext is uploaded. The server receives the encrypted data, a random initialization vector and the expiry time. It never receives the key.
  4. The link is assembled in your browser. The server returns a random ID, and your browser builds a link that looks like /s/ID#KEY.

Why the key stays private

The part of a URL after the # is called the fragment. Browsers use it locally and do not include it in the request they send to the server. That means the key is not in web server logs, proxies or analytics, even though it is part of the link you share.

Opening the link

  1. The recipient opens the link and sees a page asking them to confirm. Nothing is fetched yet.
  2. When they press the button, the browser asks the server for the ciphertext. The server returns it and deletes it in the same database operation, so a second request gets nothing.
  3. The browser decrypts the data using the key from the fragment and shows the secret. The key is then removed from the address bar.

What happens when something goes wrong

The result is a short-lived, single-use channel. It does not replace good security habits, but it prevents the secret from sitting in an inbox for years.