%ents; ]>
Explicit Message Encryption This specification provides a way to mark encrypted messages so the recipient can discover how to decrypt it. &LEGALNOTICE; 0380 Deferred Standards Track Standards Council XMPP Core XMPP IM XEP-0030 EME &linkmauve; 0.2.0 2018-01-25 XEP Editor (jwi) Defer due to lack of activity. 0.1 2016-10-26 fs

Initial published version approved by the XMPP Council.

0.0.2 2016-08-28 egp
  • Made the 'name' attribute optional for existing mechanisms.
  • Added a remark about the possibility to hide encrypted messages following user input.
  • Made explicit that this protocol affects any encryption mechanism, present or future, not only those listed here.
  • Display the namespace of the encryption mechanism in the default messages.
0.0.1 2016-08-14 egp

First draft.

In the past few years we have seen a strong interest in end to end encryption, with multiple competing mechanisms being defined on top of XMPP (e.g., &xep0027;, &xep0364; or &xep0373;). This specification addresses the lack of proper discoverability of most of these solutions by adding a machine-readable explanation of how a specific message has been encrypted.

In a federated network where no central entity can mandate a particular encryption mechanism, it becomes important to allow end users to know that a message could not be decrypted (e.g., due to a missing plugin), and to never fail to display that a message has been received due to that.

This document addresses the following requirements:

  1. Enable a client to mark a message as encrypted.
  2. Enable a client to determine whether a message was encrypted, no matter the encryption mechanism used.
  3. Enable a client to offer the user a possibility to decrypt a received message (depending on the encryption method).
  4. Enable a client to offer the user a possibility to decrypt subsequently received messages.

This document DOES NOT address the non-message usecases, encrypted presence and iq have very different requirements than those defined here.

Romeo, wanting to get Juliet’s attention but not wanting to reveal his intentions to the montague.lit nor to the capulet.lit servers, sends an encrypted message tagged as OTR, as follows:

?OTR?v23?... ]]>

Juliet’s client, noticing it does not have any OTR capability, will display that the message was encrypted but that it is not able to decrypt it instead of displaying the body, for example:

This message was encrypted with OTR (urn:xmpp:otr:0) and could not be decrypted.

Juliet may then communicate to Romeo that she was unable to receive his message, through an error, or maybe out of band.

Romeo, standing firm in his belief that they should not communicate without encryption in their world where anyone could be a malicious listener, then discovers that one of Juliet’s clients support &xep0373; and subsequently starts an encrypted session using that protocol.

... This message is encrypted with OpenPGP for XMPP. ]]>

Upon receiving this message, Juliet’s current client prompts her to enable a plugin, or even do it on its own, possible representations include:

This message was encrypted with OpenPGP for XMPP (urn:xmpp:openpgp:0), click here to enable this plugin.

Any encryption mechanism using message as a transport is a candidate, and MAY have a 'name' attribute to help the receiving client display it to the user, in case this client doesn’t understand its namespace yet. A 'name' attribute SHOULD NOT be included for the protocols listed herein, and SHOULD be ignored by a receiving client:

Name Namespace Specification
OTR urn:xmpp:otr:0 &xep0364;
Legacy OpenPGP jabber:x:encrypted &xep0027;
OpenPGP for XMPP urn:xmpp:openpgp:0 &xep0373;

If an entity supports the Encrypted Message Extension protocol, it MUST report that by including a &xep0030; feature of "urn:xmpp:eme:0" in response to disco#info requests:

]]> ... ... ]]>

Support can also be determined via &xep0115;, a.k.a. "caps".

Entities MUST report a failure to the user if they cannot decrypt an incoming message for any reason, and MAY prompt the user to install or enable a plugin to decrypt it.

Entities SHOULD include a non-encrypted body as possible, since older clients not supporting this protocol might otherwise ignore messages sent with an unknown encryption, making both the sender frustrated that their message did not get an answer, and the recipient frustrated that they never saw any message.

A sender entity MAY include the <encryption/> element even if the recipient doesn’t advertise support for it in their disco, or isn’t currently connected, since the recipient may be using multiple clients with different capabilities.

A sender entity MAY include a 'name' attribute for any encryption mechanism not listed in this specification, to help the receiving entity present it to the user, but SHOULD NOT include one for the ones listed here.

A receiving entity MUST NOT use the 'name' attribute if it is present and they already have a name associated with it.

A receiving entity MAY not display anything in case an encrypted message has been received, if the user agreed to that behaviour.

When a message is marked with an encryption tag and can not be decrypted, the body can safely be ignored and a localized message displayed instead.

If an entity includes a 'name' attribute, it should attempt to localise it to the best of its abilities for the receiving client.

A malicious entity could try to mimick the style of a client’s failure message, maybe including a link to a compromised plugin, so a client should not make those missing plugin messages look like normal messages.

This document requires no interaction with the Internet Assigned Numbers Authority (IANA).

This specification defines the following XML namespace:

  • 'urn:xmpp:eme:0'
The protocol documented by this schema is defined in XEP-xxxx: http://xmpp.org/extensions/xep-xxxx.html ]]>

Thanks to Mathieu Pasquet for his feedback.