mirror of
https://github.com/moparisthebest/xeps
synced 2024-08-13 16:53:48 -04:00
0.5 RC1 moved Requirements to a new XEP
git-svn-id: file:///home/ksmith/gitmigration/svn/xmpp/trunk@693 4b5297f7-1745-476d-ba37-a9c6900126ab
This commit is contained in:
parent
25d9c68e24
commit
71e0e582ce
129
xep-0188.xml
129
xep-0188.xml
@ -52,7 +52,7 @@
|
||||
<xep>
|
||||
<header>
|
||||
<title>Cryptographic Design of Encrypted Sessions</title>
|
||||
<abstract>This document describes the requirements and cryptographic design that underpin the XMPP protocol extensions Encrypted Session Negotiation, Offline Encrypted Sessions and Stanza Encryption.</abstract>
|
||||
<abstract>This document describes the cryptographic design that underpins the XMPP protocol extensions Encrypted Session Negotiation, Offline Encrypted Sessions and Stanza Encryption.</abstract>
|
||||
&LEGALNOTICE;
|
||||
<number>0188</number>
|
||||
<status>Experimental</status>
|
||||
@ -67,6 +67,12 @@
|
||||
<supersededby>None</supersededby>
|
||||
<shortname>cryptoesession</shortname>
|
||||
&ianpaterson;
|
||||
<revision>
|
||||
<version>0.5</version>
|
||||
<date>2007-03-28</date>
|
||||
<initials>ip</initials>
|
||||
<remark><p>Moved requirements, approach and scope to new XEP-0207</p></remark>
|
||||
</revision>
|
||||
<revision>
|
||||
<version>0.4</version>
|
||||
<date>2007-03-15</date>
|
||||
@ -94,30 +100,12 @@
|
||||
</header>
|
||||
|
||||
<section1 topic='Introduction' anchor='intro'>
|
||||
<p><em>Note: The protocols developed according to the requirements and cryptographic design described in this document are described in &xep0116;, &xep0187; and &xep0200;. The information in those documents should be sufficient for implementors. This purely informative document is primarily for people interested in the design and analysis of those protocols.</em></p>
|
||||
<p>As specified in &rfc3920;, XMPP is an XML streaming protocol that enables the near-real-time exchange of XML fragments between any two (or more) network endpoints. To date, the main application built on top of the core XML streaming layer is instant messaging (IM) and presence, the base extensions for which are specified in &rfc3921;. There are three first-level elements of XML streams (&MESSAGE;, &PRESENCE;, and &IQ;); each of these "XML stanza" types has different semantics, which can complicate the task of defining a generalized approach to end-to-end encryption for XMPP. In addition, XML stanzas can be extended (via properly-namespaced child elements) for a wide variety of functionality.</p>
|
||||
<p><em>Note: The protocols developed according to the cryptographic design described in this document are described in &xep0116;, &xep0187; and &xep0200;. The information in those documents should be sufficient for implementors. This purely informative document is primarily for people interested in the design and analysis of those protocols.</em></p>
|
||||
<p>As specified in &rfc3920;, XMPP is an XML streaming protocol that enables the near-real-time exchange of XML fragments between any two (or more) network endpoints. To date, the main application built on top of the core XML streaming layer is instant messaging (IM) and presence, the base extensions for which are specified in &rfc3921;. There are three first-level elements of XML streams (&MESSAGE;, &PRESENCE;, and &IQ;); each of these "XML stanza" types has different semantics, which can complicate the task of defining a generalized approach to end-to-end encryption for XMPP. In addition, XML stanzas can be extended (via properly-namespaced child elements) for a wide variety of functionality.</p>
|
||||
<p>XMPP is a session-oriented communication technology: normally, a client authenticates with a server and maintains a long-lived connection that defines the client's XMPP session. Such stream-level sessions may be secured via channel encryption using Transport Level Security (&rfc2246;), as specified in Section 5 of <cite>RFC 3920</cite>. However, there is no guarantee that all hops will implement or enforce channel encryption (or that intermediate servers are trustworthy), which makes end-to-end encryption desirable.</p>
|
||||
<p>The encrypted stanzas should be understood by an intermediate server only to the extent required to route them. (One complicating factor is that routing information may include not only the stanza's 'to', 'from', 'type, and 'id' attributes, but also &xep0079; extensions.)</p>
|
||||
<p>The session metaphor also applies to communication between endpoints: for instance, in IM applications, most instant messaging exchanges occur in bursts within limited time periods (e.g., two people may send a fairly large number of messages during a five-minute chat and then not exchange messages again for hours or even days). The XML stanzas exchanged during such a session may not be limited to &MESSAGE; stanzas; for instance, the session may be triggered by a change in one of the parties' presence status (e.g., changing from away to available) and the session may involve the exchange of &IQ; stanzas (e.g., to transfer a file as specified in &xep0096;).</p>
|
||||
<p>The foregoing XMPP communications exist in the context of a one-to-one communication session between two entities. However, several forms of XMPP communication exist outside the context of one-to-one communication sessions:</p>
|
||||
<ul>
|
||||
<li>Many-to-many sessions, such as a text conference in a chatroom as specified in &xep0045;.</li>
|
||||
<li>One-to-many "broadcast", such as undirected presence stanzas sent from one user to many contacts (see <cite>RFC 3921</cite>) and data syndication implemented using &xep0060;.</li>
|
||||
<li>One-to-one communications that are stored for later delivery rather than delivered immediately, such as so-called "offline messages".</li>
|
||||
</ul>
|
||||
</section1>
|
||||
|
||||
<section1 topic='Scope' anchor='scope'>
|
||||
<p>Ideally, any technology for end-to-end encryption in XMPP could be extended to cover all the scenarios above as well as one-to-one communication sessions. However, both many-to-many sessions and one-to-many broadcast are deemed out of scope for this document.</p>
|
||||
<p>Offline communications are handled via a simple extension to the protocol for one-to-one sessions between two entities that are online simultaneously (see below).</p>
|
||||
</section1>
|
||||
|
||||
<section1 topic='The Session Approach' anchor='approach'>
|
||||
<p>Existing approaches to encryption of Internet communications have generally assumed that the "thing" to be encrypted has a stable identity or is best understood as a standalone object (e.g., a file or email message); the term "object encryption" well captures this assumption. Both &xep0027; and &rfc3923; assume that XMPP communications are more like the exchange of email messages than they are like an interactive session -- while <cite>Current Jabber OpenPGP Usage</cite> uses "old-style" PGP object encryption and <cite>RFC 3923</cite> uses "new-style" S/MIME object encryption, both specify the use of object encryption. <!--(Another object encryption technology is &w3xmlsig;, which was rejected as a possible approach to end-to-end encryption for XMPP systems because of its inherent complexity and difficulty of implementation.)--></p>
|
||||
<p>However, because XMPP is a session-oriented communication technology, encryption schemes that are appropriate for other Internet technologies may not be appropriate for XMPP. XMPP, with its in-order delivery of XML stanzas, is able to take advantage of much more secure approaches to encryption (including Perfect Forward Secrecy) that are not feasible for less dynamic technologies (like email).</p>
|
||||
<p>The session-oriented nature of XMPP implies that the focus should be on "session encryption" rather than "object encryption". The paradigm for XMPP encryption should be something closer to the widely-deployed Secure Shell technology (see &rfc4301; and &rfc4253;) or &zrtp; (an acclaimed &rfc3711; key agreement protocol) than to traditional encryption of files and standalone email messages.</p>
|
||||
<p>Therefore, this document specifies a method for encrypted sessions ("ESessions") that takes advantage of the inherent possibilities and strengths of session encryption as opposed to object encryption. The conceptual model for this approach was inspired by "off-the-record" (OTR) communication, as implemented in the Gaim encryption plugin and described in &otr;. The basic concept is that of an encrypted session which acts as a secure tunnel between two endpoints. Once the tunnel is established, the content of all one-to-one XML stanzas exchanged between the endpoints will be encrypted and then transmitted within a "wrapper" protocol element.</p>
|
||||
<p>Note: In order to gain a thorough understanding of this document, it is recommended that the <cite>Off-the-Record Communication</cite> paper and the <cite>ZRTP</cite> Internet-Draft are read first.</p>
|
||||
<p>This document specifies a method for encrypted sessions ("ESessions") that takes advantage of the inherent possibilities and strengths of session encryption as opposed to object encryption. The detailed requirements for encrypted sessions are defined in &xep0207;.</p>
|
||||
<p>The conceptual model for the approach specified in this document was inspired by "off-the-record" (OTR) communication, as implemented in the Gaim encryption plugin and described in &otr;. The basic concept is that of an encrypted session which acts as a secure tunnel between two endpoints. Once the tunnel is established, the content of all one-to-one XML stanzas exchanged between the endpoints will be encrypted and then transmitted within a "wrapper" protocol element.</p>
|
||||
<p>Note: In order to gain a thorough understanding of this document, it is recommended that the <cite>Off-the-Record Communication</cite> paper and the &zrtp; Internet-Draft are read first.</p>
|
||||
</section1>
|
||||
|
||||
<section1 topic="Dramatis Personae" anchor='personae'>
|
||||
@ -129,93 +117,6 @@
|
||||
<p>While Alice and Bob are introduced as "end users", they are simply meant to be examples of XMPP entities. Any directly addressable XMPP entity may participate in an ESession.</p>
|
||||
</section1>
|
||||
|
||||
<section1 topic='Requirements' anchor='reqs'>
|
||||
<section2 topic='Security Requirements' anchor='reqs-sec'>
|
||||
<p>This document stipulates the following security requirements for end-to-end encryption of XMPP communications:</p>
|
||||
<ul>
|
||||
<li>Confidentiality</li>
|
||||
<li>Integrity</li>
|
||||
<li>Replay protection</li>
|
||||
<li>Perfect forward secrecy</li>
|
||||
<li>PKI Independence</li>
|
||||
<li>Authentication</li>
|
||||
<li>Identity Protection</li>
|
||||
<li>Repudiability</li>
|
||||
<li>Robustness</li>
|
||||
<li>Upgradability</li>
|
||||
</ul>
|
||||
<p>Each of these requirements is explained in greater depth below.</p>
|
||||
<section3 topic='Confidentiality' anchor='reqs-encrypt'>
|
||||
<p>The one-to-one XML stanzas exchanged between two entities MUST NOT be understandable to any other entity that might intercept the communications.</p>
|
||||
</section3>
|
||||
<section3 topic='Integrity' anchor='reqs-integrity'>
|
||||
<p>Alice and Bob MUST be sure that no other entity may change the content of the XML stanzas they exchange, or remove or insert stanzas into the ESession undetected.</p>
|
||||
</section3>
|
||||
<section3 topic='Replay Protection' anchor='reqs-replay'>
|
||||
<p>Alice or Bob MUST be able to identify and reject any communications that are copies of their previous communications resent by another entity.</p>
|
||||
</section3>
|
||||
<section3 topic='Perfect Forward Secrecy' anchor='reqs-forward'>
|
||||
<p>The encrypted communication MUST NOT be revealed even if long-lived keys are compromised in the future (e.g., Steve steals Bob's computer). <note>Long-lived keys are typically used for a few years, whereas Offline ESession keys are destroyed as soon as the stanza is decrypted - they typically exist for just a few hours. So Perfect Forward Secrecy should significantly enhance the security even of Offline ESessions.</note></p>
|
||||
</section3>
|
||||
<section3 topic='PKI Independence' anchor='reqs-pki'>
|
||||
<p>The protocol must not rely on any public key infrastructure (PKI), certification authority, web of trust, or any other trust model that is external to the trust established between Alice and Bob. However, if external authentication or trust models are available then Alice and Bob must be able to use them to enhance any trust that exists between them.</p>
|
||||
</section3>
|
||||
<section3 topic='Authentication' anchor='reqs-auth'>
|
||||
<p>Each party to a conversation MUST know that the other party is who they want to communicate with (Alice must be able to know that Bob really is Bob, and vice versa). <note>Authentication is not identification, authentication may be as simple as Alice confirming that Bob is the same Bob that she communicated with yesterday or that she talked to on the telephone. The reliable association between an entity and its public keys is "identification" and therefore beyond the scope of this document.</note></p>
|
||||
</section3>
|
||||
<section3 topic='Identity Protection' anchor='reqs-id-protect'>
|
||||
<p>No other entity should be able to identify Alice or Bob. The JIDs they use to route their stanzas are unavoidably vulnerable to interception. However, the public keys they use SHOULD NOT be revealed to other entities using a passive attack. Bob SHOULD also be able to choose between protecting either his public key or Alice's public key from disclosure through active ("man-in-the-middle") attacks.</p>
|
||||
</section3>
|
||||
<section3 topic='Repudiability' anchor='reqs-repudiate'>
|
||||
<p>Alice and Bob MUST be able to repudiate any stanza that occurs within an ESession. After an ESession has finished, it SHOULD NOT be possible to <em>prove cryptographically</em> that any transcript has not been modified by a third party. <note>Naturally, it is possible that Alice or Bob may retain cleartext versions of the exchanged communications; however, that threat is out of scope for this document.</note></p>
|
||||
</section3>
|
||||
<section3 topic='Robustness' anchor='reqs-robust'>
|
||||
<p>The protocol must provide more than one difficult challenge that must be overcome before an attack can succeed (for example, by generating encryption keys using as many shared secrets as possible - like retained secrets or optional passwords).</p>
|
||||
</section3>
|
||||
<section3 topic='Upgradability' anchor='reqs-upgrade'>
|
||||
<p>The protocol must be upgradable so that, if a vulnerability is discovered, a new version can fix it. Alice MUST tell Bob which versions of the protocol she is prepared to support. Then Bob MUST either choose one or reject the ESession. <note>It is exceptionally difficult to design a truly secure authenticated key-exchange protocol. Weaknesses are often only discovered after years of expert cryptographic analysis. In many cases, only the widespread use of a protocol will motivate experts to undertake exhaustive analyses and recommend enhancements.</note></p>
|
||||
</section3>
|
||||
</section2>
|
||||
<section2 topic='Application Requirements' anchor='reqs-xmpp'>
|
||||
<p>In addition to the foregoing security profile, this document also stipulates the following application-specific requirements for encrypted communication in the context of Jabber/XMPP technologies:</p>
|
||||
<ul>
|
||||
<li>Generality</li>
|
||||
<li>Implementability</li>
|
||||
<li>Usability</li>
|
||||
<li>Efficiency</li>
|
||||
<li>Flexibility</li>
|
||||
<li>Interoperability</li>
|
||||
<li>Offline "sessions"</li>
|
||||
<li>Object encryption</li>
|
||||
</ul>
|
||||
<p>Each of these is explained in greater depth below.</p>
|
||||
<section3 topic='Generality' anchor='reqs-generality'>
|
||||
<p>The solution should be generally applicable to the full content of any XML stanza type (&MESSAGE;, &PRESENCE;, &IQ;) sent between two entities. It is deemed acceptable for now if the solution does not apply to many-to-many stanzas (e.g., groupchat messages sent within the context of multi-user chat) or one-to-many stanzas (e.g., presence "broadcasts" and pubsub notifications); end-to-end encryption of such stanzas may require separate solutions or extensions to the one-to-one session solution.</p>
|
||||
</section3>
|
||||
<section3 topic='Implementability' anchor='reqs-implement'>
|
||||
<p>The only good security technology is an implemented security technology. The solution should be one that typical client developers can implement in a relatively straightforward and interoperable fashion.</p>
|
||||
</section3>
|
||||
<section3 topic='Usability' anchor='reqs-usable'>
|
||||
<p>The requirement of usability takes implementability one step further by stipulating that the solution must be one that organizations may deploy and humans may use with 100% transparency (with the ease-of-use of https:). Experience has shown that: solutions requiring a full public key infrastructure do not get widely deployed, and solutions requiring any user action are not widely used. If the users are prepared to verify the integrity of their copies of each other's keys then the necessary actions should be limited to a one-time out-of-band verification of a string of up to 6 alphanumeric characters.</p>
|
||||
</section3>
|
||||
<section3 topic='Efficiency' anchor='reqs-efficient'>
|
||||
<p>Cryptographic operations are highly CPU intensive, particularly public key and Diffie-Hellman operations. Cryptographic data structures can be relatively large especially public keys and certificates. The solution should perform efficiently even when CPU and network bandwidth are constrained. The number of stanzas required for ESession negotiation should be minimized.</p>
|
||||
</section3>
|
||||
<section3 topic='Flexibility' anchor='reqs-flexible'>
|
||||
<p>The solution should be compatible with existing (and future) cryptographic algorithms and identity certification schemes (including X.509 and PGP). The protocol should also be able to evolve to correct the weaknesses that are inevitably discovered once any cryptographic protocol is in widespread use.</p>
|
||||
</section3>
|
||||
<section3 topic='Interoperability' anchor='reqs-interop'>
|
||||
<p>Ideally, it would be possible for an XMPP user to exchange encrypted messages (and, potentially, presence information) with users of non-XMPP messaging systems.</p>
|
||||
</section3>
|
||||
<section3 topic='Offline Sessions' anchor='reqs-offline'>
|
||||
<p>Ideally, it should be possible to encrypt one-to-one communications that are stored for later delivery instead of being delivered immediately, such as so-called "offline messages". However, any vulnerabilities introduced to enable offline communications must not make online communications more vulnerable.</p>
|
||||
</section3>
|
||||
<section3 topic='Object Encryption' anchor='reqs-object'>
|
||||
<p>For cases where a session is not desired, it should be possible to encrypt, sign and send a single stanza in isolation, so-called "object encryption".</p>
|
||||
</section3>
|
||||
</section2>
|
||||
</section1>
|
||||
|
||||
<section1 topic='Cryptographic Origins' anchor='foundations'>
|
||||
<section2 topic='Introduction' anchor='foundations-intro'>
|
||||
<p>Authenticated key-exchange is the most challenging part of the design of any secure communication protocol. The ESessions key exchange essentially translates the σ<note>Like <cite>RFC 2409</cite>, this protocol uses <em>variant (ii)</em>, as described in Secion 5.4 of the <cite>SIGMA</cite> paper.</note> key-exchange protocol into the syntax of XMPP. The SIGMA approach to Diffie-Hellman Key Agreement (see &rfc2631;) underpins several standard key-exchange protocols including the Internet Key Exchange (IKE) protocol versions 1 and 2 (see &rfc2409; and &rfc4306;).</p>
|
||||
@ -276,7 +177,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td>SAS</td>
|
||||
<td>Short Authentication string</td>
|
||||
<td>Short Authentication String</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table caption='Key Exchange Parameters'>
|
||||
@ -380,7 +281,7 @@
|
||||
</section2>
|
||||
|
||||
<section2 topic='SAS-Only Overview' anchor='foundations-skeleton-sas'>
|
||||
<p>The diagram below demonstrates the skeleton of the Diffie-Hellman key exchange that employs out-of-band SAS authentication. If Alice and Bob's public keys are not yet trusted, or if their private keys have been compromised, then the hash commitment sent in the first step enables Alice and Bob to verify their copies of each other's Diffie-Hellman (and public) keys and detect a Man in the Middle more easily.</p>
|
||||
<p>The diagram below demonstrates the skeleton of the Diffie-Hellman key exchange that employs out-of-band Short Authentication String (SAS) verification. If Alice and Bob's public keys are not yet trusted, or if their private keys have been compromised, then the hash commitment sent in the first step enables Alice and Bob to verify their copies of each other's Diffie-Hellman (and public) keys and detect a Man in the Middle more easily.</p>
|
||||
<p>If a Man in the Middle changes the public Diffie-Hellman keys that Alice and Bob receive, then he could potentially use his knowledge of the SAS that Bob will eventually calculate when choosing the key he will send to Alice in the second step. However, the fact that the value he received in the first step is only a hash means the Man in the Middle must choose the key he sends to Alice before he can predict the SAS that she will calculate with it. Therefore, even if the SAS is very short, he is unable to use his resources to choose a key that will (have a better than random chance to) result in a SAS that matches Bob's. So only a truncated version of the HASH of Alice and Bob's keys needs to be verified out-of-band in the final step.</p>
|
||||
<pre>
|
||||
<strong>ALICE</strong>  <strong>BOB</strong> 
|
||||
@ -931,7 +832,7 @@ VERIFY(&signB;, &pubKeyB;, &macB;)
|
||||
</section1>
|
||||
|
||||
<section1 topic='Acknowledgments' anchor='acknowledgments'>
|
||||
<p>The author would like to thank Ian Goldberg for the time he spent reviewing this protocol and for his invaluable suggestions and comments.</p>
|
||||
<p>The author would like to thank: Ian Goldberg for the time he spent reviewing an early version of this protocol and for his invaluable suggestions and comments; and Hugo Krawczyk for his general advice and encouragment. The author of this document is entirely responsable for any errors it contains.</p>
|
||||
</section1>
|
||||
|
||||
</xep>
|
||||
|
Loading…
Reference in New Issue
Block a user