Subject: [xmpp] message size

From: Peter Saint-Andre <[email-masked]>
Date: Thu, 06 Mar 2014 14:19:33 +0000

In the SAAG session just now, Daniel Kahn Gillmor just brought up an 
interesting issue about end-to-end message encryption in XMPP, and Matt 
Miller had an interesting reply. If we wanted to randomly change around 
the size of XMPP messages pre-encryption, we could easily add an XMPP 
extension to the payload and make the XML character data whatever size 
we please.

Peter

---

From: Dave Cridland <[email-masked]>
Date: Thu, 6 Mar 2014 14:28:26 +0000

You're saying to include, pre-encrypt, something like <spacer:junk
xmlns:spacer='urn:...'>123465</spacer> in the plaintext order to defeat
message size analysis of the ciphertext?

---

From: Ashley Ward <[email-masked]>
Date: Thu, 6 Mar 2014 14:35:31 +0000

On 6 Mar 2014, at 14:28, Dave Cridland <[email-masked]> wrote:

> You're saying to include, pre-encrypt, something like <spacer:junk xmlns:spacer='urn:...'>123465</spacer> in the plaintext order to defeat message size analysis of the ciphertext?

It’s XML - you could always just use <!— —> comments or whitespace.

—

Ash

---

From: Kevin Smith <[email-masked]>
Date: Thu, 6 Mar 2014 14:40:57 +0000

On Thu, Mar 6, 2014 at 2:35 PM, Ashley Ward <[email-masked]> wrote:
> It's XML - you could always just use <!-- --> comments or whitespace.

Comments are slightly problematic, on account of being illegal.

/K

---

From: Dave Cridland <[email-masked]>
Date: Thu, 6 Mar 2014 14:41:52 +0000

> Comments are slightly problematic, on account of being illegal.

Only on the wire, where they'd not appear in the plaintext.

---

From: Ashley Ward <[email-masked]>
Date: Thu, 6 Mar 2014 14:44:33 +0000

> Comments are slightly problematic, on account of being illegal.

True - I often forget that XMPP isn’t entirely XML compliant!

—
Ash

---

From: Kevin Smith <[email-masked]>
Date: Thu, 6 Mar 2014 14:46:33 +0000

> Only on the wire, where they'd not appear in the plaintext.

Presumably if we're encrypting stanza contents, we'd like the stanza
contents to still be legal stanza contents once decrypted.

I don't see a reason to start fiddling around with the rules so we
could shove comments in here and only here. The
shove-stuff-in-a-junk-namespace seems easier and less contentious.

/K

---

From: Kevin Smith <[email-masked]>
Date: Thu, 6 Mar 2014 14:49:22 +0000

On Thu, Mar 6, 2014 at 2:44 PM, Ashley Ward <[email-masked]> wrote:
> True - I often forget that XMPP isn't entirely XML compliant!

The stream isn't a real XML document (stream restarts break this) but
not allowing comments doesn't stop it being XML, just a subset.

/K

---

From: Peter Saint-Andre <[email-masked]>
Date: Thu, 06 Mar 2014 16:41:41 +0000

> message size analysis of the ciphertext?

Yes, that's what I'm saying.

Peter

---

From: Alexander Holler <[email-masked]>
Date: Sat, 08 Mar 2014 11:46:00 +0100

> not allowing comments doesn't stop it being XML, just a subset.

And just using whitespace is the most elegant solution. No necessary
changes and no obvious problems. So instead of

<message>foobar</message>

using

<message >foobar</message>

or e.g.

<message    >foobar</message      >

or something similiar is imho the most preferable way to add unused
plaintext.

Regards,

Alexander Holler