# Encrypted VFS

An item of a [VFS](VFS.md) that points at another system holds that system's address, and with it the user name and the password. **Encrypt URL** keeps this address encrypted in the stored user, so that somebody who can read the server's `users` folder, or a backup of it, does not read the passwords of your partners.

This page is about the stored address. To encrypt the **files**, see **Encryption** in [Advanced options of a VFS item](VFS-Advanced.md#encryption) and the server-wide file encryption in [Encryption](Prefs-Encryption.md).

## The switch

**Encrypt URL** is in **VFS Item Properties**, beside **Item type**, and it is on for a new item.

| | Stored in the item's file |
|---|---|
| on | the address as an unreadable text, and `encrypted` = `true` |
| off | the address as typed, with the password in it |

Leave it on. Turn it off only while you look for a mistake in an address, and turn it back on.

Items made by dragging a local folder have no password in them; the switch then only hides the path.

## What it protects against, and what not

The address is encrypted with a key the server has. It keeps passwords out of sight of people and programs that read files: a backup operator, a support bundle, a search through the disk. It does not protect against somebody who has the server's whole folder and the will to run it: the server must be able to read the address to connect.

For more, give the server a key for its stored secrets that is kept apart from the data: see [Passwords](Prefs-Encryption-Passwords.md). Or keep the password out of the server altogether, in a key vault: see [Special types](VFS-Special-Types.md#keyvault).

## Addresses in connection profiles

A [connection profile](Connection-Profiles.md) is always stored encrypted. An item that uses a profile holds only the name of the profile.

## A decryption class of your own

A developer can replace how an item's address is read. The item then names a class in `encrypted_class`, and the stored address can be a placeholder that only this class can turn into the real one, for instance by asking another system for it.

The class is given the item's settings and hands back the settings to use. It runs inside the server with all its rights: see the warning in [Custom VFS](VFS-Custom.md).

## Editing the files by hand

The files in a user's `VFS` folder are XML. An item can be written by a script:

```xml
<VFS_subitem type="properties">
  <url>sftp://acme:secret@files.partner.example.com/out/</url>
  <type>dir</type>
</VFS_subitem>
```

Saved like this, the address is in the clear. Open and save the item in the User Manager once, with **Encrypt URL** on, and it is stored encrypted. Scripts are better served by the [API](API.md), which stores it encrypted from the start.
