Skip to content

Sync encryption

When you sync, ZestSSH encrypts your data on your device before it leaves, the same way for ZestSSH Cloud and for storage of your own: a WebDAV server, an S3-compatible store or your Google Drive. The place your data is stored only ever holds ciphertext. It never receives your sync password, or a key that opens your data.

This page covers your personal space. A team’s data is encrypted under the team’s own keys: see Teams overview.

Key What it is Where it lives
Sync password The password you choose when you set up sync (some pages call it the sync password) Only in your head. ZestSSH never keeps it and never sends it
Data key A random 256-bit key, made once when sync is first set up. It encrypts your data On each of your devices that syncs, in the system’s secure storage (see Data at rest). In the store only wrapped, as below
Password key A 256-bit key derived from your sync password with Argon2id Made when needed, never kept on a disk
Recovery key ZEST and 20 random letters and digits, made on your device and shown once Only where you keep your recovery kit
Recovery key’s key A 256-bit key derived from your recovery key with Argon2id and a salt of its own Made when needed, never kept
sync password --Argon2id--> password key --AES-256-GCM--> data key, wrapped (1)
recovery key --Argon2id--> recovery key's key --AES-256-GCM--> data key, wrapped (2)
data key --AES-256-GCM--> your data

The data key never changes. So:

  • Changing your sync password wraps the data key again under the new password key. Your data is not encrypted again.
  • Using your recovery key unwraps the data key with the recovery key’s key, then opens your data. Then you choose a new sync password.
  • Making a new recovery key replaces wrapped copy (2). The old recovery key stops working.

Both the password key and the recovery key’s key are derived with Argon2id:

Setting Value
Memory 128 MiB (131,072 KiB)
Passes 3
Lanes 4
Output 32 bytes (256 bits)
Salt 32 random bytes, one for the password and another for the recovery key

The settings travel with your data, so a later version of ZestSSH can raise them without locking out data made today. Accounts set up before these settings use 64 MiB, 3 passes and 4 lanes, and keep working.

When it reads settings from the store, ZestSSH refuses anything weaker than 64 MiB, 3 passes and 4 lanes, and anything larger than 1 GiB, 32 passes and 16 lanes. So a store that was tampered with cannot make your password cheaper to guess, or hang the app.

  1. Your data is written as JSON and compressed with zlib.
  2. It is encrypted with AES-256-GCM under the data key, with a random 12-byte nonce. The 16-byte tag proves the data was not changed.
  3. What goes to the store is the password’s salt (32 bytes), the nonce (12), the tag (16), then the ciphertext.

Opening it runs the other way. A wrong key, or a single changed byte, fails the tag check, and nothing is restored.

The data key is wrapped with AES-256-GCM the same way: a 12-byte nonce, the 16-byte tag and the 32 encrypted bytes of the key, 60 bytes in all.

ZestSSH stops reading a sync download far larger than any real one (twice 16 MB), and stops unpacking data that would grow past 64 MB, so a store cannot exhaust the app’s memory.

How the store checks it is you, without your key

Section titled “How the store checks it is you, without your key”

To accept an upload, the store needs to know you hold the sync password, without ever seeing the password or its key. ZestSSH sends it a check value instead: HKDF with SHA-256 over the password key, with the label zestssh-sync-verification, then SHA-256 of that. A second value, with the label zestssh-recovery-verification, does the same for the recovery key. Neither value can be turned back into a key that opens your data.

On ZestSSH Cloud, the server checks the value. On your own storage, which has no logic of its own, your device checks it.

What ZestSSH Cloud Your own storage
Your data Ciphertext only Ciphertext only
Salts for the password and the recovery key Yes Yes
Argon2id settings Yes Yes
The two check values Yes Yes
The data key, wrapped twice (by password, by recovery key) Yes Yes
A version number, to notice two devices writing at once Yes Yes, with the time of the last upload and a device label: the system’s name and 8 random characters, such as windows_1a2b3c4d
Your sync password, the password key, the data key, the recovery key Never Never
Your hosts, keys, passwords or anything else in readable form Never Never

ZestSSH Cloud also has your account and the list of your signed-in devices. See Signed-in devices.

On your own storage, all of the above is in one file, zestssh-sync.json.

Each upload says which version it replaces. When another device uploaded first, the upload is refused, and your device downloads the newer data, merges its own changes into it and uploads again.

A new device can open your data in three ways:

  • with your sync password,
  • with your recovery key (see Recovery kit),
  • on ZestSSH Cloud, by approving it from a device you already use. Both screens show the same three pairing words, and the data key is sealed to the new device with X25519 and AES-256-GCM, so the server that passes it on cannot open it. See Signed-in devices.

ZestSSH Cloud is reached over HTTPS. Its certificate is checked against your system’s trusted certificates, and a certificate that fails the check is refused, always. The certificate is not pinned. Your data does not depend on this: it is encrypted before it is sent, so someone who broke the connection would see only the ciphertext described above.

WebDAV and S3 storage of your own is reached over HTTPS too. Plain http:// is allowed only for an address on your own network, such as 192.168.1.20 or nas.local, and refused for anything else: “This address uses plain http://, which sends your sign-in details unencrypted.” Your data is encrypted either way, but your sign-in details for that storage are not, over plain http.

Use your recovery key. Without the sync password and the recovery key, nobody can open your synced data, ZestSSH included. On ZestSSH Cloud, Reset cloud sync lets you start again, without the old data: see Cloud sync.