๊ณ ์ •๋œ ๊ธ€
muddle ๐Ÿฅฃ@muddle@infosec.exchange

Wikipedia links:

* en.wikipedia.org/wiki/Online_c
* en.wikipedia.org/wiki/Chaffing

If you understand the two wiki pages above (although do read the two main papers linked from the articles as well for deeper insights), it should be fairly obvious about how to combine the two sets of ideas. Below is a very simple sketch of how the sender side could work:

* use All-or-Nothing Transform (AONT) on input file
* produce Online Code (OC) check blocks from AONT-encoded file
* add authentication (eg, HMAC-based) signature to produced check blocks
* send signed blocks with format:
** OC seed
** OC payload
** MAC (message authentication code)

There is no encryption involved at this point. Any receiver (including an eavesdropper) can recover the file by reversing the above steps.

By adding "chaff" packets confidentiality is accidentally achieved. Chaff can include:

* random data inserted by "Carol"
* bugs in the sender code
* sending two or more encoded streams with differing MACs on the same channel

๊ณ ์ •๋œ ๊ธ€
muddle ๐Ÿฅฃ@muddle@infosec.exchange

Basic Cryptanalysis 1

Ideally, the security of this scheme would rest solely on the difficulty of breaking the Message Authentication Code. However, the basic encoder that I outlined in the initial post suffer from two serious weaknesses that can be used to separate "wheat" from "chaff" by means of analysing the seed and payload parts of the packets.

Firstly, since all the parameters relating to the online code operation are assumed to be public, Eve can recover the composition of each check block and use the inherent redundancy of the data to identify potential chaff packets by recognising where conflicting data points are. Depending on how much chaff is used, this could lead to a much smaller space search.

A related problem with standard OC seeds is that it gives an attacker the ability to determine the overall ordering of blocks. This negates much of the security of the AONT.

A solution to both OC seed problems would be to transform the seed value as stored in the packet using the same MAC operation (with one or more rounds) before passing it to the PRNG. This means that the attacker should be unable to determine the composition of the payload based solely on the seed, and, more importantly, it reveals no information about the **ordering** of the blocks. As the number of blocks increases, the number of arrangements is combinatorial, and the search space can quickly become greater than that of the MAC search space.

๊ณ ์ •๋œ ๊ธ€
muddle ๐Ÿฅฃ@muddle@infosec.exchange

Basic Cryptanalysis 2

Another attack on the scheme involves examining the payload part of the packet.

The first observation is that while the entire packet seems to be full of random data, analysis can determine that the online code algorithm is being used since it will be possible to determine that the payload parts are in fact the xor sum of one or more fixed blocks (the so-called message/auxiliary blocks covering the AONT-encoded file). This seems to be unavoidable and weakens the deniability aspect.

The more serious failing, however, is that such traffic analysis can weaken the confidentiality aspect. A complete analysis of this is outside of the scope of this short post, but suffice to say that it depends on two main factors:

* whether the message is effectively transmitted only once (with a small extra percentage of packets to provide enough redundancy to guarantee delivery), several times (akin to running the fountain for a finite time) or infinite times (constantly running fountain)
* the chaffing strategy

Broadly speaking, the longer the fountain runs (and this can be counted as a single-source transmitter or a multi-source one), the more data a listener can collect. Using that, it can be possible to, e.g., disentangle two muddled streams. Thus, for example, if the chaffing strategy is based on muddling two or more streams together, then being able to distinguish one of them reduces the security of the rest of them.

This also brings up another problem in a multi-sender system which is that given enough traffic an eavesdropper may not gain enough data to be able to breach the confidentiality of message streams, but they may be able to determine that two senders are sending the same stream, which could potentially allow mapping of a network of senders.

Getting back to the algorithm itself, though, the more pressing problem is whether randomly generated payload data is sufficient to maintain security. Based on the possibility of traffic analysis, I would have to say, in general, no. However one chaff generation method that should work as a mitigation would be to generate a small set of basic random chaff payloads and to create chaff packets that have randomised seed and mac fields, but whose payloads can be:

* a single random chaff packet
* the corruption of a previously seen wheat packet produced by xoring the original payload with one or more randomised chaff packets
* corruption introduced by xoring some previously seen chaff packet payloads

While this is a little bit more work than using completely random chaff packets, the only knowledge it requires of the original sender's packet stream is just the packet format, ie, how to identify the payload part of it. With this mitigation, it's possible to get a pretty good increase in security for minimal extra effort.