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., Current Jabber OpenPGP Usage (XEP-0027) , Current Off-the-Record Messaging Usage (XEP-0364)  or OpenPGP for XMPP (XEP-0373) ). 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:
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:
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:
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 OpenPGP for XMPP (XEP-0373)  and subsequently starts an encrypted session using that protocol.
Upon receiving this message, Juliet’s current client prompts her to enable a plugin, or even do it on its own, possible representations include:
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:
|OTR||urn:xmpp:otr:0||Current Off-the-Record Messaging Usage (XEP-0364) |
|Legacy OpenPGP||jabber:x:encrypted||Current Jabber OpenPGP Usage (XEP-0027) |
|OpenPGP for XMPP||urn:xmpp:openpgp:0||OpenPGP for XMPP (XEP-0373) |
|OMEMO||eu.siacs.conversations.axolotl||OMEMO Encryption (XEP-0384) |
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:
Thanks to Mathieu Pasquet for his feedback.
This document in other formats: XML PDF
This XMPP Extension Protocol is copyright © 1999 – 2020 by the XMPP Standards Foundation (XSF).
Permission is hereby granted, free of charge, to any person obtaining a copy of this specification (the "Specification"), to make use of the Specification without restriction, including without limitation the rights to implement the Specification in a software program, deploy the Specification in a network service, and copy, modify, merge, publish, translate, distribute, sublicense, or sell copies of the Specification, and to permit persons to whom the Specification is furnished to do so, subject to the condition that the foregoing copyright notice and this permission notice shall be included in all copies or substantial portions of the Specification. Unless separate permission is granted, modified works that are redistributed shall not contain misleading information regarding the authors, title, number, or publisher of the Specification, and shall not claim endorsement of the modified works by the authors, any organization or project to which the authors belong, or the XMPP Standards Foundation.
## NOTE WELL: This Specification is provided on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. ##
In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall the XMPP Standards Foundation or any author of this Specification be liable for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising from, out of, or in connection with the Specification or the implementation, deployment, or other use of the Specification (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if the XMPP Standards Foundation or such author has been advised of the possibility of such damages.
This XMPP Extension Protocol has been contributed in full conformance with the XSF's Intellectual Property Rights Policy (a copy of which can be found at <https://xmpp.org/about/xsf/ipr-policy> or obtained by writing to XMPP Standards Foundation, P.O. Box 787, Parker, CO 80134 USA).
The Extensible Messaging and Presence Protocol (XMPP) is defined in the XMPP Core (RFC 6120) and XMPP IM (RFC 6121) specifications contributed by the XMPP Standards Foundation to the Internet Standards Process, which is managed by the Internet Engineering Task Force in accordance with RFC 2026. Any protocol defined in this document has been developed outside the Internet Standards Process and is to be understood as an extension to XMPP rather than as an evolution, development, or modification of XMPP itself.
The primary venue for discussion of XMPP Extension Protocols is the <email@example.com> discussion list.
Discussion on other xmpp.org discussion lists might also be appropriate; see <http://xmpp.org/about/discuss.shtml> for a complete list.
Errata can be sent to <firstname.lastname@example.org>.
The following requirements keywords as used in this document are to be interpreted as described in RFC 2119: "MUST", "SHALL", "REQUIRED"; "MUST NOT", "SHALL NOT"; "SHOULD", "RECOMMENDED"; "SHOULD NOT", "NOT RECOMMENDED"; "MAY", "OPTIONAL".
Note: Older versions of this specification might be available at http://xmpp.org/extensions/attic/
Added OMEMO encryption namespace.
Made XEP experimental again.
Initial published version approved by the XMPP Council.