Dela challenge: read my task
A Dela demo account with one secret task and everything the server stores about it. Read the text of the task.
Check the file
SHA-256 of dela-challenge.json. If the hash of your download is different, the file was swapped or the download is incomplete.
9e1cdfa989b84344d3bf0de8ba3276e79741484f630337132c08dd7323555a15
What the export will not contain
The password hash (auth_hash), the master key encrypted with the password (bundle.masterByPassword) and their salts. With any of these a guessed password can be checked on your own computer without the server, and the challenge would turn into guessing my password: a short password breaks under any encryption.
What remains is everything encrypted with the space key and the master key. These are random 32-byte keys, they are not derived from the password. The account email is replaced with demo.
In Dela, data is encrypted on the device and the server stores only ciphertext. So that you can check this instead of taking it on faith, I publish everything the server stores about a demo account. It holds the ordinary tasks of an ordinary person and one secret task. The challenge: read its text.
Scripts and commands: scripts/demo/README.md. How the encryption is built: architecture.md, the "Encryption" section.
What is published
The export dela-challenge.json (format dela-challenge/1) is built by the script scripts/demo/export.ts straight from the server database. The rule for each table is written in TABLE_POLICY inside the script; a table without a rule stops the export, and a test checks the list against the server schema.
| Table | In the export | Why |
|---|---|---|
users |
id, created_at, is_admin, public keys (bundle.publicKey X25519, sign_key Ed25519), bundle.secretKeyByMaster, Argon2id parameters (bundle.kdf) |
public keys are handed to other users anyway; the X25519 secret key is encrypted with the master key |
users.email |
replaced with demo |
personal data of the author |
users.auth_salt, auth_hash, recovery_salt, recovery_hash, bundle.salt, bundle.masterByPassword, bundle.masterByRecovery |
no | see "Why there is no password hash" |
users.totp_* |
no | the TOTP secret is stored in the clear |
spaces |
id, kind, created_at, last_seq, key_version; created_by only as "own/foreign" |
spaces where the demo account is the only member |
members |
role, key_kind, key for the same spaces |
key is the space key wrapped with the master key |
envelopes |
seq, slot, hlc, payload for the same spaces |
the encrypted data itself |
files, file_parts |
id, size, parts, complete, created_at, ciphertext; created_by as "own/foreign" |
comment attachments (none in the demo) |
devices |
the number of devices and the times created_at, last_seen_at, revoked_at |
device id and names are replaced with device-N: the client sets the name, and it may describe the author's real phone |
sessions |
no | hashes of login tokens |
invites |
no | invitations and their authors |
push_subscriptions |
no | push service addresses of devices |
push_schedule |
no | reminder schedule of devices; the secret task has no due date, so it is not there |
passkeys |
no | WebAuthn keys of the author's devices |
rotations, rotation_envelopes |
no | an unfinished key change of a shared space, lives up to 30 minutes |
meta |
no | the server secret for fake salts and the VAPID keys |
Shared spaces where other people besides the demo account take part are not exported as a whole: they hold other people's data. Their number is in the summary.
Why there is no password hash
The server stores three things from which a password can be brute-forced offline: auth_hash (scrypt of the login secret, and the login secret is derived from the password through Argon2id), bundle.masterByPassword (the master key encrypted with a key from the password) and the salt. With any of them a guessed password is checked locally, without the server. Then the challenge would test the strength of my password, not the encryption: a short password would break under any encryption. So they are not published.
The honest consequence: whoever has the server database (the administrator or someone who stole it) can brute-force user passwords. Argon2id with 64 MiB of memory and 3 passes makes every attempt expensive, but it does not save a weak password. A long password or a phrase of several words closes this path.
bundle.masterByRecovery is encrypted with a random 256-bit recovery key and cannot be brute-forced. It is not published either: it adds nothing to the challenge, and the recovery key could have leaked somewhere. The server hands the Argon2id salt to anyone who knows the email (a key computation is needed before login), but without masterByPassword and the hash it is useless, and the email is hidden.
What is left is an honest task: everything encrypted with the space key and the master key is there, nothing derived from the password is. The master key and the space keys are random, 32 bytes each.
What the server sees in the open
- Spaces: id (UUIDv7, with the creation time inside), kind (personal or shared), creation time, the list of members and their roles, the key version.
- Slot of each cell:
BLAKE2b-128(slot key, JSON [table, record id, field]). One cell always lies in one slot, so you can see that it was overwritten. The slot does not reveal the table, the record or the field, and you cannot tell which slots belong to one record. - HLC stamp of each operation:
time in ms-counter-node id. The device clock sets the time, and the server accepts the stamp only if it is no more than 60 seconds ahead of its own clock. You can see when and how much was written. The node id is random for every client instance: you see how many different clients wrote, but not which device it is. - Arrival order (
seq) andlast_seq: how many operations the server accepted in total. The difference from the number of records in the log shows how many times cells were overwritten (the server keeps only the last version of a cell). - Ciphertext length: 24 bytes of nonce, 16 bytes of tag and the plaintext padded to a multiple of 64 bytes. The length is always
40 + 64·k. - Devices: how many, when created, when last seen, when revoked, names (replaced in the export).
- Account: email, registration time, public keys, whether TOTP is on.
- Files: ciphertext size, number of parts, upload time.
- Reminders: the trigger time (the text is encrypted separately).
- IP address the server sees during a request and keeps in memory to limit login attempts; it is not written to the database (a reverse proxy may write it into its own log).
What the server does not see
The kind of a record (task, project, label, habit, comment), record ids, field names and all values: titles, descriptions, due dates, priorities, labels, projects and their names, completion time, repeats, pomodoro intervals, comment text, file names and types. The links are hidden too: which task is in which project, whose subtask is whose, which task a comment belongs to.
The envelope of an operation:
slot = BLAKE2b-128(slot key, JSON [table, record, field]), hex
payload = nonce(24) ‖ XChaCha20-Poly1305(encryption key, pad64(JSON {t, r, f, v}), AAD = space ‖ slot ‖ hlc)
AAD binds the ciphertext to the space, the slot and the stamp: you cannot move a value to another cell or swap the stamp, the tag check will fail.
What can be inferred indirectly
This is metadata, not content, but it is real, and it is fair to say so:
- Text length to within 64 bytes. A task title cell is the JSON
{"t":"task","r":"<36 characters of id>","f":"title","v":"<title>"}, 74 bytes without the title, plus at least some padding bytes. A title up to 53 bytes of UTF-8 (about 26 Russian letters) gives 168 bytes of ciphertext, like most records; 54..117 bytes give 232 bytes. - Groups of cells from one action. Creating a task writes 6..10 cells in a row (title, project, section, parent, order, creation time, due date, labels), they go with neighboring
seqand neighboring HLC stamps. From the size of the groups you can guess where a task was created and where one was marked done. - Frequently changed cells: for a repeating task the due date is overwritten after every completion, which shows in
last_seq. - Work rhythm: HLC stamps by day show when a person uses the app.
- In this demo all HLC stamps sit in one short interval: the data was loaded by a script in a second. The creation and completion dates over the past 8 weeks lie only inside the ciphertext; the server sees one date, the day of filling.
The summary in the export (summary) and in the script output counts exactly these things: the number of spaces, records and accepted operations, the distribution of ciphertext lengths, the first and the last stamp, operations by day (UTC), the number of HLC nodes, devices and files. The record kind in the summary is null: the server cannot see it.
How to reproduce
- Start your own Dela server, create an invitation and fill the demo account:
node scripts/demo/seed.ts --server ... --email ... --invite ... --secret-prompt(details in the README). - On the server:
node scripts/demo/export.ts --db /data/dela.sqlite --email ... --out dela-challenge.json. - Check that the export is complete: sign in to the same account with the core (
packages/core:signIn,ensurePersonalSpace,spaceKeys) and decrypt the envelopes from the export with the functionopenEnvelope. This is what the testscripts/demo/test/challenge.test.tsdoes: with the account key exactly one secret task is read from the export, and without the key the export has no email, no hashes and no secret.
Before writing the file, the export script checks it itself: it has no email of any user, no ids of other users, spaces and devices, no salts, hashes and master key wrappers, no server secrets; every string field of a known kind is well formed (id, slot, stamp, base64 of the right length); every record ciphertext has the length 40 + 64·k and does not read as UTF-8 text. The server itself does not check that the client sent ciphertext, so this check also catches a client that would send plaintext.