How it works

timelock.dev uses tlock, an encryption method built on the drand network. You encrypt a message to a future time. drand creates and publishes the key for that time when it arrives. Until then the key does not exist, so nobody can read the message, including you and us.

How it works in four steps

  1. drand is a network run by the League of Entropy, a group of independent organizations. Every 3 seconds the members work together to sign the next round number. No single member can make the signature alone.
  2. That signature is the key for anything encrypted to its round. To encrypt to a future round, you only need drand's public key, which is built into this site. In technical terms, this is identity-based encryption (Boneh–Franklin on the BLS12-381 curve) with the round number as the identity.
  3. Your message is encrypted with a random key using age (ChaCha20-Poly1305). That random key is then encrypted to the round you picked. The result is a normal age file with a tlock line: -> tlock <round> <chain hash>.
  4. When the round arrives, drand publishes its signature. Anyone with the encrypted file can download it, recover the random key and read the message.

The method comes from the paper tlock: Practical Timelock Encryption from Threshold BLS (Gailly, Melissaris and Romailler, 2023). This site uses the drand team's tlock-js library. Its files work with tlock (Go) and tlock-rs or dee (Rust), in both directions.

The network: drand quicknet

Chain hash52db9ba70e0cc0f6eaf7803dd07447a1f5477735fd3f661792ba94600c84e971
Public key83cf0f2896adee7eb8b5f01fcad3912212c437e0073e911fb90022d3e760183c8c4b450b6a0a6c3ac6a5776a2d1064510d1fec758c921cc22b0e17e63aaf4bcb5ed66304de9cf809bd274ca73bab4af5a6e9c76a4bc09e76eae8991ef5ece45a
Schemebls-unchained-g1-rfc9380 (unchained, signatures on G1, RFC 9380 hashing)
Period3 seconds
Genesis2023-08-23 15:09:27 UTC (round 1)
Relayshttps://drand.cloudflare.com, https://api.drand.sh, https://api2.drand.sh, https://api3.drand.sh

Round r is published at genesis + (r − 1) × 3 s. These settings are built into the site and the API. Every signature downloaded from a relay is checked against the public key. A relay can delay a round or refuse to send it, but it cannot fake one.

Who sees what

WebsiteJSON API and original endpointsOffline tool
Where encryption happensIn your browserOn our Cloudflare WorkerOn your computer
We see your messageNoYes, in memory during the requestNo
We see the encrypted textYes, and we store it for the share linkYes, in memory during the request. Stored only if you host it.No
drand relays seeYour IP address and the round you decryptOur Worker asking for the roundYour IP address and the round
Shown in recent activityThat a message was locked, when, and when it opensThe sameNothing

Encrypting needs no network connection, because the quicknet public key is built into the page. Decrypting downloads one public signature from a drand relay.

What we store

We store one row per encryption or decryption in a Cloudflare D1 database: encrypt or decrypt, website or API, the server time, the drand round and its unlock time. Recent activity lists the encryptions; decryptions are only counted. A row can't be traced to a message or its link.

Share links store the encrypted text, never the message. Every message encrypted on the website gets a share link, so we also store the encrypted block, its SHA-256, an id derived from the block and how many times its page reported a decryption. Plain notes around the block are dropped. The page at that link decrypts in the reader's browser. Nothing on this site links to message pages, so people find one only through its link or by pasting its encrypted text into Decrypt, which checks whether that text has a page. The check sends us an id derived from the encrypted text, not the text. If a link is posted publicly, search engines can index it. After the unlock time, anyone with the encrypted text can decrypt it, including us.

We do not store or log your message, IP addresses, browser details or cookies. Creating share links is rate limited by IP address at Cloudflare's edge, and the address is not saved. The site has no analytics and no third-party scripts. Like every site on Cloudflare, requests pass through Cloudflare's network, which processes connection data for security.

The drand check

The badge at the top of every page is a check your browser runs after the page loads. It asks two public drand relays (api.drand.sh and drand.cloudflare.com) for the chain information and the latest round. Then it checks that:

  • the chain hash and public key match the quicknet values built into this site,
  • the latest round's BLS signature is valid under that public key, and
  • the round number fits the current time, within 2 rounds (6 seconds).

What it proves: drand quicknet is running right now, and the relays serve rounds that were really signed with the key this site encrypts to. Click the badge to see each relay's result.

What it does not prove: that this site's own JavaScript is honest. The badge is part of the same code, so a compromised site could fake it. If that matters to you, encrypt offline.

Encrypt offline

For anything important, encrypt on your own computer. Then your message never touches a website. With dee (prebuilt for Linux, macOS and Windows):

# once: point dee at quicknet
dee remote add quicknet https://api.drand.sh/52db9ba70e0cc0f6eaf7803dd07447a1f5477735fd3f661792ba94600c84e971

# encrypt for 30 days (also accepts a round number or a date like "2030-01-01 00:00:00")
dee crypt -a -r 30d message.txt > message.age

# decrypt after the unlock time
dee crypt --decrypt message.age

Files made with dee open on this site, and files made here open with dee.

Limitations

Read these before you lock up anything that matters.

  • It depends on drand. Your message opens only when drand publishes your round. If quicknet pauses, the message stays locked until it restarts. If drand shuts down for good before your unlock time, nobody can ever open the message. Quicknet has run since 2023-08-23, but nobody can promise it will run for decades, so be careful with long locks. This site allows up to 100 years.
  • Nobody can open it early. Not you, not us, and not if you change your mind. There is no reset and no recovery. If you lose both the link and the encrypted text, the message is gone.
  • A share link is only as private as the link. Anyone who gets it can read the message after the unlock time, and can see the unlock time before then.
  • You trust most drand members. The lock holds as long as fewer than the threshold of League of Entropy members work together to cheat. If enough of them did, they could create future keys and open messages early. See drand's security assumptions.
  • The API sees your message. The JSON API encrypts on our server, so your message passes through it. We don't store or log it, but you have to take our word for that. The website and offline tools don't have this problem.
  • The website trusts the code we send. The website encrypts in your browser, so we never receive your message. But if someone took over this site, they could send code that leaks it. For high-stakes secrets, use an offline tool.
  • Times round up to 3 seconds. Unlock times move up to the next round. Unlocking follows drand's clock, not your device's. A wrong device clock only changes the countdown you see.
  • Some details are public. Anyone can encrypt anything to any round, so an encrypted message doesn't prove who wrote it or when. To prove when, post it publicly before it unlocks (how). Anyone with the encrypted text can see its unlock round and roughly how long the message is. Notes above the block are not protected.
  • Not quantum-safe. The method relies on pairings over the BLS12-381 curve, which a large quantum computer could break.
  • Activity numbers are approximate. Browsers report website events themselves, and we can't check them. Treat the counts as a rough guide.
  • Size limits. The JSON API takes messages up to 64 KiB, and the original endpoints take up to 5 MiB. Use an offline tool for bigger files.

Further reading