Skip to content

Data at rest

This page is about what ZestSSH keeps on your device: your hosts, your keys and their passwords, trusted host keys, snippets, command history and settings. How your data is protected on its way to your other devices is on Sync encryption.

Everything on this page is free, on every plan.

Two places: the database and the system’s secure storage

Section titled “Two places: the database and the system’s secure storage”

ZestSSH keeps your data in two places on each device.

The database. Your hosts, the names and types of your keys, trusted host keys, snippets, port forwards, networks, command history and the rest are in one database file, zestssh.db. It is encrypted with SQLCipher under a random key: 32 bytes from the system’s secure random generator. ZestSSH refuses to open the database when the SQLCipher library is missing, so it never writes your data to an unencrypted file by mistake.

  • Windows: in your local app data folder, %LOCALAPPDATA%\com.affluentlabs.zestssh\.
  • macOS, Linux, Android and iOS: in the app’s own support folder.

Each team you belong to has a database file of its own, beside yours, under a random key of its own. See Teams overview.

The system’s secure storage. The keys that open things are kept apart from the database, in the place your system offers for secrets:

SystemWhere secrets are kept
WindowsA file in the app’s data folder, encrypted with Windows’ data protection (DPAPI) for your Windows account
macOSThe macOS keychain
LinuxYour desktop’s secret store, through libsecret (the Secret Service), for example GNOME Keyring
iOSThe iOS keychain, readable after the first unlock since the phone started, and on this device only
AndroidEncrypted shared preferences, whose keys are held by the Android Keystore

In the secure storage, ZestSSH keeps:

  • the database’s key,
  • the secrets of the keys in your personal space: passwords, private keys, passphrases and certificates,
  • once sync is set up on the device, the key that opens your synced data, so the device can sync without asking you. Your master password is never kept.
  • your account’s own keys for teams, and the key of each team’s database,
  • the app lock’s settings, and the hash of your PIN while Encrypt data at rest is off.

The secrets of a team’s keys are kept in that team’s encrypted database instead.

If the database’s key is ever lost from the secure storage, for example after the system’s storage was reset, ZestSSH does not make a new key over your data, which would make it unreadable for good. It says so, and points you to your .zest backups. See Encrypted backups.

What this protects against, and what it does not

Section titled “What this protects against, and what it does not”

With only the above, your data is encrypted on the disk, but the key that opens it is in the system’s secure storage, which opens for your system account. Someone who copies the app’s files alone cannot read them. A program running as you, or someone at your unlocked computer, can reach the same secure storage that ZestSSH does.

Encrypt data at rest closes that gap: it puts the database’s key behind your app lock PIN.

  1. Turn on the app lock first. Until you do, the setting says “Set an App Lock PIN first to enable encryption.”
  2. Open the setting:
    • On a computer: Settings > Security, under Data-at-rest protection, Encrypt data at rest.
    • On a phone: More > Settings > Security, under Data-at-rest protection, Encrypt data at rest.
  3. Read the warning, enter your app lock PIN and tick I understand there is no recovery if I forget my PIN.
  4. Choose Turn on encryption.
  • The database’s key goes behind your PIN. ZestSSH makes a random 256-bit vault key and encrypts the database’s key with it (AES-256-GCM). It derives a key from your PIN with Argon2id and a random 32-byte salt, and encrypts the vault key with that (AES-256-GCM). Then it deletes the database’s key from the secure storage. From then on, only your PIN opens the database.

  • A guess at your PIN costs more on a computer. The Argon2id settings for the PIN are 64 MiB of memory, 4 passes and 2 lanes on a computer, and 4 MiB, 4 passes and 2 lanes on a phone. On a phone, hardware-backed encryption is what slows guessing.

  • The secrets in the secure storage are sealed too. Each is encrypted with AES-256-GCM under a 256-bit key kept inside the database, and bound to the name it is kept under, so it opens only where the database does: after your PIN. They are:

    • the secrets of your keys, and the keys of your certificate authorities,
    • the key of your synced data,
    • your account’s keys for teams, this device’s signing key for your teams, and the keys of your teams’ databases,
    • where a team’s events are sent, with the header that carries its token,
    • the password of your automatic backups, and the password of each WebDAV place they are copied to,
    • the key your saved session transcripts are encrypted with,
    • the Google Drive sign-in on a computer,
    • the Server monitor’s sign-in to Prometheus: its client certificate and that certificate’s password, a bearer token, a password and a header’s value.

    While the app is locked, none of these opens. An automatic backup that cannot open its password is not made, and ZestSSH says so: “Unlock ZestSSH and the next backup is made.”

  • Locking closes the database. While the app is locked, your data is not open on the device. Your PIN opens it again.

  • Only the PIN unlocks. Face ID, fingerprint, Touch ID and Windows Hello are not offered on the lock screen while it is on, because they cannot open the database.

  • No separate PIN hash is kept. Your PIN is checked by opening the vault itself, at the cost above.

  • The app lock stays on. You cannot turn the app lock off while encryption is on. The app lock setting says “Turn off “Encrypt data at rest” first to remove the lock”.

Turn the switch off, then enter your PIN in Turn off encryption?. “Your database will be stored with a key on this device again instead of behind your PIN.” The secrets that were sealed are kept as they were before, in the secure storage. The app lock stays on, with the same PIN.

On a computer, turn on full-disk encryption too

Section titled “On a computer, turn on full-disk encryption too”

On a computer, ZestSSH also says: “On a computer, also turn on full-disk encryption (BitLocker, FileVault or LUKS full-disk encryption) for real protection if the device is lost or stolen. This is a second layer on top.” Someone with your drive can try PINs against the files with nothing to slow them but Argon2id; full-disk encryption keeps them from the files in the first place.

On top of Encrypt data at rest, you can bind the key to this device’s secure hardware, so a copy of the files is of no use on any other device. Turn on Encrypt data at rest first; then turn on Hardware-backed encryption under Data-at-rest protection, and confirm Bind to this device? with Bind.

DeviceWhat holds the keyWhen you unlock
Android, iPhone, iPadThe Android Keystore, or the Secure Enclave, behind your device’s own authenticationYour PIN, then your device’s authentication: fingerprint, face, or the device’s PIN or passcode
WindowsA 2048-bit RSA key made inside this PC’s TPM, which cannot leave it. ZestSSH’s 256-bit hardware key is sealed with it (RSA-OAEP with SHA-256)Your PIN
macOS, LinuxNot available

The setting says when this device cannot do it: “Not available on this device (needs a screen lock and secure hardware)” on a phone, “Not available on this PC (no usable TPM)” on Windows.

To turn it off, turn the switch off and enter your PIN in Unbind from this device?. Your data goes back to PIN-only protection.

Other things ZestSSH does to keep secrets off the device

Section titled “Other things ZestSSH does to keep secrets off the device”
  • A secret you copy leaves the clipboard. A private key, a recovery key or an API key copied from ZestSSH is taken off the system’s clipboard 45 seconds later, or when the app locks, if the clipboard still holds it. Locking also clears ZestSSH’s own list of recently copied text.
  • The PIN cannot be brute-forced quickly at the lock screen: see PIN lock.

Some things you choose to write to a file are outside the database, and are protected only as the file is: