No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

xep-0187.xml 29KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411
  1. <?xml version='1.0' encoding='UTF-8'?>
  2. <!DOCTYPE xep SYSTEM 'xep.dtd' [
  3. <!ENTITY % ents SYSTEM 'xep.ent'>
  4. %ents;
  5. ]>
  6. <?xml-stylesheet type='text/xsl' href='xep.xsl'?>
  7. <xep>
  8. <header>
  9. <title>Offline Encrypted Sessions</title>
  10. <abstract>This document specifies an end-to-end encryption protocol for offline XMPP communication sessions.</abstract>
  11. &LEGALNOTICE;
  12. <number>0187</number>
  13. <status>Deferred</status>
  14. <type>Standards Track</type>
  15. <sig>Standards</sig>
  16. <dependencies>
  17. <spec>XMPP Core</spec>
  18. <spec>XMPP IM</spec>
  19. <spec>RFC 2104</spec>
  20. <spec>RFC 2409</spec>
  21. <spec>RFC 3526</spec>
  22. <spec>RFC 3548</spec>
  23. <spec>xml-c14n</spec>
  24. <spec>XEP-0004</spec>
  25. <spec>XEP-0020</spec>
  26. <spec>XEP-0068</spec>
  27. <spec>XEP-0079</spec>
  28. <spec>XEP-0116</spec>
  29. <spec>XEP-0155</spec>
  30. <spec>XEP-0163</spec>
  31. </dependencies>
  32. <supersedes/>
  33. <supersededby/>
  34. <shortname>TO BE ASSIGNED</shortname>
  35. &ianpaterson;
  36. <revision>
  37. <version>0.5</version>
  38. <date>2007-05-30</date>
  39. <initials>ip/psa</initials>
  40. <remark><p>Added reference to Requirements for Encrypted Sessions; modified namespaces to reflect XMPP Registrar procedures regarding URN issuance.</p></remark>
  41. </revision>
  42. <revision>
  43. <version>0.4</version>
  44. <date>2006-11-27</date>
  45. <initials>ip</initials>
  46. <remark><p>Added disclosure field; changed namespace</p></remark>
  47. </revision>
  48. <revision>
  49. <version>0.3</version>
  50. <date>2006-10-05</date>
  51. <initials>ip</initials>
  52. <remark><p>Replaced secure field with security field; changed otr field to list-single</p></remark>
  53. </revision>
  54. <revision>
  55. <version>0.2</version>
  56. <date>2006-07-19</date>
  57. <initials>ip</initials>
  58. <remark><p>Removed public key IDs from Offline options; harmonised session termination with the protocol added to XEP-0155; renamed logging field to otr</p></remark>
  59. </revision>
  60. <revision>
  61. <version>0.1</version>
  62. <date>2006-07-18</date>
  63. <initials>ip</initials>
  64. <remark><p>Initial version (extracted from XEP-0116 version 0.9).</p></remark>
  65. </revision>
  66. </header>
  67. <section1 topic='Introduction' anchor='intro'>
  68. <p>The convenience of sending stanzas to other entities that are offline ("offline messages") is an important and popular feature of most XMPP implementations (see &xep0160;). Without offline messages delivery would have to wait until both entities managed to be online at the same time. So many urgent messages could not be delivered in time. For example, the sender might want to send an urgent message before jumping on a flight.</p>
  69. <p>End-to-end encryption is another desirable feature for any communication technology. Unfortunately it is not possible to make offline encryption quite so secure as online encryption (see <link url='#sec'>Security Considerations</link>). However, offline encryption has a long history and is certainly preferable to having no encryption at all. <note>This protocol does not stop paranoid users avoiding sending offline messages.</note> Unfortunately, for reasons described in &xep0188;, the existing proposals (including &xep0027; and &rfc3923;) have not been widely implemented and deployed. This document describes a different approach to offline end-to-end encryption for use by entities that communicate using XMPP. It builds on the existing online &xep0116; protocol. As a result it offers important advantages over the existing "Object Encryption" proposals:</p>
  70. <ul>
  71. <li>Perfect Forward Secrecy <note>Long-lived keys are typically used for a few years, whereas Offline ESession decryption keys typically exist for just a few hours. So the Perfect Forward Secrecy feature significantly enhances the security of Offline ESessions.</note></li>
  72. <li>Other security features described in <cite>Cryptographic Design of Encrypted Sessions</cite></li>
  73. <li>Most of the code can be borrowed from implementations of <cite>Encrypted Session Negotiation</cite></li>
  74. </ul>
  75. <p>The requirements and the consequent cryptographic design that underpin this protocol are described in &xep0210; and <cite>Cryptographic Design of Encrypted Sessions</cite>. The basic concept is that of an encrypted session which acts as a secure tunnel between the online endpoint and the offline endpoint. The offline endpoint completes its part of the tunnel "negotiation" by publishing its preferences before it goes offline. Once the tunnel is established by the online endpoint, the content of each one-to-one XML stanza sent by the online endpoint is encrypted and then transmitted within a "wrapper" stanza using &xep0200;.</p>
  76. </section1>
  77. <section1 topic="Dramatis Personae" anchor='personae'>
  78. <p>This document introduces two characters to help the reader follow the necessary exchanges:</p>
  79. <ol start='1'>
  80. <li>"Bob" is the name of the online participant in the offline ESession. Within the scope of this document, his fully-qualified JID is: &lt;bob@example.com/laptop&gt;.</li>
  81. <li>"Alice" is the name of the offline participant in the offline ESession started by Bob. Within the scope of this document, we stipulate that her fully-qualified JID is: &lt;alice@example.org/pda&gt;.</li>
  82. </ol>
  83. <p>While Bob and Alice are introduced as "end users", they are simply meant to be examples of Jabber entities. Any directly addressable Jabber entity may participate in an offline ESession.</p>
  84. </section1>
  85. <section1 topic="Offline ESession Negotiation" anchor='init'>
  86. <p>The approach to establishing a secure session with an entity that is offline is in essence a special case of 3-message negotiation employed for online ESessions (see <cite>Encrypted Session Negotiation</cite>).</p>
  87. <p>Alice MAY publish a set of offline ESession options just before she goes offline. If Bob subscribes to Alice's presence and wishes to establish an online ESession with her, but he finds that she is offline, then if she published her offline ESession options before going offline, he may use the protocol described below to perform the initial Diffie-Hellman key exchange, establish an offline ESession and send encrypted stanzas to her while she is offline. Note: Bob MUST NOT initiate a new ESession with Alice if he already has an ESession established with her.</p>
  88. <p>Note: Alice MAY also publish <em>another</em> similar set of relatively long-lived <note>The more often Alice changes her published ESession options, the shorter the Perfect Forward Secrecy window of vulnerability. However, whenever she changes them she divulges her presence to all the entities that are monitoring them.</note> offline ESession options that any entity MAY use for the same purpose.</p>
  89. <section2 topic="Publishing Offline ESession Options" anchor='init-offline-publish'>
  90. <p>In order to publish either set of her offline ESession options Alice MUST create an options data form in exactly the same way as she would create an online ESession request data form (see the ESession Request section in <cite>Encrypted Session Negotiation</cite>) except she MUST omit The 'accept' and 'pubkey' fields. Note: The list of stanza types she is willing to decrypt MUST NOT include the value 'iq'.</p>
  91. <p>Alice MUST append to the content of the form an 'expires' field containing the UTC time (see &xep0082;) that she decides her offline ESession options will expire (see <link url='#sec-expire'>Options Expiry Time</link> Security Considerations).</p>
  92. <p>Alice MUST store her value of &NsubA; (her ESession ID), all her values of x (one for each MODP group) and the time she decides her offline ESession options will expire in a secure way, so that she can retrieve them when she comes back online (idealy even if that is using a different client and/or a different machine).</p>
  93. <p>If Alice would not be able to decrypt stanzas if she came back online using a different client and/or a different machine then she SHOULD also encapsulate the resource of her client in a 'match_resource' field and append it to her options data form. In this case, the list of stanza types she is willing to decrypt MUST include only 'message'.</p>
  94. <p>Alice MUST also append to the content of the form a list of signatures (see <link url='#sign'>Signature Generation</link>) of the <em>content</em> of the data form (excluding the 'signs' field). The list SHOULD include one signature for each of the public signature-verification keys that other entities may use to authenticate her.</p>
  95. <p>Alice MUST publish the ESession options data form through her own server using &xep0163;.</p>
  96. <p>If the pubkey PEP node does not exist already then Alice MUST create it first. In this case, Alice SHOULD specify the "Presence" access model for the set of options for presence subscribers (or the "Open" model for the set for other entities), unless she wants greater control over access to her identity (see <link url='#sec-identity'>Identity Protection</link> Security Considerations). Alice SHOULD specify that the options will never be pushed to subscribers (even when she publishes new options) - especially if she specifies the "Whitelist" access model.</p>
  97. <example caption='Alice Creates PEP Node for ESession Options for Presence Subscribers'><![CDATA[
  98. <iq from='alice@example.org/pda' type='set' id='create1'>
  99. <pubsub xmlns='http://jabber.org/protocol/pubsub'>
  100. <create node='http://www.xmpp.org/extensions/xep-0187.html#ns'/>
  101. <configure>
  102. <x xmlns='jabber:x:data' type='form'>
  103. <field var='FORM_TYPE' type='hidden'>
  104. <value>http://jabber.org/protocol/pubsub#node_config</value>
  105. </field>
  106. <field var='pubsub#deliver_notifications'>
  107. <option><value>0</value></option>
  108. </field>
  109. <field var='pubsub#send_last_published_item'>
  110. <option><value>never</value></option>
  111. </field>
  112. <field var='pubsub#access_model'>
  113. <option><value>presence</value></option>
  114. </field>
  115. </x>
  116. </configure>
  117. </pubsub>
  118. </iq>
  119. ]]></example>
  120. <example caption='Alice Creates PEP Node for ESession Options for All Entities'><![CDATA[
  121. <iq from='alice@example.org/pda' type='set' id='create2'>
  122. <pubsub xmlns='http://jabber.org/protocol/pubsub'>
  123. <create node='http://www.xmpp.org/extensions/xep-0116.html#ns'/>
  124. <configure>
  125. <x xmlns='jabber:x:data' type='form'>
  126. <field var='FORM_TYPE' type='hidden'>
  127. <value>http://jabber.org/protocol/pubsub#node_config</value>
  128. </field>
  129. <field var='pubsub#deliver_notifications'>
  130. <option><value>0</value></option>
  131. </field>
  132. <field var='pubsub#send_last_published_item'>
  133. <option><value>never</value></option>
  134. </field>
  135. <field var='pubsub#access_model'>
  136. <option><value>open</value></option>
  137. </field>
  138. </x>
  139. </configure>
  140. </pubsub>
  141. </iq>
  142. ]]></example>
  143. <p>Once the publishing node has been created, Alice can update her options for subscribers to her presence whenever she goes offline:</p>
  144. <example caption='Alice Publishes Her ESession Options for Her Presence Subscribers'><![CDATA[
  145. <iq from='alice@example.org/pda' type='set' id='pub1'>
  146. <pubsub xmlns='http://jabber.org/protocol/pubsub'>
  147. <publish node='http://www.xmpp.org/extensions/xep-0187.html#ns'>
  148. <item>
  149. <x type='form' xmlns='jabber:x:data'>
  150. <field type="hidden" var="FORM_TYPE">
  151. <value>urn:xmpp:ssn</value>
  152. </field>
  153. <field type="list-single" var="otr">
  154. <option><value>false</value></option>
  155. <option><value>true</value></option>
  156. </field>
  157. <field type="list-single" var="disclosure">
  158. <option><value>never</value></option>
  159. </field>
  160. <field type="list-single" var="security">
  161. <option><value>e2e</value></option>
  162. </field>
  163. <field type="list-single" var="modp">
  164. <option><value>5</value></option>
  165. <option><value>14</value></option>
  166. <option><value>2</value></option>
  167. </field>
  168. <field type="list-single" var="crypt_algs">
  169. <option><value>aes256-ctr</value></option>
  170. <option><value>twofish256-ctr</value></option>
  171. <option><value>aes128-ctr</value></option>
  172. </field>
  173. <field type="list-single" var="hash_algs">
  174. <option><value>whirlpool</value></option>
  175. <option><value>sha256</value></option>
  176. </field>
  177. <field type="list-single" var="sign_algs">
  178. <option><value>rsa</value></option>
  179. <option><value>dsa</value></option>
  180. </field>
  181. <field type="list-single" var="compress">
  182. <option><value>none</value></option>
  183. </field>
  184. <field type="list-multi" var="stanzas">
  185. <option><value>message</value></option>
  186. </field>
  187. <field type="list-single" var="ver">
  188. <option><value>1.3</value></option>
  189. <option><value>1.2</value></option>
  190. </field>
  191. <field type="text-single" var="rekey_freq">
  192. <value>1</value>
  193. </field>
  194. <field var="expires">
  195. <value>2006-06-09T02:56:15Z</value>
  196. </field>
  197. <field var="my_nonce">
  198. <value> ** Base64 encoded ESession ID ** </value>
  199. </field>
  200. <field var="dhkeys">
  201. <value> ** Base64 encoded value of e5 ** </value>
  202. <value> ** Base64 encoded value of e14 ** </value>
  203. <value> ** Base64 encoded value of e2 ** </value>
  204. </field>
  205. <field var="match_resource">
  206. <value>pda</value>
  207. </field>
  208. <field var="signs">
  209. <value> ** signature of form ** </value>
  210. <value> ** signature of form ** </value>
  211. </field>
  212. </x>
  213. </item>
  214. </publish>
  215. </pubsub>
  216. </iq>
  217. ]]></example>
  218. <p>At the risk of divulging her presence, Alice MAY also update her options for all entities:</p>
  219. <example caption='Alice Publishes Her ESession Options for All Entities'><![CDATA[
  220. <iq type='set' from='alice@example.org/pda' id='pub2'>
  221. <pubsub xmlns='http://jabber.org/protocol/pubsub'>
  222. <publish node='http://www.xmpp.org/extensions/xep-0116.html#ns'>
  223. ...
  224. </publish>
  225. </pubsub>
  226. </iq>
  227. ]]></example>
  228. </section2>
  229. <section2 topic="Requesting Offline ESession Options" anchor='init-offline-request'>
  230. <p>If Bob believes Alice is offline he SHOULD request her ESession options and, if he does not have a local copy of any of her public keys, her long-term public signature-verification keys from her server using <cite>Personal Eventing via Pubsub</cite> (see &xep0189;). <note>There is no need for Bob to discover Alice's support for the Offline ESessions protocol via &xep0030;.</note></p>
  231. <p>If Bob is subscribing to Alice's presence he MUST request her ESession Options exclusively for subscribers.</p>
  232. <example caption='Bob asks Alice&apos;s Server for her ESession Options (Subscribers)'><![CDATA[
  233. <iq type='get'
  234. from='bob@example.com/laptop'
  235. to='alice@example.org'
  236. id='es4'>
  237. <pubsub xmlns='http://jabber.org/protocol/pubsub'>
  238. <items node='http://www.xmpp.org/extensions/xep-0187.html#ns'/>
  239. </pubsub>
  240. </iq>
  241. ]]></example>
  242. <p>If Bob is not subscribing to Alice's presence (or if Alice has no ESession options exclusively for subscribers) he MUST use the following request instead.</p>
  243. <example caption='Bob asks Alice&apos;s Server for her ESession Options (All Entities)'><![CDATA[
  244. <iq type='get'
  245. from='bob@example.com/laptop'
  246. to='alice@example.org'
  247. id='es4'>
  248. <pubsub xmlns='http://jabber.org/protocol/pubsub'>
  249. <items node='http://www.xmpp.org/extensions/xep-0116.html#ns'/>
  250. </pubsub>
  251. </iq>
  252. ]]></example>
  253. <p>If, after receiving Alice's offline ESession options, Bob is unable to verify any of Alice's signatures of her options data form (see <link url='#sign'>Signature Verification</link>) with any of her public keys already in his possession (or with any of her keys he is able to acquire and trust) then he MUST proceed no further, since he cannot be sure who will be able to decrypt his stanzas.</p>
  254. <p>If Bob cannot acquire Alice's ESession options, or he does not support one or more of the options in each Alice's ESession fields, or if the 'expires' field indicates that Alice's options have expired, then he MUST NOT send encrypted stanzas to her while she is offline.</p>
  255. </section2>
  256. <section2 topic="Starting an Offline ESession" anchor='init-offline-start'>
  257. <p>Bob MUST now continue as if Alice had requested an online ESession, performing the steps described in three of the sections of <cite>Encrypted Session Negotiation</cite>:</p>
  258. <ol start='1'>
  259. <li><p><cite>Diffie-Hellman Preparation (Bob)</cite> Note: If the value of e he selected is not valid, Bob SHOULD terminate the ESession <em>without</em> sending an error.</p></li>
  260. <li><p><cite>Generating Session Keys</cite></p></li>
  261. <li><p><cite>Hiding Identity</cite> Note: Since Bob did not receive a 'pubkey' field, he MUST assume its value is 'key'. Bob SHOULD NOT include a 'pubkey' field in &formB; since Alice has already 'proved' her identity.</p></li>
  262. </ol>
  263. <p>As with 3-message ESession negotiation, Bob should encapsulate the Base64 encoded values of &IDB; and &MsubB; in data form fields ('identity' and 'mac'), and append the new fields to &formB;.</p>
  264. <p>Bob MAY also send encrypted content (see the Exchanging Stanzas section of <cite>Encrypted Session Negotiation</cite>) in the same stanza. Note: If he also includes a field named "terminate" set to a value of "1" or "true" within the data form (see the ESession Termination section of <cite>Encrypted Session Negotiation</cite>) then the ESession is terminated immediately. This special case, where a single stanza is encrypted and sent in isolation, is equivalent to object encryption (or object signing if no encryption is specified) and offers several significant advantages over non-session approaches - including perfect forward secrecy.</p>
  265. <p>If Alice included a 'match_resource' field in her ESession options, then Bob MUST address all the stanzas he sends within the offline ESession to the specified resource and use the <cite>Advanced Message Processing</cite> protocol to ensure that they are not delivered to any other resource.</p>
  266. <p>After sending &formB; to Alice, Bob can assume that the ESession negotiation is complete.</p>
  267. <example caption='Bob Establishes an ESession Without Negotiation'><![CDATA[
  268. <message from='bob@example.com/laptop' to='alice@example.org/pda' type='chat'>
  269. <init xmlns='http://www.xmpp.org/extensions/xep-0116.html#ns-init'>
  270. <x type='submit' xmlns='jabber:x:data'>
  271. <field var="FORM_TYPE">
  272. <value>urn:xmpp:ssn</value>
  273. </field>
  274. <field var="otr"><value>true</value></field>
  275. <field var="disclosure"><value>never</value></field>
  276. <field var="security"><value>e2e</value></field>
  277. <field var="modp"><value>5</value></field>
  278. <field var="crypt_algs"><value>aes256-ctr</value></field>
  279. <field var="hash_algs"><value>sha256</value></field>
  280. <field var="sign_algs"><value>rsa</value></field>
  281. <field var="compress"><value>none</value></field>
  282. <field var="stanzas"><value>message</value></field>
  283. <field var="ver"><value>1.3</value></field>
  284. <field var="rekey_freq"><value>50</value></field>
  285. <field var="my_nonce">
  286. <value> ** Base64 encoded ESession ID ** </value>
  287. </field>
  288. <field var="dhkeys">
  289. <value> ** Base64 encoded value of d ** </value>
  290. </field>
  291. <field var="nonce">
  292. <value> ** Base64 encoded ESession ID ** </value>
  293. </field>
  294. <field var="counter">
  295. <value> ** Base64 encoded block counter ** </value>
  296. </field>
  297. <field var="identity">
  298. <value> ** Encrypted identity ** </value>
  299. </field>
  300. <field var="mac">
  301. <value> ** Integrity of identity ** </value>
  302. </field>
  303. </x>
  304. </init>
  305. <c xmlns='http://www.xmpp.org/extensions/xep-0200.html#ns'>
  306. <data> ** Base64 encoded m_final ** </data>
  307. <mac> ** Base64 encoded a_mac ** </mac>
  308. </c>
  309. <amp xmlns='http://jabber.org/protocol/amp'>
  310. <rule action='??????' condition='match-resource' value='exact'/>
  311. </amp>
  312. </message>
  313. ]]></example>
  314. </section2>
  315. <section2 topic="Accepting Offline ESessions" anchor='init-offline-accept'>
  316. <p>When Alice comes online she MUST perform the following steps:</p>
  317. <ol>
  318. <li><p>Ensure she is no longer publishing offline ESession options exclusively for entities that are subscribing to her presence.</p>
  319. <example caption='Alice Stops Publishing Her ESession Options'><![CDATA[
  320. <iq type='set' from='alice@example.org/pda' id='es5'>
  321. <pubsub xmlns='http://jabber.org/protocol/pubsub'>
  322. <publish node='http://www.xmpp.org/extensions/xep-0187.html#ns'>
  323. <item/>
  324. </publish>
  325. </pubsub>
  326. </iq>
  327. ]]></example>
  328. </li>
  329. <li><p>Retrieve any values of &NsubA;, x (one for each MODP group for each &NsubA;) and her offline ESession options expiry time that she stored before going offline, and destroy in a secure way any persistently stored copies that correspond to ESession options exclusively for subscribers.</p></li>
  330. </ol>
  331. <p>If the current time is after her offline ESession options expiry time then she MUST discard all stanzas from offline ESessions without decrypting them. Otherwise, when Alice receives an offline ESession request stanza from Bob then she MUST perform the following steps:</p>
  332. <ol>
  333. <li><p>Select her value of x that corresponds to the 'nonce' and 'modp' fields she received from Bob. <note>Alice may not be able to find the specified value of x if, for example, she went offline using a different client and/or a different machine without publishing a 'match_resource' field. In this case Alice cannot decrypt the offline ESession!</note></p></li>
  334. <li><p>Confirm that she has not already received a key exchange stanza from Bob with the same value of d or &NsubB; ('my_nonce' field) since she published her ESession options (see the Replay Attacks subsection of the Security Considerations section of <cite>Encrypted Session Negotiation</cite>). If the options were for subscribers, that means since she came online.</p></li>
  335. <li><p>Alice MUST now continue as if Bob had responded to her online ESession request, performing the steps described in two of the sections of <cite>Encrypted Session Negotiation</cite>:</p>
  336. <ul>
  337. <li><p><cite>Diffie-Hellman Preparation (Alice)</cite> Note: If she is not prepared to support any of the ESession options specified by Bob, or if the value of d she selected is not valid, then Alice SHOULD terminate the ESession <em>without</em> sending an error.</p></li>
  338. <li><p><cite>Verifying Bob's Identity</cite> Note: Since Alice did not send a 'pubkey' field to Bob, she MUST assume its value is 'key'. If the value of &MsubB; she calculated does not match the one she received, or if she cannot confirm that &pubKeyB; really is Bob's public key, or if she cannot confirm that &signB; is the signature of the HMAC result, then Alice SHOULD terminate the ESession <em>without</em> sending an error.</p></li>
  339. </ul></li>
  340. </ol>
  341. </section2>
  342. </section1>
  343. <section1 topic="Exchanging Stanzas" anchor='exchange'>
  344. <p>Alice MUST NOT send encrypted content within an offline ESession started by Bob. If Bob is conducting an offline ESession with Alice when she is online (e.g., if he is not subscribing to her presence), then if Alice wants to send a stanza to Bob, she MUST terminate the offline ESession and start a new online ESession first.</p>
  345. <p>For Offline ESessions, Bob SHOULD include a 'Created' SHIM header in the encrypted content. Assuming she trusts Bob, Alice SHOULD trust this header and ignore the unencrypted &xep0091; element inserted by her server.</p>
  346. <example caption='Unencrypted Stanza'><![CDATA[
  347. <message from='bob@example.com/laptop'
  348. to='alice@example.org/pda'
  349. type='chat'>
  350. <body>Hello, Alice!</body>
  351. <amp xmlns='http://jabber.org/protocol/amp'>
  352. <rule action='error' condition='match-resource' value='exact'/>
  353. </amp>
  354. <headers xmlns='http://jabber.org/protocol/shim'>
  355. <header name='Created'>2005-02-10T03:01:52Z</header>
  356. </headers>
  357. <active xmlns='http://jabber.org/protocol/chatstates'/>
  358. </message>
  359. ]]></example>
  360. <example caption='XML Content to be Encrypted'><![CDATA[
  361. <body>Hello, Alice!</body>
  362. <headers xmlns='http://jabber.org/protocol/shim'>
  363. <header name='Created'>2005-02-10T03:01:52Z</header>
  364. </headers>
  365. <active xmlns='http://jabber.org/protocol/chatstates'/>
  366. ]]></example>
  367. </section1>
  368. <section1 topic='ESession Termination' anchor='terminate'>
  369. <p>If Bob notices that Alice comes online during his offline ESession with her then he MUST terminate the ESession immediately. If required he may then negotiate a new (more secure) online ESession.</p>
  370. <p>When Alice receives the offline ESession termination stanza from Bob, she SHOULD NOT send a termination stanza back to him.</p>
  371. </section1>
  372. <section1 topic='Security Considerations' anchor='sec'>
  373. <p>For more security considerations refer to the Security Considerations section of <cite>Encrypted Session Negotiation</cite></p>
  374. <section2 topic='Replay Attacks' anchor='sec-replay'>
  375. <p>Since Alice supplies the same set of values of e for all offline ESessions, to prevent complete offline ESessions being replayed to her, she MUST take care to securely store <em>new</em> values (or destroy existing values) of &NsubA; and x for subscribers whenever she goes offline (see <link url='#init-publish'>Publishing ESession Options</link>). Also, when Alice comes online again, she MUST remember all the values of d he receives in offline ESession negotiation stanzas, and reject any offline ESessions that specify a value of d she has already received (see <link url='#init-accept'>Accepting an Offline ESession</link>).</p>
  376. <p>Note: If Alice publishes ESession options for non-subscribers, and if she does not update them whenever she comes online then, until she updates the options, she MUST save all the values of d she receives to secure persistent storage (along with the values of &NsubA; and x).</p>
  377. </section2>
  378. <section2 topic='Options Expiry Time' anchor='sec-expire'>
  379. <p>If Alice's offline private Diffie-Hellman keys are compromised before she destroys them, and the attacker also controls communications between Bob and Alice's server, then the attacker could prevent Bob discovering if she comes online, and resend her compromised ESession options to Bob whenever he asks for them. This would allow the attacker to decrypt all messages sent to Alice before her offline ESession options expire. Alice would probably never receive the messages sent to her after she comes back online. If an attack is discovered before the compromised ESession options expire then Alice SHOULD change her long-term signing key. Alice SHOULD mitigate this attack by choosing an expiry time for her ESession options that is not too long after she expects to be online again.</p>
  380. </section2>
  381. <section2 topic='Identity Protection' anchor='sec-identity'>
  382. <p>Alice's Offline ESession options include her signatures. Although the signatures are public information, any entity that possesses one of Alice's corresponding public keys may confirm whether or not she is the entity using the JID. If it is important for Alice to protect her identity (i.e. hide the fact that she is the user of the JID), then she MUST carefully control who has access to her public keys.</p>
  383. </section2>
  384. <section2 topic='Conclusion' anchor='sec-conclusion'>
  385. <p>In addition to the issues above, the Perfect Forward Secrecy window of vulnerability is longer. More seriously, Alice MUST store her private Diffie-Hellman keys, &x1xZ;, to local disk or to a server (perhaps symmetrically encrypted with a password). It is <em>really</em> hard to securely erase something from a disk. Note: Once compromised, her private Diffie-Hellman keys could only be used to decrypt messages sent to her within offline Esessions until her offline ESession options expire. They could not be used to negotiate online ESessions <note>The online ESessions protocol forces both Alice and Bob to produce a signature of both their Diffie-Hellman keys together.</note>, or to send messages that appear to be from Alice. This is a significant benefit when compared to the existing "object encryption" schemes.</p>
  386. <p>Alice could decide not to support Offline ESessions since they are less secure than online ESessions. However, if Alice does that then, while she is offline, Bob, or Aunt Tillie, will probably send her completely unprotected messages!</p>
  387. </section2>
  388. </section1>
  389. <section1 topic='IANA Considerations' anchor='iana'>
  390. <p>This document requires no interaction with &IANA;.</p>
  391. </section1>
  392. <section1 topic='XMPP Registrar Considerations' anchor='registrar'>
  393. <section2 topic='Protocol Namespaces' anchor='ns'>
  394. <p>Until this specification advances to a status of Draft, its associated namespace shall be "http://www.xmpp.org/extensions/xep-0187.html#ns"; upon advancement of this specification, the &REGISTRAR; shall issue a permanent namespace in accordance with the process defined in Section 4 of &xep0053;.</p>
  395. </section2>
  396. </section1>
  397. </xep>