|
| 1 | +# MSC3673 - Encrypting ephemeral data units |
| 2 | + |
| 3 | +## Problem |
| 4 | + |
| 5 | +With the introduction of [MSC2476](https://github.com/ananace/matrix-doc/blob/user-defined-edus/proposals/2477-user-defined-ephemeral-events.md) |
| 6 | +we now have the ability to send and receive custom, user-defined ephemeral data |
| 7 | +units. This is a great mechanism for transferring short-lived data, applicable in |
| 8 | +a variety of situations where persistence is not desired. |
| 9 | + |
| 10 | +Unfortunately E2E encryption for EDUs isn't currently defined and some |
| 11 | +situations, like live user location sharing, come with privacy concerns, moment |
| 12 | +in which that becomes a problem. |
| 13 | + |
| 14 | +## Proposal |
| 15 | + |
| 16 | +This MSC proposes a generic mechanism for end to end encrypted ephemeral data |
| 17 | +units, building on top of MSC2476](https://github.com/ananace/matrix-doc/blob/user-defined-edus/proposals/2477-user-defined-ephemeral-events.md) |
| 18 | + |
| 19 | +We would like to wrap them inside the standard encryption envelope: |
| 20 | + |
| 21 | +```json5 |
| 22 | +{ |
| 23 | + "algorithm": "m.megolm.v1.aes-sha2", |
| 24 | + "sender_key": "<sender_curve25519_key>", |
| 25 | + "device_id": "<sender_device_id>", |
| 26 | + "session_id": "<outbound_group_session_id>", |
| 27 | + "ciphertext": "<encrypted_payload_base_64>" |
| 28 | +} |
| 29 | +``` |
| 30 | + |
| 31 | +in which the `ciphertext` will contain the custom EDUs payload and which will be |
| 32 | +sent to `rooms/{roomId}/ephemeral/m.room.encrypted/{txnId}`, similar to |
| 33 | +encrypted timeline events . |
| 34 | + |
| 35 | +The Megolm keys required to decrypt this EDU should be shared over Olm just like |
| 36 | +regular encrypted timeline events. |
| 37 | + |
| 38 | +Clients will receive the encrypted payloads in the `/sync`s `ephemeral` |
| 39 | +dictionary where `type` will be equal to `m.room.encrypted` and which can be |
| 40 | +decrypted using the pre-shared Megolm keys. |
| 41 | + |
| 42 | +## Alternatives |
| 43 | + |
| 44 | +We are not aware of any other straightforward solution for sharing sensisitive |
| 45 | +ephemeral data between users. |
0 commit comments