Skip to content

User-Provided Recovery Key

NB! The user-provided recovery key is currently only supported by mobile apps. The web and desktop apps support using a user-provided recovery key (for device verification) but not creating a new one.

The recovery key is used to restore the user's chat backup and retain their digital identity in case they no longer have access to any of their devices. When setting up the backup (in Settings > Encryption), the recovery key is generated for the user and looks like this: EsTZ 4us6 nh29 89jk U1uH Zbae 4PuS QQC1 86pt em8o R8nb bdwQ.

Generated Recovery Key

Such a random generated key is the most secure option in terms of anyone being able to guess it or break it with brute force. However, this assumes that the user is able to store it in a password manager, on a secure USB hardware token or print it and secure the physical access to it (e.g. store it in a safe).

In some environments none of these options may be available. In such a case, it is possible to configure the Element Pro apps to let the user enter the recovery key (also known as passphrase) by choosing something that they can memorize (e.g. similar to a password).

User-Provided Recovery Key

The configuration is done via the Well Known URIs method. In the ESS deployment, the necessary values are injected to the well-known by configuring the well-known delegation "component":

wellKnownDelegation:
  additional:
    element: |
      {
        "recovery_passphrase_settings": {
          "min_character_count": 12
        }
      }

The example above activates the user-provided recovery key and requires the user to enter at least 12 characters.

Note that the configuration setting only affects application behaviour when creating a new recovery key. If the user previously generated a recovery key, it will continue to work, even if the admin configures the apps to allow user-provided keys. Likewise, if a user sets up backup using a manually entered key, and later the configuration is changed to generate keys, the user-provided key will continue to work until the user wants or needs to change recovery key.

Caution

The disadvantage of using user-provided recovery key is that a user can potentially enter a weak key which is easy to guess or break with brute force. This will allow the attacker to get access to the user's past end-to-end encrypted messages as well as impersonate the user in the future end-to-end encrypted messaging.

An additional risk is users using the same passphrase for their account password and recovery key. In the event of a homeserver compromise, this would allow the attacker full access to the user's identity and message history, by capturing the account password. In general we have found that users struggle to understand the need to choose separate passwords.

It is recommended that organizations conduct a risk assessment before they allow users to provide the recovery key.

Notes

  • The recovery key (either generated or user-provided) is separate from the user's account password. It is used to secure the backup of the end-to-end encrypted messages and the user's digital identity.

  • A user-provided recovery key and a generated recovery are not equivalent from a cryptographic point of view. The generated key is used directly as a cryptographic key for backup-related encryption/decryption operation whereas the user-provided key is used as a passphrase to derive such a cryptographic key from.