diff --git a/xep-0116.xml b/xep-0116.xml index bff6c053..0ae8f7bf 100644 --- a/xep-0116.xml +++ b/xep-0116.xml @@ -43,8 +43,8 @@
- Encrypted Sessions - This document specifies an XMPP protocol extension for session-based, end-to-end encryption. + Encrypted Session Negotiation + This document specifies an XMPP protocol extension for negotiating an end-to-end encrypted session. &LEGALNOTICE; 0116 Experimental @@ -52,6 +52,7 @@ Standards JIG XMPP Core + XMPP IM RFC 2104 RFC 2409 RFC 3526 @@ -62,6 +63,7 @@ XEP-0030 XEP-0068 XEP-0155 + XEP-0200 None None @@ -71,9 +73,9 @@ &dizzyd; 0.13 - 2006-11-16 + 2006-11-23 ip -

Added disclosure field and Back Doors section

+

Added disclosure field; added Back Doors and Key Associations sections; employed HMAC instead of hash; moved exchanging stanzas and rekeying sections to XEP-0200; changed namespace

0.12 @@ -152,7 +154,7 @@

End-to-end encryption is a desirable feature for any communication technology. Ideally, such a technology would design encryption in from the beginning and would forbid unencrypted communications. Realistically, most communication technologies have not been designed in that manner, and Jabber/XMPP technologies are no exception. In particular, the original Jabber technologies developed in 1999 did not include end-to-end encryption by default. PGP-based encryption of message bodies and signing of presence information was added as an extension to the core protocols in the year 2000; this extension is documented in &xep0027;. When the core protocols were formalized within the Internet Standards Process by the IETF's XMPP Working Group in 2003, a different extension was defined using S/MIME-based signing and encryption of CPIM-formatted messages (see &rfc3862;) and PIDF-formatted presence information (see &rfc3863;); this extension is specified in &rfc3923;.

For reasons described in &xep0188;, the foregoing proposals (and others not mentioned) have not been widely implemented and deployed. This is unfortunate, since an open communication protocol needs to enable end-to-end encryption in order to be seriously considered for deployment by a broad range of users.

-

This proposal describes a different approach to end-to-end encryption for use by entities that communicate using XMPP. The requirements and the consequent cryptographic design that underpin this protocol are described in Cryptographic Design of Encrypted Sessions. 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 each one-to-one XML stanza exchanged between the endpoints will be encrypted and then transmitted within a "wrapper" stanza.

+

This proposal describes a different approach to end-to-end encryption for use by entities that communicate using XMPP. The requirements and the consequent cryptographic design that underpin this protocol are described in Cryptographic Design of Encrypted Sessions. 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 each one-to-one XML stanza exchanged between the endpoints will be encrypted and then transmitted within a "wrapper" stanza using &xep0200;.

@@ -162,7 +164,7 @@
  • "Bob" is the name of the other participant in the ESession started by Alice. Within the scope of this document, his fully-qualified JID is: <bob@example.com/laptop>.
  • "Aunt Tillie" the archetypal typical user (i.e. non-technical, with only very limited knowledge of how to use a computer, and averse to performing any procedures that are not familiar).
  • -

    While Alice and Bob are introduced as "end users", they are simply meant to be examples of Jabber entities. Any directly addressable Jabber entity may participate in an ESession.

    +

    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.

    @@ -176,7 +178,7 @@ ]]> -

    If Bob sends a disco#info reply and he supports the protocol defined herein, then he MUST include a service discovery feature variable of "http://jabber.org/protocol/esession".

    +

    If Bob sends a disco#info reply and he supports the protocol defined herein, then he MUST include a service discovery feature variable of "urn:xmpp:esession".

    ... - + ...
    @@ -193,12 +195,20 @@
    +

    The process for establishing a secure session over an insecure transport is essentially a negotiation of various ESession algorithms and other parameters, combined with a translation into XMPP syntax of the σ approach to key exchange (see Cryptographic Design of Encrypted Sessions).

    If Alice believes Bob may be online then she SHOULD use the protocol specified in &xep0155; and in this section to negotiate the ESession options and the keys.

    Note: If Alice believes Bob is offline then she SHOULD NOT use this negotiation protocol. However, she MAY use the protocol specified in Offline Encrypted Sessions to establish the ESession options and keys. Alternatively, she MAY send stanzas without encryption - in which case her client MUST make absolutely clear to her that the stanzas will not be protected and give her the option not to send the stanzas.

    -

    Note: In any case, Alice MUST NOT initiate a new ESession with Bob if she already has one established with him.

    +

    Each entity (or each user of a client installation) MUST be assigned a large random Anonymous ID (AID) upon first use.

    +

    This protocol supports both 3- and 4-message key negotiations. The 3-message SIGMA-I-based key exchange protects the identity of the initiator against active attacks. This SHOULD NOT be used to establish client-to-client sessions since the responder's identity is not protected against active attacks. However, it SHOULD be used to establish client-to-service (server) sessions, especially where the identity of the service is well known to third parties.

    +

    The 4-message SIGMA-R-based key exchange with hash commitment defends the responder's identity against active attacks and facilitates detection of a Man in the Middle attack. It SHOULD be used to establish client-to-client sessions. The 4-message key exchange also features optional Short-Authentication-String protection against Man-in-the-Middle attacks without the need to generate, distribute or authenticate any public keys. As long as a hash commitment is used at the start of the key exchange then only a short human-friendly string needs to be verified out-of-band (e.g. by recognizable voice communication).

    +

    The 4-message key exchange also features optional secret retention. If retained secrets are employed consistently during key exchanges, then the Man in the Middle would need to be present for every session, including the first, and the out-of-band verification would only need to be performed once to verify the absence of a Man in the Middle for all sessions between the parties (past, present and future). This combination of techniques underpins the ZRTP key agreement protocol.

    +

    Public keys are optional in the diagram below. It describes the same SIGMA-R with SAS key exchange protocol as the SIGMA-R Overview. It provides much more detail including the use of retained secrets and other secrets. Note: These optional security enhancements are especially important when the protocol is being used without public keys.

    +

    Alternatively Alice and Bob could agree a shared secret via secure out-of-band communication, Bob could then use it to create an HMAC of his public key that only Alice could verify.

    +
    + -

    In addition to the "accept", "security", "otr" and "disclosure" fields (see Back Doors) specified in Chat Session Negotiation, Alice MUST send to Bob each of the ESession options (see list below) that she is willing to use, in her order of preference (see Mandatory to Implement Technologies). Note: Alice SHOULD NOT include a "reason" field since Aunt Tillie may not be aware the ESession request is not encrypted.

    +

    In addition to the "accept", "security", "otr" and "disclosure" fields (see Back Doors) specified in Chat Session Negotiation, Alice MUST send to Bob each of the ESession options (see list below) that she is willing to use, in her order of preference (see Mandatory to Implement Technologies).

    1. The list of Modular Exponential (MODP) group numbers (as specified in &rfc2409; or &rfc3526;) that MAY be used for Diffie-Hellman key exchange (valid group numbers include 1,2,3,4,5,14,15,16,17 and 18)

    2. Symmetric block cipher algorithm names

    3. @@ -222,7 +232,7 @@ - http://jabber.org/protocol/chatneg + urn:xmpp:chatneg 1 @@ -313,7 +323,7 @@ - http://jabber.org/protocol/chatneg + urn:xmpp:chatneg 1 true @@ -339,22 +349,22 @@ -

      Bob MUST use the shared secret ("K") and the selected hash algorithm ("HASH") to generate two sets of three keys, one set for each direction of the ESession.

      +

      Bob MUST use HMAC with the selected hash algorithm ("HASH") and the shared secret ("K") to generate two sets of three keys, one set for each direction of the ESession.

      For stanzas that Alice will send to Bob, the keys are calculated as:

        -
      1. Encryption key &KCsubA; = HASH(K, 0)

      2. -
      3. Integrity key &KMsubA; = HASH(K, 2)

      4. +
      5. Encryption key &KCsubA; = HMAC(HASH, K, "Initiator Cipher Key")

      6. +
      7. Integrity key &KMsubA; = HMAC(HASH, K, "Initiator MAC Key")

      8. -
      9. SIGMA key &KSsubA; = HASH(K, 4)

      10. +
      11. SIGMA key &KSsubA; = HMAC(HASH, K, "Initiator SIGMA Key")

      For stanzas that Bob will send to Alice the keys are calculated as:

        -
      1. Encryption key &KCsubB; = HASH(K, 1)

      2. -
      3. Integrity key &KMsubB; = HASH(K, 3)

      4. -
      5. SIGMA key &KSsubB; = HASH(K, 5)

      6. +
      7. Encryption key &KCsubB; = HMAC(HASH, K, "Responder Cipher Key")

      8. +
      9. Integrity key &KMsubB; = HMAC(HASH, K, "Responder MAC Key")

      10. +
      11. SIGMA key &KSsubB; = HMAC(HASH, K, "Responder SIGMA Key")

      Once the sets of keys have been calculated the value of K MUST be securely destroyed.

      -

      Note: As many bits of key data as are needed for each key MUST be taken from the least significant bits of the hash output. When negotiating a hash, entities MUST ensure that the hash output is no shorter than the required key data. For algorithms with variable-length keys the maximum length (up to the hash output length) SHOULD be used.

      +

      Note: As many bits of key data as are needed for each key MUST be taken from the least significant bits of the HMAC output. When negotiating a hash, entities MUST ensure that the hash output is no shorter than the required key data. For algorithms with variable-length keys the maximum length (up to the hash output length) SHOULD be used.

      @@ -384,7 +394,7 @@ - http://jabber.org/protocol/chatneg + urn:xmpp:chatneg 1 true @@ -422,7 +432,7 @@ - http://jabber.org/protocol/chatneg + urn:xmpp:chatneg 1 true @@ -498,22 +508,23 @@ &IDA; = CIPHER(&KCsubA;, &CsubA;, {&pubKeyA;, &signA;}) &MsubA; = HMAC(HASH, &KMsubA;, &CsubA;, &IDA;) -

      Alice MUST send the Base64 encoded values of &NsubB;, &IDA; and &MsubA; to Bob. If Alice has already confirmed Bob's identity (i.e. if Bob included 'identity' and 'mac' fields in his response), then she MAY also send encrypted content (see Exchanging Stanzas) in the same stanza as the proof of her identity.

      +

      Alice MUST send the Base64 encoded values of &NsubB;, &IDA; and &MsubA; to Bob. If Alice has already confirmed Bob's identity (i.e. if Bob included 'identity' and 'mac' fields in his response), then she MAY also send encrypted content (see &xep0200;) in the same stanza as the proof of her identity.

      ffd7076498744578d10edabfe7f4a866 - http://jabber.org/protocol/chatneg + urn:xmpp:chatneg + 1 ** Bob's Base64 encoded ESession ID ** ** Encrypted identity ** ** Integrity of identity ** - + ** Base64 encoded m_final ** ** Base64 encoded a_mac ** - + ]]>

      If Alice also includes a 'terminate' field with its value set to "1" or "true" (see ESession Termination) within the form then the ESession is terminated immediately. Note: 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.

      @@ -523,13 +534,13 @@ &macA; = HMAC(HASH, &KSsubA;, {&NsubB;, &NsubA;, e, &pubKeyA;, &formA;}) VERIFY(&signA;, &pubKeyA;, &macA;)

      If Alice has already confirmed Bob's identity (i.e. if Bob included 'identity' and 'mac' fields in his response above), then the ESession negotiation is complete.

      -

      Otherwise, one more step is necessary. Bob MUST send Alice the Base64 encoded values of &NsubA;, &IDB; and &MsubB; that he calculated previously (see Hiding Identity). Note: He MAY also send encrypted content (see Exchanging Stanzas) in the same stanza.

      +

      Otherwise, one more step is necessary. Bob MUST send Alice the Base64 encoded values of &NsubA;, &IDB; and &MsubB; that he calculated previously (see Hiding Identity). Note: He MAY also send encrypted content (see Stanza Encryption) in the same stanza.

      ffd7076498744578d10edabfe7f4a866 - + - http://jabber.org/protocol/chatneg + urn:xmpp:chatneg ** Alice's Base64 encoded ESession ID ** ** Encrypted identity ** ** Integrity of identity ** @@ -538,183 +549,36 @@ ]]>

      After receiving Bob's identity Alice MUST verify it by performing steps described in the section Verifying Bob's Identity above. Note: If Alice sends an error to Bob then she SHOULD ignore any encrypted content she received in the stanza.

      +

      Once ESession negotiation is complete, Alice and Bob MUST exchange only encrypted forms of the one-to-one stanza types they agreed upon (e.g., &MESSAGE; and &IQ; stanzas).

      + + + +
      - - -

      Once ESession negotiation is complete, Alice and Bob MUST exchange only encrypted forms of the one-to-one stanza types they agreed upon (e.g., &MESSAGE; and &IQ; stanzas).

      -

      Either Alice or Bob MAY send encrypted stanzas. Here we describe the process where Alice sends Bob an encrypted stanza. She MUST only encrypt the XML content that would normally be ignored by the intermediate servers. She MUST NOT encrypt stanza wrapper elements (only their content), &THREAD; or Advanced Message Processing elements.

      - - ffd7076498744578d10edabfe7f4a866 - Hello, Bob! - - - - - -]]> - - Hello, Bob! - -]]> -
      - - -

      Alice MUST perform the following steps to encrypt the XML content. Note: if there is no XML content to be encrypted (e.g. if this is an empty Re-Keying stanza), then &CsubA; MUST be incremented by 1 (see below), and only the last two steps (normalization and MAC calculation) should be performed.

      -
        -
      1. Serialize the XML content she wishes to send into an array of UTF-8 bytes, m. Although counter mode encryption requires no padding, implementations MAY still disguise the length of m by appending a random number of white-space characters.

      2. -
      3. -

        Compress m using the negotiated algorithm. If a compression algorithm other than 'none' was agreed, the compression context is typically initialized after key exchange and passed from one stanza to the next, with only a partial flush at the end of each stanza. If Bob were to receive a stanza out-of-order, then he would fail to decrypt the stanza and be forced to terminate the ESession.

        - m_compressed = compress(m) -
      4. -
      5. -

        Encrypt the data with the agreed algorithm in counter mode, using the encryption key &KCsubA;. Note: &CsubA; MUST be incremented by 1 for each encrypted block or partial block (i.e. &CsubA; = (&CsubA; + 1) mod 2n, where n is the number of bits per cipher block for the agreed block cipher algorithm). Note: if the block cipher algorithm 'none' was agreed (see Unencrypted ESessions) then encryption MUST NOT be performed and &CsubA; MUST be incremented by 1 (for replay protection).

        - m_final = encrypt(&KCsubA;, &CsubA;, m_compressed) -
      6. -
      7. -

        Alice MUST now create the Normalized XML content of the <encrypted/> XML element. If there is encrypted XML content, the XML MUST include the Base64 encoded value of m_final wrapped in a <data/> element. Note: the <encrypted/> element MAY also contain one <key/> element and one or more <old/> elements (see Re-Keying).

        - m_content = '<data> ** Base64 encoded m_final ** </data>' -
      8. -
      9. -

        The XML content and the value of Alice's block cipher counter &CsubA; before the data was encrypted, are now processed through the HMAC algorithm, along with the agreed hash algorithm ("HASH") and the integrity key &KMsubA;.

        - a_mac = HMAC(HASH, &KMsubA;, m_content, &CsubA;) -
      10. -
      - -
      - -

      Before sending the stanza to Bob, Alice MUST wrap m_content and the Base64 encoded value of a_mac (wrapped in a <mac/> element) inside an <encrypted/> element and insert it into the stanza in place of the original content. There MUST NOT be more than one <encrypted/> element per stanza.

      - - ffd7076498744578d10edabfe7f4a866 - - ** Base64 encoded m_final ** - ** Base64 encoded a_mac ** - - - - - - ]]> -
      - - -

      When Bob receives the stanza from Alice, he extracts and Base64 decodes the values of m_final and a_mac from the content and performs the following steps.

      -
        -
      1. -

        Remove the <mac/> element from the <encrypted/> element and Normalize the remaining XML content. Calculate the Message Authentication Code (MAC) for the content.

        - b_mac = HMAC(HASH, &KMsubA;, m_content, &CsubA;) -
      2. -
      3. -

        Verify that b_mac and a_mac match. If they are not identical, the content has been tampered with and Bob MUST terminate the ESession, he MAY send a ¬acceptable; error to Alice. If Bob were to receive a stanza out-of-order, then the MACs would not match because the values of &CsubA; would not be synchronized.

        -
      4. -
      5. -

        Decrypt m_final using the agreed algorithm, &KCsubA; and &CsubA;. Note: &CsubA; MUST be incremented by 1 for each decrypted block (see Encryption). Note: if the block cipher algorithm 'none' was agreed decryption MUST NOT be performed and &CsubA; MUST be incremented by 1.

        - m_compressed = decrypt(&KCsubA;, &CsubA;, m_final) -
      6. -
      7. -

        Decompress m_compressed using the negotiated algorithm (usually 'none').

        - m = decompress(m_compressed) -
      8. -
      9. -

        Replace the <encrypted/> element in the serialized XML stanza with m and feed the stanza into an XML parser. If the parser returns an XML format error then Bob MUST terminate the ESession, he MAY send a ¬acceptable; error to Alice. Bob MUST NOT send a stream error to his server since intermediate entities are not responsible for encoded content.

        -
      10. -
      -
      -
      - - -

      Once an attacker has discovered an encryption key it could be used to decrypt all stanzas within a session, including stanzas that were intercepted before the key was discovered. To reduce the window of vulnerability, both Alice and Bob SHOULD change their values of x and y and re-exchange the encryption key as regularly as possible. They MUST also destroy all copies of keys as soon as they are no longer needed.

      -

      Note: Although most entities are capable of re-keying after each stanza, clients running in constrained runtime environments may require a few seconds to re-key. During ESession negotiation these clients MAY negotiate the minimum number of stanzas to be exchanged between re-keys at the cost of a larger window of vulnerability. Entities MUST NOT initiate key re-exchanges more frequently than the agreed limit.

      - - -

      Either Alice or Bob MAY initiate a key re-exchange. Here we describe the process initiated by Alice. First she MUST calculate new values for the encryption parameters:

      -
        -
      1. Generate a secret random number x (where &twosup2n; < x < p - 1, where n is the number of bits per cipher block for the agreed block cipher algorithm)

      2. -
      3. Calculate e = &gsupx; mod p

      4. -
      5. Calculate K = &dsupx; mod p (the new shared secret)

      6. -
      7. Calculate &KCsubA;, &KMsubA;, &KCsubB;, &KMsubB; from K (see Generating Session Keys)

      8. -
      -

      To avoid extra stanzas, the new value of e SHOULD be sent to Bob along with an encrypted stanza. Note: Alice MUST NOT use the new &KCsubA; and &KMsubA; to encrypt this stanza or to calculate the MAC. However, she MUST use them when sending subsequent stanzas.

      -

      Note: There is no need for Alice to provide a signature because the calculation of the MAC includes the new value of e, see Exchanging Stanzas).

      - - ffd7076498744578d10edabfe7f4a866 - - ** Base64 encoded m_final ** - ** Base64 encoded value of new e ** - ** Base64 encoded a_mac ** - - - ]]> -

      Note: Bob may not receive the new key before he sends his next stanzas (they may cross in transit). So, before destroying her old values of &KCsubB; and &KMsubB;, Alice MUST wait until either she receives a stanza encrypted with the new key, or a reasonable time has passed (60 seconds should cover a network round-trip and calculations by a constrained client). Similarly she MUST wait before destroying her old value of x, in case Bob sends two stanzas before receiving Alice's new key (the first stanza might include a re-key).

      -
      - -

      After Bob has received a stanza with a new value of e, has confirmed it is greater than one, and has decrypted the stanza with the old value of &KCsubA;, he MUST securely destroy all copies of &KCsubA; and &KCsubB; and perform the following calculations with the new value of e:

      -
        -
      1. Calculate K = &esupy; mod p

      2. -
      3. Calculate &KCsubA;, &KMsubA;, &KCsubB;, &KMsubB; from K (see Generating Session Keys)

      4. -
      -

      He MUST use these new values to encrypt and decrypt all subsequent stanzas. If an entity fails to receive any stanza that includes a new key in the correct order, then it will fail to decrypt the next stanza it receives and be forced to terminate the ESession.

      -

      The next time Bob sends Alice a stanza he MUST specify the number of rekeys he has received from her since he sent her his last stanza. He does that by setting the 'rekeys' attribute of the <data/> element. Note: The default value of the 'rekeys' attribute is zero.

      - - ffd7076498744578d10edabfe7f4a866 - - ** Base64 encoded m_final ** - ** Base64 encoded b_mac ** - - - ]]> -

      When Alice receives the stanza from Bob she MUST use the 'rekeys' attribute to decide which of her values of &KCsubB; and &KMsubB; (or x) she should use to decrypt the stanza - otherwise she would not know if Bob received her rekey(s) before he sent the stanza. Once she is sure Bob has received her rekey(s) she MUST discard all her older values of &KCsubB;, &KMsubB; and x.

      -
      - -

      Once the expired MAC keys have been published, anyone could create valid arbitrary stanzas with them. This prevents anyone being able to prove the authenticity of a transcript of the ESession in the future.

      -

      Either entity MAY publish old values of &KMsubA; and/or &KMsubB; within any encrypted stanza as long as it knows that all the stanzas that MAY use the old values have been received and validated. Note: A 'man-in-the-middle' could delay the delivery of stanzas indefinitely. So, before Alice publishes &KMsubA; (and &KMsubB;), she MUST wait until she has both sent a re-key to Bob and received a stanza from Bob encrypted with her new key. (She MAY also publish &KMsubB; after she has received a re-key from Bob.)

      - - ffd7076498744578d10edabfe7f4a866 - - ** Base64 encoded m_final ** - ** Base64 encoded old MAC key ** - ** Base64 encoded old MAC key ** - ** Base64 encoded a_mac ** - - - ]]> -

      Entities SHOULD ignore any <old/> elements they receive.

      -
      -
      - -

      Either entity MAY terminate an ESession at any time. Entities MUST terminate all open ESessions before they go offline. To terminate an ESession Alice MUST send an encrypted stanza to Bob including within the encrypted XML of the <data/> element a chat negotiation form with a "terminate" field (as specified in the Termination section of Chat Session Negotiation). Note: She MAY publish old values of &KMsubA; and/or &KMsubB; within her termination stanza as long as she is sure all the stanzas that MAY use the old values have been received and validated (see Publishing Old MAC Values). She MUST then securely destroy all keys associated with the ESession.

      +

      Either entity MAY terminate an ESession at any time. Entities MUST terminate all open ESessions before they go offline. To terminate an ESession Alice MUST send an encrypted stanza to Bob including within the encrypted XML of the <data/> element a chat negotiation form with a "terminate" field (as specified in the Termination section of Chat Session Negotiation). Note: She MAY publish old values of &KMsubA; and/or &KMsubB; within her termination stanza as long as she is sure all the stanzas that MAY use the old values have been received and validated (see Stanza Encryption). She MUST then securely destroy all keys associated with the ESession.

      ffd7076498744578d10edabfe7f4a866 - + ** Base64 encoded encrypted terminate form ** ** Base64 encoded old MAC key ** ** Base64 encoded a_mac ** - + ]]>

      When Bob receives a termination stanza he MUST verify the MAC (to be sure he received all the stanzas Alice sent him during the ESession) and immediately send an encrypted termination acknowledgement form (as specified in the Termination section of Chat Session Negotiation) back to Alice. Note: He MAY publish any old values of &KMsubA; or &KMsubB; within the acknowledgement stanza. He MUST then securely destroy all keys associated with the ESession.

      ffd7076498744578d10edabfe7f4a866 - + ** Base64 encoded encrypted acknowledgement form ** ** Base64 encoded old MAC key ** ** Base64 encoded b_mac ** - + ]]>

      When Alice receives the stanza she MUST verify the MAC to be sure she received all the stanzas Bob sent her during the ESession. Once an entity has sent a termination or termination acknowledgement stanza it MUST NOT send another stanza within the ESession.

      @@ -725,7 +589,7 @@

      Before the signature or MAC of a block of XML is generated or verified, all character data between all elements MUST be removed and the XML MUST be converted to canonical form (see &w3canon;).

      All the XML this protocol requires to be signed or MACed is very simple, so in this case, canonicalization SHOULD only require the following changes:

        -
      • Set attribute value delimiters to quotation marks (i.e. simply replace all single quotes in the serialized XML with double quotes)
      • +
      • Set attribute value delimiters to single quotation marks (i.e. simply replace all single quotes in the serialized XML with double quotes)
      • Impose lexicographic order on the attributes of "field" elements (i.e. ensure "type" is before "var")

      Implementations MAY conceivably also need to make the following changes. Note: Empty elements and special characters SHOULD NOT appear in the signed or MACed XML specified in this protocol.

      @@ -782,36 +646,34 @@

      Weak pseudo-random number generators (PRNG) enable successful attacks. Implementors MUST use a cryptographically strong PRNG to generate all random numbers (see &rfc1750;).

      - -

      After a key exchange an entity MUST NOT exchange a total of &twosup32; encrypted blocks before it initiates a key re-exchange (see &rfc4344;). Note: This limitation also ensures the same key and counter values are never used to encrypt two different blocks using counter mode (thus preventing simple attacks).

      -

      In order to reduce the Perfect Forward Secrecy window of vulnerability, after an extended period of activity, entities SHOULD either re-key or terminate the ESession.

      + +

      Alice and Bob MUST ensure that the value of e or d they provide when negotiating each online ESession is unique. This prevents complete online ESessions being replayed.

      The trust system outlined in this document is based on Alice trusting that the public key presented by Bob is actually Bob's key (and vice versa). Determining this trust may be done in a variety of ways depending on the entities' support for different public key (certificate) formats, signing algorithms and signing authorities. For instance, if Bob publishes a PGP/GPG public key, Alice MAY verify that his key is signed by another key that she knows to be good. Or, if Bob provides an X.509 certificate, she MAY check that his key has been signed by a Certificate Authority that she trusts.

      -

      When trust cannot be achieved automatically, methods that are not transparent to the users may be employed. For example, Bob could communicate the SHA-256 fingerprint of his public key to Alice via secure out-of-band communication (e.g. face-to-face). This would enable Alice to confirm that the public key she receives in-band is valid. Note however that very few people bother to verify fingerprints in this way. So this method is exceptionally vulnerable to 'man-in-the-middle' attacks. In order to reduce the window of vulnerability, an entity SHOULD remember the fingerprints of all user-validated public keys and alert the user in the future if ever the fingerprint(s) it stored for an entity do not match any of the received public keys.

      -

      Alternatively Alice and Bob could agree a shared secret via secure out-of-band communication, Bob could then use it to create an HMAC of his public key that only Alice could verify.

      +

      When trust cannot be achieved automatically, methods that are not transparent to the users may be employed. The out-of-band Short Authentication String mechanism described in this document is an easy way for people to do that. Alternatively, Bob could communicate the full SHA-256 fingerprint of his public key to Alice via secure out-of-band communication (e.g. face-to-face). This would enable Alice to confirm that the public key she receives in-band is valid. Note: Since very few people bother to (consistently) verify SAS or fingerprints, entities SHOULD protect against 'man-in-the-middle' attacks using retained secrets and/or other secrets.

      Note: If no keys are acceptable to Alice (because Alice has never verified any of the keys, and because either the keys are not signed, or Alice does not support the signature algorithms of the keys, or she cannot parse the certificate formats, or she does not recognise the authorities that signed the keys) then, although the ESession can still be encrypted, she cannot be sure she is communicating with Bob.

      - -

      The block cipher counters maintained implicitly by Alice and Bob (&CsubA; and &CsubB;) prevent stanzas being replayed within any ESession. They ensure that the MAC will be different for all stanzas, even if the HMAC key and the content of the stanza are identical.

      -

      Alice and Bob MUST ensure that the value of e or d they provide when negotiating each online ESession is unique. This prevents complete online ESessions being replayed.

      + +

      An entity SHOULD remember the fingerprints of all public keys it receives, and remember whether or not they have been validated by the user (see Verifying Keys).

      +

      Entities MUST associate one or more JIDs with each public key fingerprint that they store, and alert their users immediately if another JID presents the same public key. This is necessary since if Bob already has fingerprints from Alice and Mallory, and Bob's client presents only the JID (or a name associated with the JID) to Bob, then Mallory could use his own public key (that is trusted by Bob) and pretend to be Alice simply by exchanging stanzas with Bob using Alice's JID.

      +

      If a JID for which a key has previously been stored attempts to establish an ESession using a public key with a different fingerprint (or no key at all) then the entity MUST alert its user.

      +

      Since Alice MAY use many different JIDs to talk to Bob, but always identify herself to him with the same public key, Entities SHOULD associate a "petname" with each public key fingerprint they store. Entities MUST present any public key petnames clearly to their users, and more prominently than any petname or nickname associated with the JID or the JID itself.

      +

      Entities MUST take the precautions described above also when storing retained secrets and other secrets (passwords) associated with Anonimous IDs.

      -

      Organisations with full disclosure policies may require entities to disable encryption (see Back Doors) to enable the logging of all messages on their server. Unencrypted ESessions meet all the Security Requirements except for Confidentiality. Unencrypted ESessions enable Alice to to confirm securely with Bob that both client-server connections are secure. i.e. that the value of the 'security' option (as specified in Chat Session Negotiation) has not been tampered with.

      -
      - -

      If either entity stores a (re-encrypted) transcript of an ESession for future consultation then the Perfect Forward Secrecy offered by this protocol is lost. If the negotiated value of the 'otr' Chat Session Negotiation field is 'true' the entities MUST NOT store any part of the ESession content (not even in encrypted form).

      -
      - -

      Cryptography plays only a small part in an entity's security. Even if it implements this protocol perfectly it may still be vulnerable to other attacks. For examples, an implementation might store ESession keys on swap space or save private keys to a file in cleartext! Implementors MUST take very great care when developing applications with secure technologies.

      +

      Organisations with full disclosure policies may require entities to disable encryption (see Back Doors) to enable the logging of all messages on their server. Unencrypted ESessions meet all the Security Requirements (see Cryptographic Design of Encrypted Sessions) except for Confidentiality. Unencrypted ESessions enable Alice to to confirm securely with Bob that both client-server connections are secure. i.e. that the value of the 'security' option (as specified in Chat Session Negotiation) has not been tampered with.

      -

      The authors and the XSF would like to discourage the deliberate inclusion of "back doors" in implementations of this protocol. However, we recognize that some organizations must monitor chats or record chats in decryptable form for legal compliance reasons, or may choose to monitor chats for quality assurance purposes. In these cases it is important to inform the other entity of the disclosure before starting the ESession (if only to maintain public confidence in this protocol).

      +

      The authors and the XSF would like to discourage the deliberate inclusion of "back doors" in implementations of this protocol. However, we recognize that some organizations must monitor chats or record chats in decryptable form for legal compliance reasons, or may choose to monitor chats for quality assurance purposes. In these cases it is important to inform the other entity of the (potential for) disclosure before starting the ESession (if only to maintain public confidence in this protocol).

      Both implementations MUST immediately and clearly inform their users if the negotiated value of the 'disclose' field is not 'never'.

      Before disclosing any chat, an entity SHOULD either negotiate the value of the 'disclose' field to be 'enabled' or terminate the negotiation unsuccessfully. It MUST NOT negotiate the value of the 'disclose' field to be 'disabled' unless it would be illegal for it to divulge the disclosure to the other entity.

      In any case an implementation MUST NOT negotiate the value of the 'disclose' field to be 'never' unless it implements no feature or mechanism (not even a disabled feature or mechanism) that could be used directly or indirectly to divulge to any third-party either the identites of the participants, or the keys, or the content of any ESession (or information that could be used to recover any of those items). If an implementation deliberately fails to observe this last point (or fails to correct an accidental back door) then it is not compliant with this protocol and MUST NOT either claim or imply any compliance with this protocol or any of the other protocols developed by the authors or the XSF. In this case the authors and the XSF reserve all rights regarding the names of the protocols.

      The expectation is that this legal requirement will persuade many implementors either to tell the users of their products that a back door exists, or not to implement a back door at all (if, once informed, the market demands that).

      + +

      Cryptography plays only a small part in an entity's security. Even if it implements this protocol perfectly it may still be vulnerable to other attacks. For examples, an implementation might store ESession keys on swap space or save private keys to a file in cleartext! Implementors MUST take very great care when developing applications with secure technologies.

      +

      An implementation of ESession MUST support the Diffie-Hellman Key Agreement and HMAC algorithms. Note: The parameter names mentioned below are related to secure shell; see SSH Transport Layer Encryption Modes for block cipher algorithm details; see the &ianassh; for other names.

      @@ -866,7 +728,7 @@
      • sha256 (see &nistfips180-2;)
      -

      An implementation of ESession SHOULD also support at least the following hash algorithm (sha1 and md5 are NOT RECOMMENDED):

      +

      An implementation of ESession SHOULD also support at least the following hash algorithm (sha1 and md5 are broken and therefore NOT RECOMMENDED):

      • whirlpool (see &whirlpool;)
      @@ -893,15 +755,15 @@

      Upon approval of this document, the ®ISTRAR; shall register the following namespaces:

        -
      • http://jabber.org/protocol/esession
      • -
      • http://jabber.org/protocol/esession#init
      • +
      • urn:xmpp:esession
      • +
      • urn:xmpp:esession#init
      -

      &xep0068; defines a process for standardizing the fields used within Data Forms qualified by a particular namespace. The following fields shall be registered for use in both Encrypted Sessions and Chat Session Negotiation:

      +

      &xep0068; defines a process for standardizing the fields used within Data Forms qualified by a particular namespace. The following fields shall be registered for use in both Encrypted Session Negotiation and Chat Session Negotiation:

      - http://jabber.org/protocol/esession + urn:xmpp:esession XEP-0116 ESession negotiation forms - http://jabber.org/protocol/chatneg + urn:xmpp:chatneg XEP-0155 ... ]]>
      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ]]> -
      1. Standardise on the X.509 public key and signature formats?
      2. -
      3. What challenges exist to make the OTR Gaim Plugin use this protocol natively when talking to Jabber entities? Can these be mitigated by 'non-critical' protocol changes?
      4. +
      5. What challenges exist to make the OTR Gaim Plugin use this protocol natively when talking to XMPP entities? Can these be mitigated by 'non-critical' protocol changes?
      6. Would anything in this protocol (e.g., its dependency on in-order stanza delivery) prevent an XMPP entity using it to exchange encrypted messages and presence with a user of a non-XMPP messaging system, assuming that the gateway both supports this protocol and is compatible with a purpose-built security plugin on the other user's client (e.g. a Gaim plugin connects to the gateway via a non-XMPP network)?
      7. Could use &xep0013; (FOMR) instead of AMP to prevent any offline ESessions Bob can't decrypt being delivered to him. (Each <item/> that corresponds to an ESession message would have to contain a <ESessionID/> child, to allow Bob to discover which of his stored values of y was used to encrypt the message.)