From 5a8418a5400806fcd513b962372c0b8db9bde21a Mon Sep 17 00:00:00 2001 From: vanitasvitae Date: Thu, 15 Jun 2017 11:44:05 +0200 Subject: [PATCH 1/2] Add Proposal for Jingle Encrypted Transfers (jet) --- inbox/xep-jet.xml | 165 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 165 insertions(+) create mode 100644 inbox/xep-jet.xml diff --git a/inbox/xep-jet.xml b/inbox/xep-jet.xml new file mode 100644 index 00000000..2640381e --- /dev/null +++ b/inbox/xep-jet.xml @@ -0,0 +1,165 @@ + + +%ents; +]> + + +
+ Jingle Encrypted Transfers + This specification defines a method that allows file transfers via Jingle File Transfer to be end-to-end encrypted using established encryption schemes like OpenPGP or OMEMO. + &LEGALNOTICE; + XXXX + ProtoXEP + Standards Track + Standards + Council + + XEP-0234 + + + + jet + + jingle + http://xmpp.org/schemas/jingle.xsd + + + jingle:errors + http://xmpp.org/schemas/jingle-errors.xsd + + + jingle + + Paul + Schaub + vanitasvitae@riseup.net + vanitasvitae@jabberhead.tk + + + 0.0.1 + 2017-06-12 + vv +

First draft

+
+
+ +

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

+

This document defines a method to enable two communication partners to utilize an already established secure channel (eg. an OMEMO session) to exchange an encryption key which can then be used to encrypt/decrypt the offered/requested file.

+
+ +

In order to initiate an encrypted file transfer, the initiator includes a key-element in the jingle-request. This key-element contains an encryption key which is used to encrypt/decryt the transferred key. In both file offers and file requests, it is the initiator, which dictates this key. The key is encrypted using the encryption method of the initiators choice. The initiator and responder must establish a session beforehand.

+ + +

In this scenario Romeo wants to send an encrypted text file over to Juliet. He chooses to use their existing OMEMO session to do so. First, he generates a fresh TODO-AES key and IV. This will later be used to encrypt and decrypt the file. In order to be transmitted, key and IV have to be serialized. Key and IV are both Base64 encoded and appended in the following form:

+ +

This text is encrypted using the established secure encryption method. The resulting OMEMO element is sent as part of the security element along with the rest of the jingle stanza over to Juliet.

+ + + + + + 1969-07-21T02:56:15Z + This is a test. If this were a real file... + text/plain + test.txt + + 6144 + w0mcJylzCn+AfvuGdqkty2+KP48= + + + + + + + +
+ BASE64ENCODED... + BASE64ENCODED... + BASE64ENCODED... +
+ BASE64-ENCODED-ENCRYPTED-KEY +
+
+
+
+]]>
+ +

Juliet decrypts the OMEMO element using her session with Romeo to retrieve the key 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 the key and IV. He then transmitts the encrypted file over to Juliet.

+

When Juliet received the file, she uses the decrypted key 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 him a key and IV which Romeo will use to encrypt the file before sending it to Juliet. In this example we assume, that Romeo and Juliet secured their communications using &xep0374;.

+ + + + + + w0mcJylzCn+AfvuGdqkty2+KP48= + + + + + + + + + + + + +]]> +
+
+ + +

This is only a rough draft and there is still a ton of questions left to be answered. Here is a small non-exhaustive list of things I can think of:

+
    +
  • What cipher is used to encrypt the file? Examples would be AES-GCM128/256...
  • +
  • Cipher agility? What format is used to serialize key and IV?
  • +
  • How exactly are interrupted transfers resumed? How (long) are keys/IVs cached?
  • +
  • Is it in the scope of this approach to hide metadata?
  • +
  • How are transferred files authenticated? (See OMEMO audit)
  • +
  • May it be desirable to split data into chunks?
  • +
  • Please add to this list :)
  • +
+
+
From 8996b3cf964b26c1296f9fe76a92bf8c93da8c3b Mon Sep 17 00:00:00 2001 From: vanitasvitae Date: Thu, 24 Aug 2017 09:06:35 +0200 Subject: [PATCH 2/2] Update JET --- inbox/jet.xml | 242 ++++++++++++++++++++++++++++++++++++++++++++++ inbox/xep-jet.xml | 165 ------------------------------- 2 files changed, 242 insertions(+), 165 deletions(-) create mode 100644 inbox/jet.xml delete mode 100644 inbox/xep-jet.xml diff --git a/inbox/jet.xml b/inbox/jet.xml new file mode 100644 index 00000000..3e1e0642 --- /dev/null +++ b/inbox/jet.xml @@ -0,0 +1,242 @@ + + + +%ents; +]> + + +
+ 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. + &LEGALNOTICE; + XXXX + ProtoXEP + Standards Track + Standards + Council + + XEP-0234 + + + + jet + + jingle + http://xmpp.org/schemas/jingle.xsd + + + jingle:errors + http://xmpp.org/schemas/jingle-errors.xsd + + + jingle + + Paul + Schaub + vanitasvitae@riseup.net + vanitasvitae@jabberhead.tk + + + 0.0.1 + 2017-06-12 + vv +

First draft

+
+
+ +

Jingle Encrypted Transports (JET) strives to provide a modular and easily extensible way to wrap Jingle Transports in an additional end-to-end encryption layer. The focus of this specification lays on being modular. It should be possible to extend existing Jingle use scenarios with end-to-end encryption by simply adding a JET element to the negotiation.

+
+ +

JET uses multiple encryption layers, so it is necessary to declare a distinct denomination for the different keys involved.

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
DesignationAbbrevationUsage
Transport KeyTK(Symmetric) key that is used to encrypt/decrypt the bytestreams sent/received through Jingle transports. This key encrypts the data two entities want to exchange. Examples for TK can be found under "Ciphers".
Initialization VectorIVInitialization vector that is used together with TK.
Transport SecretTSSerialization of TK and TI.
Envelope ElementEEOutput of an established end-to-end encryption methods when encrypting TS. Examples for such methods could be &xep0384; or &xep0374;.
+
+ +

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.

+

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.

+
+ +

&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.

+ + + + + + 1969-07-21T02:56:15Z + This is a test. If this were a real file... + text/plain + test.txt + + 6144 + w0mcJylzCn+AfvuGdqkty2+KP48= + + + + + + + +
+ BASE64ENCODED... + BASE64ENCODED... + BASE64ENCODED... +
+ BASE64-ENCODED-ENCRYPTED-SECRET +
+
+
+
+]]>
+ +

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.

+

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;.

+ + + + + + w0mcJylzCn+AfvuGdqkty2+KP48= + + + + + + + + + + + + +]]> +
+
+ + +

In order to encrypt the transported bytestream, the initiator must transmit a cipher key to the responder. There are multiple options available:

+ + + + + + + + + + + + + + + + + + + + + + +
NamespaceTypeLength (bits)ParametersSerialization
urn:xmpp:ciphers:aes-128-gcm-nopadding:0AES128GCM/NoPadding128BitKey::96BitIV
urn:xmpp:ciphers:aes-256-gcm-nopadding:0AES256GCM/NoPadding256BitKey::96BitIV
+

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

+
+ + +

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

+
+ + +

This is only a rough draft and there is still a ton of questions left to be answered. Here is a small non-exhaustive list of things I can think of:

+
    +
  • How exactly are interrupted transfers resumed? How (long) are keys/IVs cached?
  • +
  • May it be desirable to split data into chunks?
  • +
  • Please add to this list :)
  • +
+
+ +
    +
  • Service discovery
  • +
+
+
diff --git a/inbox/xep-jet.xml b/inbox/xep-jet.xml deleted file mode 100644 index 2640381e..00000000 --- a/inbox/xep-jet.xml +++ /dev/null @@ -1,165 +0,0 @@ - - -%ents; -]> - - -
- Jingle Encrypted Transfers - This specification defines a method that allows file transfers via Jingle File Transfer to be end-to-end encrypted using established encryption schemes like OpenPGP or OMEMO. - &LEGALNOTICE; - XXXX - ProtoXEP - Standards Track - Standards - Council - - XEP-0234 - - - - jet - - jingle - http://xmpp.org/schemas/jingle.xsd - - - jingle:errors - http://xmpp.org/schemas/jingle-errors.xsd - - - jingle - - Paul - Schaub - vanitasvitae@riseup.net - vanitasvitae@jabberhead.tk - - - 0.0.1 - 2017-06-12 - vv -

First draft

-
-
- -

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

-

This document defines a method to enable two communication partners to utilize an already established secure channel (eg. an OMEMO session) to exchange an encryption key which can then be used to encrypt/decrypt the offered/requested file.

-
- -

In order to initiate an encrypted file transfer, the initiator includes a key-element in the jingle-request. This key-element contains an encryption key which is used to encrypt/decryt the transferred key. In both file offers and file requests, it is the initiator, which dictates this key. The key is encrypted using the encryption method of the initiators choice. The initiator and responder must establish a session beforehand.

- - -

In this scenario Romeo wants to send an encrypted text file over to Juliet. He chooses to use their existing OMEMO session to do so. First, he generates a fresh TODO-AES key and IV. This will later be used to encrypt and decrypt the file. In order to be transmitted, key and IV have to be serialized. Key and IV are both Base64 encoded and appended in the following form:

- -

This text is encrypted using the established secure encryption method. The resulting OMEMO element is sent as part of the security element along with the rest of the jingle stanza over to Juliet.

- - - - - - 1969-07-21T02:56:15Z - This is a test. If this were a real file... - text/plain - test.txt - - 6144 - w0mcJylzCn+AfvuGdqkty2+KP48= - - - - - - - -
- BASE64ENCODED... - BASE64ENCODED... - BASE64ENCODED... -
- BASE64-ENCODED-ENCRYPTED-KEY -
-
-
-
-]]>
- -

Juliet decrypts the OMEMO element using her session with Romeo to retrieve the key 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 the key and IV. He then transmitts the encrypted file over to Juliet.

-

When Juliet received the file, she uses the decrypted key 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 him a key and IV which Romeo will use to encrypt the file before sending it to Juliet. In this example we assume, that Romeo and Juliet secured their communications using &xep0374;.

- - - - - - w0mcJylzCn+AfvuGdqkty2+KP48= - - - - - - - - - - - - -]]> -
-
- - -

This is only a rough draft and there is still a ton of questions left to be answered. Here is a small non-exhaustive list of things I can think of:

-
    -
  • What cipher is used to encrypt the file? Examples would be AES-GCM128/256...
  • -
  • Cipher agility? What format is used to serialize key and IV?
  • -
  • How exactly are interrupted transfers resumed? How (long) are keys/IVs cached?
  • -
  • Is it in the scope of this approach to hide metadata?
  • -
  • How are transferred files authenticated? (See OMEMO audit)
  • -
  • May it be desirable to split data into chunks?
  • -
  • Please add to this list :)
  • -
-
-