Freedom, dignity, and justice for Palestinians.

Compatible with drand/tlock.

Text Encryption Fetching WASM...

Plaintext

Ciphertext

File Encryption

You can have automatic decryption with goTimeLockPaste.

How it Works?

Structure

Drand Logo

Drand Network

Quoting drand.love: “drand (lower case, pronounced "DEE-rand") is a distributed randomness beacon daemon written in the Go programming language. It generates collective, publicly verifiable, unbiased, and unpredictable random values at fixed intervals using advanced cryptographic techniques.”

League of Entropy Logo

League of Entropy

The League of Entropy is a voluntary consortium, that runs drand, to provide publicly verifiable, unbiased, and unpredictable randomness. The consortium consits of big companys like Cloudflare, Ethereum Foundation, and more where they use drand to publish randomness.

Drand Network Modes

Network in Chain Mode

In chain mode, each round depends on the previous round, which mean that you can't predict future rounds' message.

Drand default chain mode Drand default chain mode

Network in Unchained Mode

In unchained mode, each round does not depend on the previous round, which mean that you can predict future rounds' message.

Drand default chain mode Drand default chain mode

The League of Entropy's Networks

There are three networks that we can access their randomness from the League of Entropy's endpoints:

  1. default network, which runs in chained mode and interests us for the LOTO system.
  2. quicknet network, which runs in unchained mode and help us to create time-lock encrypted messages.
  3. evmnet network, which runs in unchained mode for code that runs in the EVM.

The quicknet Network

Each network has a chain hash that acts as an identifier for the network. The chain hash for the quicknet network is 52db9ba70e0cc0f6eaf7803dd07447a1f5477735fd3f661792ba94600c84e971.

We can query the network by performing an HTTP request, either by the network's id or the network's chain hash, to the API-V2 endpoints. An example curl query:

curl -L 'https://api.drand.sh/v2/beacons/quicknet/rounds/latest' -H 'Accept: application/json'

The returned json will look like this:

{
  "round": 33230871,
  "signature": "977315cfad2327d12f97a145044c6e1bc59c67c89542d5c6dad9fc282ee81faf2ee6128e8968e8c174d709ca13a77ee1"
}

The quicknet network's message that is signed is the round number, so we can predict future signed messages. This allows us to use round numbers as identities in Identity Based Encryption, and this what the quicknet network is for.

By using the round number as the identity when encrypting, the signature becomes the private key to decrypt the encrypted message under Identity Based Encryption. The quicknet network's nodes act as Private Key Generator (PKG), that generates the signature that acts as a private key for decryption. However, we can only encrypt up to 32-bytes of data, but we can solve that by encrypting a file key and then encrypt the file using that file key with any encryption method, like AES-GCM.

Changelog

v0.3.0:
  • cmd/goTimeLock:
  • cmd/wasm:
    • Upgrade raphaeltannous/drand/client to v0.2.0 to allow requesting the drand round from multiple endpoints.
    • Add wasm fetching status.
    • Update error codes for decryption.
  • cmd/goTimeLockPaste:
    • New automatic decryption server.
v0.2.0:
  • cmd/goTimeLock:
    • Update usage.
    • Refactor.
  • cmd/wasm:
    • Add file encryption option.
    • Refactor.
v0.1.0 (WASM size: ~12MB):
  • Command-line tool (cmd/goTimeLock).
  • WASM frontend (cmd/wasm).