> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nuphos.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Vault

> How Nuphos Vault keeps your secrets end-to-end encrypted on your own devices, and how to add, approve and remove devices.

Nuphos Vault is a personal store for secrets such as API tokens. It belongs to
you alone: it is not shared with your team. Each value is encrypted on one of
your own devices before it is sent, and only your enrolled devices can decrypt
it. Nuphos stores only ciphertext and cannot read your values.

You can use the vault from Nuphos Desktop, under **Settings → Account → Vault**,
and from the CLI with `nuphos vault`. Both use the same vault and the same
format, so an item saved on one device opens on any other enrolled device.

## How your secrets are kept safe

* **Each device has its own key.** When you add a device, it generates an
  X25519 key pair. The private key stays on that device; only the public key is
  sent to Nuphos.
* **Each item has its own key.** Saving an item generates a new random 256-bit
  key, and the value is encrypted with AES-256-GCM under that key.
* **The item key is wrapped for every enrolled device.** The device saving the
  item encrypts the item key separately for each enrolled device's public key
  with HPKE ([RFC 9180](https://www.rfc-editor.org/rfc/rfc9180): DHKEM X25519,
  HKDF-SHA256, AES-256-GCM). Only the matching private key can unwrap it.
* **Nuphos keeps only ciphertext.** The server stores each device's name and
  public key, and each item's name, ciphertext and wrapped keys. It never
  receives a private key, an item key or a plaintext value.
* **An item is bound to its name.** The item name is authenticated as part of
  both the value's and the wrapped key's encryption, so a ciphertext or key
  moved to another item's name does not decrypt.
* **Every item stays readable by every enrolled device.** Nuphos rejects a save
  that does not include a wrapped key for each enrolled device, once each.

> [!NOTE]
>
> Item names, device names and when items were last updated are not encrypted.
> Choose names that do not reveal the secret itself.

## Devices

Each place you use the vault from is a separate device with its own key: the
Desktop app on a computer and the CLI on the same computer are two devices.

A device is in one of two states:

* **Enrolled** — it can read and save items.
* **Waiting for approval** — it has a key but cannot read anything yet.

### Your first device

While no device is enrolled, the device you add is trusted as soon as you add
it. Every later device waits until a device that is already enrolled approves
it.

### Approve a new device

Approving a device gives it access to every item in your vault, so confirm its
fingerprint first. A fingerprint is a short code derived from the device's
public key, five groups of four characters such as `1A2B-3C4D-5E6F-7A8B-9C0D`.

1. On the new device, add it to your vault. It shows its fingerprint and waits
   for approval.
2. On a device already in your vault, find the waiting device and start the
   approval. It shows the fingerprint of the key Nuphos has for that device.
3. Approve only if the two fingerprints match. A mismatch means the key Nuphos
   holds is not the one your new device generated.

When you approve, your enrolled device unwraps each item key with its own key,
wraps it again for the new device and sends the wrapped keys to Nuphos. Nuphos
cannot approve a device by itself, because it has no item keys to wrap.

The fingerprint a device shows for itself comes from the private key it holds,
not from what Nuphos returns. On Desktop, approval is tied to the fingerprint
you saw: if the device's key changed since you compared it, nothing is approved.

### Remove a device

Removing a device deletes it from your vault together with its wrapped keys,
and a device removing itself also deletes its local key. You can remove a
device from any of your devices, including one you no longer have.

* **Items are not re-encrypted.** A removed device that kept a copy of an item
  or its key can still open that copy. If a device was lost or compromised,
  remove it and then save new values for the secrets it could read.
* **The last enrolled device stays while items exist.** It is the only device
  that can read them. Delete the items first if you want to remove it.

## Where the device key is stored

| Client | Where the private key is kept |
| - | - |
| Desktop | The operating system's credential store: the login keychain on macOS, Credential Manager on Windows, and the Secret Service (such as gnome-keyring or KWallet) on Linux. If the store refuses the key, the computer is not added to your vault. |
| CLI | The operating system's credential store when one is available. Otherwise, such as on a Linux machine without a Secret Service, a file next to the CLI configuration that only your user can read (mode `0600`). |

Desktop and the CLI each keep their own credential store entry, so neither
asks for the other's key.

## Use the vault in Desktop

Open **Settings → Account → Vault**.

* **Add this computer** — adds Desktop on this computer as a device. If it is
  not your first device, the page shows its fingerprint while it waits for
  approval.
* **Devices** — lists every device with its fingerprint. On an enrolled
  computer, a waiting device has an **Approve** button; approving asks you to
  check the fingerprint first. **Remove** removes a device.
* **Items** — appears once this computer is enrolled. Enter a name and a value
  and select **Save**; saving an existing name replaces its value. **Show**
  decrypts a value on this computer, and **Delete** removes an item from every
  device.

## Use the vault from the CLI

```bash theme={null}
nuphos vault enroll [--name NAME]      # add this device; the name defaults to the hostname
nuphos vault devices                   # list devices with their state and fingerprint
nuphos vault approve DEVICE_ID         # approve a waiting device after checking its fingerprint
nuphos vault remove-device DEVICE_ID   # remove a device from your vault

echo -n "..." | nuphos vault set NAME  # save an item; the value is read from stdin
nuphos vault get NAME                  # print an item's value exactly as stored
nuphos vault list                      # list item names and when they were updated
nuphos vault rm NAME                   # delete an item
```

* `enroll` on a new device prints the command to run on an enrolled device and
  the fingerprint to compare.
* `approve` shows the waiting device's fingerprint and asks you to confirm it.
  Without a terminal it refuses unless you pass `--yes`, which skips the
  confirmation.
* `set` reads the value from stdin so it stays out of your shell history.

## Limits

* An item name is 1 to 128 characters: letters, digits, `.`, `_` or `-`,
  starting with a letter or digit.
* A value can be up to 64 KiB.
* A vault holds up to 1,000 items and 50 devices.
* The vault is personal. Items cannot be shared with teammates.
* There is no recovery. Nuphos never holds a key that can decrypt your items,
  so if you lose every enrolled device, the items cannot be read.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.