From f022f190049a3f260acc79cdc69a382a5927a698 Mon Sep 17 00:00:00 2001 From: vanitasvitae Date: Tue, 12 Sep 2017 14:16:01 +0200 Subject: [PATCH] Update JET --- inbox/jet.xml | 114 ++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 87 insertions(+), 27 deletions(-) diff --git a/inbox/jet.xml b/inbox/jet.xml index 3e1e0642..ebcf9e11 100644 --- a/inbox/jet.xml +++ b/inbox/jet.xml @@ -8,7 +8,7 @@
Jingle Encrypted Transports - This specification defines a method that allows to use established encryption schemes like OpenPGP or OMEMO for end-to-end encryption of Jingle transports. + This specification defines a method that allows to use established encryption schemes for end-to-end encryption of Jingle transports. &LEGALNOTICE; XXXX ProtoXEP @@ -73,23 +73,23 @@ Envelope Element EE - Output of an established end-to-end encryption methods when encrypting TS. Examples for such methods could be &xep0384; or &xep0374;. + Output element of an established end-to-end encryption method when encrypting TS. -

Lets assume Romeo wants to initiate an encrypted Jingle session with Juliet. Prior to the Jingle session initiation, an already existing, established and (ideally) authenticated end-to-end encryption session between Romeo and Juliet MUST exist. Examples for suitable encryption sessions are &xep0384; and &xep0374;. This session is needed to transfer the Transport Secret from Romeo to Juliet.

+

Lets assume Romeo wants to initiate an encrypted Jingle session with Juliet. Prior to the Jingle session initiation, an already existing, established and (ideally) authenticated end-to-end encryption session between Romeo and Juliet MUST exist. This session is needed to transfer the Transport Secret from Romeo to Juliet.

When this precondition is met, Romeo initially generates a transport key (TK) and associated initialization vector (IV). These will later be used by the sender to encrypt, and respectively by the recipient to decrypt data that is exchanged. This protocol defines a set of usable ciphers from which Romeo might choose. TK and IV are serialized to create the transport secret (TS).

Next Romeo uses her established encryption session with Juliet to encrypt TS. The resulting envelope element (EE) will be part of the Jingle session initiation as child of the JET &secret; element.

-

When Juliet receives Romeos session request, she decrypts EE to retrieve TS, from which she can deserialize TK and IV. Now she and Romeo can go on with the session negotiation. Once the session is established, data can be encrypted and exchanged.

+

When Juliet receives Romeos session request, she decrypts EE to retrieve TS, from which she can deserialize TK and IV. Now she and Romeo can go on with the session negotiation. Once the session is established, data can be encrypted and exchanged. Both parties MUST keep a copy of TS in cache until the Jingle session is ended.

&xep0234; has the disadvantage, that transmitted files are not encrypted (aside from regular TLS transport encryption), which means that intermediate nodes like XMPP/proxy server(s) have access to the transferred data. Considering that end-to-end encryption becomes more and more important to protect free speech and personal expression, this is a major flaw that needs to be addressed.

In order to initiate an encrypted file transfer, the initiator includes a JET &secret; in the Jingle file transfer request.

- -

In this scenario Romeo wants to send an encrypted text file over to Juliet. He chooses to use their existing &xep0384; session to do so. First, he generates a fresh AES-256 transport key and IV. TK and IV are serialized into TS which is then encrypted using Romeos OMEMO session with Juliet.

-

The resulting OMEMO element (EE) is sent as part of the security element along with the rest of the jingle stanza over to Juliet.

+ +

In this scenario Romeo wants to send an encrypted text file over to Juliet. First, he generates a fresh AES-256 transport key and IV. TK and IV are serialized into TS which is then encrypted using Romeos end-to-end-encryption session with Juliet.

+

The resulting envelope element (EE) is sent as part of the security element along with the rest of the jingle stanza over to Juliet.

- -
- BASE64ENCODED... - BASE64ENCODED... - BASE64ENCODED... -
+ type='urn:xmpp:encryption:stub:0'> + BASE64-ENCODED-ENCRYPTED-SECRET @@ -139,12 +134,12 @@ ]]>
-

Juliet decrypts the OMEMO element (EE) using her session with Romeo to retrieve TS from which she deserializes TK and IV. Both Juliet and Romeo then carry on with the session negotiation as described in &xep0234;. Before Romeo starts transmitting the file, he encrypts it using TK and IV. He then transmitts the encrypted file over to Juliet.

+

Juliet decrypts the envelope element (EE) using her session with Romeo to retrieve TS from which she deserializes TK and IV. Both Juliet and Romeo then carry on with the session negotiation as described in &xep0234;. Before Romeo starts transmitting the file, he encrypts it using TK and IV. He then transmitts the encrypted file over to Juliet.

When Juliet received the file, she uses the TK and IV to decrypt the received file.

-

Juliet might want to request a file transfer from Romeo. This can be the case, when Romeo hosts the file. In order to do so, she sends generates TK and IV, creates TS from those and encrypts TS with an encryption method of her choice to get EE. TK and IV will be used by Romeo to encrypt the requested file before sending it to Juliet. In this example we assume, that Romeo and Juliet secured their communications using &xep0374;.

+

Juliet might want to request a file transfer from Romeo. This can be the case, when Romeo hosts the file. In order to do so, she sends generates TK and IV, creates TS from those and encrypts TS with an encryption method of her choice to get EE. TK and IV will be used by Romeo to encrypt the requested file before sending it to Juliet.

- - - + type='urn:xmpp:encryption:stub:0'> + + BASE64-ENCODED-ENCRYPTED-SECRET + ]]>
+ + +

&xep0234; defines a way for parties to request ranged transfers. This can be used to resume interrupted transfers etc. In case of an interrupted transfer, the receiving party might be able to decrypt parts of the received file. When requesting a resumption of the transfer, the recipient therefore can use the index of the last successfully decrypted byte of the file as offset in the ranged transfer. Since a resumed transfer takes place in a new session, the old transport secret might no longer be available to either party. For that reason the receiver creates a new TS for the session-initiation. The sending party then encrypts and sends only the requested parts of the file.

+ + + + + + + w0mcJylzCn+AfvuGdqkty2+KP48= + + + + + + + + + BASE64-ENCODED-ENCRYPTED-SECRET + + + + +]]> +
+
@@ -218,11 +257,32 @@

The column 'serialization' describes, how the key and iv are serialized. "::" means plain concatenation of byte arrays.

+ +

To advertise its support for the Jingle Encrypted Transports, when replying to service discovery information ("disco#info") requests an entity MUST return URNs for any version, or extension of this protocol that the entity supports -- e.g., "urn:xmpp:jingle:jet:0" for this version, or "urn:xmpp:jingle:jet-stub:0" for a stub encryption method &VNOTE;.

+ + +]]> + + + + + +]]> +

In order for an application to determine whether an entity supports this protocol, where possible it SHOULD use the dynamic, presence-based profile of service discovery defined in &xep0115;. However, if an application has not received entity capabilities information from an entity, it SHOULD use explicit service discovery instead.

+
+

The initiator SHOULD NOT use the generated key TK as IV, but instead generate a seperate random IV.

Instead of falling back to unencrypted transfer in case something goes wrong, implementations MUST instead abort the Jingle session, informing the user.

IMPORTANT: This approach does not deal with metadata. In case of &xep0234;, an attacker with access to the sent stanzas can for example still see the name of the file and other information included in the <file/> element.

-

When using OX as encryption method, clients might want to protect against replay attacks

The responder MUST check, whether the envelope element belongs to the initiator to prevent MitM attacks

@@ -236,7 +296,7 @@
    -
  • Service discovery
  • +
  • Split up the protocol into encryption method specific sub protocols (jet-omemo, jet-ox...)