Add Proposal for Jingle Encrypted Transfers (jet)

This commit is contained in:
vanitasvitae 2017-06-15 11:44:05 +02:00
parent 5d9029cfb8
commit 5a8418a540
No known key found for this signature in database
GPG Key ID: 62BEE9264BF17311
1 changed files with 165 additions and 0 deletions

inbox/xep-jet.xml Normal file
View File

@ -0,0 +1,165 @@
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE xep SYSTEM 'xep.dtd' [
<!ENTITY % ents SYSTEM 'xep.ent'>
<?xml-stylesheet type='text/xsl' href='xep.xsl'?>
<title>Jingle Encrypted Transfers</title>
<abstract>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.</abstract>
<type>Standards Track</type>
<remark><p>First draft</p></remark>
<section1 topic='Introduction' anchor='intro'>
<p>&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.</p>
<p>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.</p>
<section1 topic='How it works' anchor='how'>
<p>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.</p>
<section2 topic='File offer'>
<p>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:</p>
<example caption='Key and IV get serialized'><![CDATA[
<p>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.</p>
<example caption="Romeo initiates an encrypted file offer"><![CDATA[
<iq from='romeo@montague.example/dr4hcr0st3lup4c'
<jingle xmlns='urn:xmpp:jingle:1'
<content creator='initiator' name='a-file-offer' senders='initiator'>
<description xmlns='urn:xmpp:jingle:apps:file-transfer:5'>
<desc>This is a test. If this were a real file...</desc>
<hash xmlns='urn:xmpp:hashes:2'
<transport xmlns='urn:xmpp:jingle:transports:s5b:1'
<candidate cid='hft54dqy'
<security xmlns='TODO' name='a-file-offer' type='urn:xmpp:omemo:0'>
<encrypted xmlns='urn:xmpp:omemo:0'>
<header sid='27183'>
<key rid='31415'>BASE64ENCODED...</key>
<key rid='12321'>BASE64ENCODED...</key>
<p>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.</p>
<p>When Juliet received the file, she uses the decrypted key and IV to decrypt the received file.</p>
<section2 topic='File Request'>
<p>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;.</p>
<example caption="Juliet initiates an encrypted file request"><![CDATA[
<iq from='juliet@capulet.example/yn0cl4bnw0yr3vym'
<jingle xmlns='urn:xmpp:jingle:1'
<content creator='initiator' name='a-file-request' senders='responder'>
<description xmlns='urn:xmpp:jingle:apps:file-transfer:5'>
<hash xmlns='urn:xmpp:hashes:2'
<transport xmlns='urn:xmpp:jingle:transports:s5b:1'
<candidate cid='ht567dq'
<security xmlns='TODO' name='a-file-request' type='urn:xmpp:openpgp:0'>
<signcrypt xmlns='urn:xmpp:openpgp:0'>
<to jid='romeo@montague.example'/>
<time stamp='2014-07-10T17:06:00+02:00'/>
<body xmlns='jabber:client'>BASE64-ENCODED-ENCRYPTED-KEY</body>
<section1 topic='Open Questions'>
<p>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:</p>
<li>What cipher is used to encrypt the file? Examples would be AES-GCM128/256...</li>
<li>Cipher agility? What format is used to serialize key and IV?</li>
<li>How exactly are interrupted transfers resumed? How (long) are keys/IVs cached?</li>
<li>Is it in the scope of this approach to hide metadata?</li>
<li>How are transferred files authenticated? (See OMEMO audit)</li>
<li>May it be desirable to split data into chunks?</li>
<li>Please add to this list :)</li>