Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MSC4161: Crypto terminology for non-technical users #4161

Open
wants to merge 39 commits into
base: main
Choose a base branch
from
Open
Changes from 5 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
5f08ae9
Initial commit for MSC4161: Crypto terminology for non-technical users
andybalaam Jun 27, 2024
32f386b
First draft
andybalaam Jun 27, 2024
cd26b70
Fix typo
andybalaam Jun 27, 2024
a7b5a77
Fix mis-formatted heading
andybalaam Jun 27, 2024
a79b289
Fix incorrect bolding
andybalaam Jun 27, 2024
89412cc
Ensure we are consistently saying Alice's identity appears to have ch…
andybalaam Jun 27, 2024
d15576e
Add another example for key storage
andybalaam Sep 5, 2024
af70e43
Link to MSC4153 where we mention it.
andybalaam Sep 5, 2024
720cdeb
Make the wording about resetting keys more precise.
andybalaam Sep 5, 2024
de285aa
Re-word the paragraph about the importance of verified identity chang…
andybalaam Sep 5, 2024
57fc5c1
Link to the spec equivalent wording for our recovery key
andybalaam Sep 5, 2024
a4b95b4
Re-word the paragraph about Invisible Crypto
andybalaam Sep 5, 2024
0499900
Propose being an appendix to the spec
andybalaam Sep 6, 2024
b919630
Add a section on what to say when a message can't be decrypted
andybalaam Sep 6, 2024
007a15f
Add a missing 's'
andybalaam Sep 6, 2024
45928bb
changes->changed
andybalaam Sep 6, 2024
3a2d012
Remove erroneous UTD message
andybalaam Sep 6, 2024
56b5daf
Mention that clients SHOULD follow this guide and document any except…
andybalaam Oct 7, 2024
fba4f5c
person->user
andybalaam Oct 7, 2024
9246021
Reword sentence on cross-signing
andybalaam Oct 7, 2024
0c9d812
Re-word the "Waiting for this message" sentence
andybalaam Oct 7, 2024
705f7bb
Add missing word "message"
andybalaam Oct 7, 2024
4bcee33
Remove unneeded 'private key' warning
andybalaam Oct 7, 2024
f654c2e
Re-word 'key-backup' paragraph to contrast with export.
andybalaam Oct 7, 2024
3c7695f
Make clear that 'insecure device' is permitted
andybalaam Oct 7, 2024
7a789c5
Remove 'cryptographic' before 'identity', and also tone down the warn…
andybalaam Dec 17, 2024
3ed51ec
Link to spec sections on QR and emoji, and transitive trust MSC
andybalaam Dec 17, 2024
b44397b
Add a section about why this is important
andybalaam Dec 17, 2024
04df819
Add a paragraph about losing the recovery key
andybalaam Dec 17, 2024
bdbd7b4
Remove the 'appears to have changed' wording and add explanation
andybalaam Dec 17, 2024
7a9a84b
Note that older spec versions say 'recovery key'
andybalaam Dec 17, 2024
c13bd45
Add an Alternatives section about device and session
andybalaam Jan 31, 2025
d087885
Add a note about the Devices section depending on MSC4153
andybalaam Jan 31, 2025
a938372
Re-write key storage and recovery
andybalaam Jan 31, 2025
9cacbe7
Rename 'reset recovery' to 'change recovery key'
andybalaam Feb 3, 2025
0a449f6
Remove recommendation against recovery code
andybalaam Feb 3, 2025
f4de07d
Use a comma instead of a dash to avoid looking like a bullet point.
andybalaam Feb 4, 2025
2954056
Only unverified devices that have published keys are an error
andybalaam Feb 4, 2025
ecfd1ad
Link to the equivalent spec names for key storage and recovery
andybalaam Feb 4, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
170 changes: 135 additions & 35 deletions proposals/4161-crypto-terminology.md
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implementation requirements (in my opinion):

  • User research to show these terms as helpful and easily understood.

The research may be done through studies or deployment to a portion of the user base with analytics to show "easier" use of the app.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall review: The MSC appears to describe features and requirements of Element, and assumes that all clients in the ecosystem have similar or comparable features/needs. The assumptions read fine when applying this MSC to an Element client, but when comparing to the spec there feels like there's a gap in understanding.

Significant review from other client authors/developers, and their respective product/design teams, I think would be extremely valuable to help ensure this MSC does not solely apply to Element. This kind of review may need to be chased down as it's somewhat uncommon for a product-y MSC to be in the spec process.

Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,13 @@ clients SHOULD document how they deviate from this document, and why.

### Devices
andybalaam marked this conversation as resolved.
Show resolved Hide resolved

**Note: this section depends on [MSC4153](https://github.com/matrix-org/matrix-spec-proposals/pull/4153)
- Exclude non-cross-signed devices, which specifies clients should avoid sending
and receiving encryption info with devices that are not cross-signed by their
owner ("insecure" devices in our terminology). While MSC4153 remains unmerged,
the parts of this section relating to insecure devices should be considered
non-normative.**
andybalaam marked this conversation as resolved.
Show resolved Hide resolved

Instances of a client are called 'devices' (not 'sessions'). Aligned with
[MSC4153](https://github.com/matrix-org/matrix-spec-proposals/pull/4153), we take it as granted that all devices have been cross-signed by the
user who owns them, and we call these **devices**.
Expand Down Expand Up @@ -116,7 +123,24 @@ cryptography to understand.
⚠️ Avoid mentioning "device keys" - a device is just secure or not.

⚠️ Avoid "session" to mean device. Device better describes what most users
encounter, and is more commonly used in other products.
encounter, and is more commonly used in other messaging apps.

#### Logging out

In contrast to some other services, **logging out** (or **signing out**) of a
Matrix device is quite a significant operation: it means the encryption data on
this device is lost, and if you log out of all devices you will need to use your
recovery key to re-establish your identity and regain access to your old
messages.

If using a trusted physical device, the right choice for a user may well be not
to log out, but simply to close the app or browser and re-open it later. This
preserves their identity and their access to message history.

> "Are you sure you want to log out?"

> "If you log out of all devices, you will lose access to message history and
> will need to reset your identity."

### Verified user

Expand Down Expand Up @@ -170,7 +194,18 @@ fact we confirm identity cryptographically is usually irrelevant to the user.
### Identity

A user's **identity** is proof of who they are, and, if you have verified them,
proof that you have a secure communication channel with them.
proof that you have a secure communication channel with them. Your own identity
proves who you are, and gives you access to key storage.

Technical note: we use "identity" here to describe a collection of keys: the
master signing key, user signing key, device signing key, key storage key and
others.

Your identity allows you to be identified by other users, and also allows you to
access key storage and therefore see message history. This identity may be
stored on the server by using recovery. The recovery key is not part of your
identity, but allows you to re-establish your identity if you lose all your
devices.

> When a non-verified user resets their identity:
> "Warning: Alice's identity has changed."
Expand All @@ -189,6 +224,9 @@ proof that you have a secure communication channel with them.
> can create a new identity. (Warning: you will lose access to your old
> messages!)" button text (in red or similar): "Reset my identity"

> "Are you sure you want to reset your identity? You will lose access to your
> message history."

⚠️ Avoid saying "master key" - this is an implementation detail.

⚠️ Avoid saying "Alice reset their encryption" - the reason that Alice's identity
Expand Down Expand Up @@ -234,67 +272,70 @@ don't have access to this message**.

Your **message history** is a record of every message you have received or sent,
and is particularly used to describe messages that are stored on the server
rather than your device(s)
rather than your device(s). Where messages are encrypted, the message keys are
required to be able to read them, so "message history" includes those keys,
which are held in key storage.

### Key storage
richvdh marked this conversation as resolved.
Show resolved Hide resolved

**Key storage** means keeping cryptographic information on the server. This
includes the user's identity, and/or the message keys needed to
decrypt messages.
**Key storage** means message keys that are kept on the server, so that they can
be shared with the user's other devices (including new devices added in the
future).

If a user loses their recovery key, they may **reset** their key storage. Unless
they have old devices, they will not be able to access old encrypted messages
because the message keys are stored in key storage, and their cryptographic
identity will change, because it too is stored in key storage.
The keys inside key storage are themselves encrypted, so that the server
operator is not able to access them and read your messages.

> "Allow key storage"

> "Key storage holds your identity on the server along with the
> keys that allow you to read your message history."
> "Key storage holds the keys that allow you to read your message history."

> "Message history is unavailable because key storage is disabled."

⚠️ Avoid distinguishing between "secret storage" and "key backup" - these are
both part of key storage.
⚠️ Avoid using "key backup" to talk about storing message keys: this is too
easily confused with exporting keys or messages to an external system. Key
storage is for day-to-day use (reading message history), not a redundant store
for disaster recovery.

⚠️ Avoid talking about more keys: "the backup key is stored in the secret
storage, and this allows us to decrypt the messages keys from key backup".
Instead, we simply say that both identity and message keys are
stored in key storage.

⚠️ Avoid using "key backup" to talk about storing message keys: this is too
easily confused with exporting keys or messages to an external system.
### Recovery

⚠️ Avoid "4S" or "quad-S" - these are not descriptive terms.
Recovery is useful when a user loses all their devices (or logs out of them
all).

### Recovery key (and recovery passphrase)
If **recovery** is enabled, the user's identity is saved on the server, allowing
them to recover it if they lose all their devices. This in turn allows them to
recover their key storage and see message history. To recover their identity the
user must enter the **recovery key**.

A **recovery key** is a way of regaining access to key storage if the user loses
all their devices. Using key storage, they can preserve their cryptographic
identity (meaning other users don't see "Alice's identity has
changed" messages), and also read old messages using the stored message keys.
The server is not able to read or manipulate the saved identity, because it is
encrypted using the recovery key.

If a user loses their recovery key, they may **reset** their identity. Unless
they have old devices, they will not be able to access old encrypted messages
because the new identity does not have access to the old key storage.

A **recovery key** (or **recovery code**) is a way of re-establishing your
identity if you lose all your devices. This in turn allows you to access key
storage, and therefore see message history. If you re-establish your identity
instead of resetting it, other users won't see "Alice's identity has changed"
messages, and you will be able to read your message history, even if you logged
out everywhere or lost your devices.

A **recovery passphrase** is an easier-to-remember way of accessing the recovery
key and has the same purpose as the recovery key.

**Losing the recovery key**: if the user loses their recovery key, they can
"reset" it, which means re-storing the identity information in the server,
encrypted with a new recovery key. If the user has a verified client, then that
is holding the identity information locally, so they can reset their recovery
key without losing access to key storage. If they don't have a verified client
and they lose their recovery key, then they need to reset key storage as well as
recovery key (since the identity information is needed to read from key
storage), meaning they lose access to old messages.

> "Write down your recovery key in a safe place"

> "If you lose access to your devices and your recovery key, you will need to
> reset your message key storage, which will create a new identity"
> reset your identity, meaning you will lose all your message history"

> "If you lose your recovery key you can generate a new one if you are signed in
> elsewhere"
⚠️ Avoid "4S" or "quad-S" - these are not descriptive terms.

⚠️ Avoid using "security key", "security code", "recovery code", "master key". A
⚠️ Avoid using "security key", "security code", "master key". A
recovery key allows "unlocking" the key storage, which is a "box" that is on the
server, containing your identity and message keys. It is used to
recover the situation if you lose access to your devices. None of these other
Expand All @@ -313,13 +354,72 @@ from the usage here. The recovery key described in this section is referred to
in the spec as the
[secret storage key](https://spec.matrix.org/v1.8/client-server-api/#secret-storage).

#### Losing the recovery key

If the user loses their recovery key, they no longer have a way to recover their
identity.

If the user still has a secure device, then that device has its own copy of the
identity information, so they can **change recovery key** without losing their
identity, meaning other users will not see "Alice's identity has changed", and
they will be able to continue using key storage to access message history.

Note: users should be encouraged to change their recovery key if they have forgotten
their recovery key, because they are in a precarious position - if they lose
access to their device, they will be forced to reset their identity and lose
message history.

If the user does not have a device, or all their devices are insecure, then they
will need to reset their identity, meaning other users
see "Alice's identity has changed", and they lose access to their old key
storage, meaning they cannot read message history.

> "If you lose your recovery key you can generate a new one if you are signed in
> elsewhere"

⚠️ Distinguish between "Reset identity" and "Change recovery key" - these are
very different actions: resetting identity is destructive, whereas changing
recovery key from a device that holds the full identity information is benign.

## Potential issues
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The MSC should address why it's important that all clients use the same language, and why the language of the MSC is generic enough to fit the language and feel of all client applications. An app which has a less professional feel may prefer to use different terms for brand identity/recognition, for example. This MSC feels a bit too prescriptive for all audiences.

A common language feels important to me, regardless of audience impact, but the MSC does not really tell me why I should feel that way.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had a go here: b44397b . Is that something like what you hoped for?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@turt2live are you happy to resolve this thread?


Lots of existing clients use a whole variety of different terminology, and many
users are familiar with different terms. Nevertheless we believe that working
together to agree on a common language is the only way to address this issue
over time.

## Alternatives

### Device vs. Session

There is debate over the use of the word "device" to identify an instance of a
client. Objections to "device" include:

* Multiple apps on the same physical device will be listed as separate devices,
which may cause confusion.
* Logging out and in on the same physical device will result in a new "device"
being created.
* Some applications, especially on Web, use "session" for this concept.

The most popular alternative is "session". Objections to "session" include:

* It is an unfamiliar word for non-technical users: they have no metaphor to
work with to understand it.
* It has multiple existing alternative meanings within Matrix.

"Device" was chosen in the proposal because:

* It is familiar from similar messaging apps.
* It has a clear meaning in everyday speech, giving users a stepping-stone
towards understanding what it means in this context.
* For novice users, it corresponds well with the everyday meaning: when they
first engage with Matrix, they will use one "device" per physical device.
* The extension to think of multiple virtual "devices" on a physical device is
simple and familiar from other applications.
* Messaging apps are increasingly used on mobile devices, especially as the
first point of contact, and "device" is commonly used in mobile apps.
* The spec uses "device" for precisely this concept, which is a bonus.

## Further work

Several other concepts might benefit from similar treatment. Within
Expand Down