<p dir="ltr"><br>
Den 2 jun 2015 02:21 skrev "Ray Dillinger" <<a href="mailto:bear@sonic.net">bear@sonic.net</a>>:<br>
><br>
> (warning: cipher design post)<br>
><br>
> Let's say, in theory, that I have a "perfect" diffusion mechanism<br>
> that can be defined for blocks of many different sizes. </p>
<p dir="ltr">[avalanche effect]</p>
<p dir="ltr">> But this mechanism which provides perfect diffusion, provides no<br>
> confusion whatsoever.  Like P-boxes, it is trivially reversible,<br>
> and anyone given the whole set of output bits can easily derive<br>
> all the input bits. I'll denote the reversed D-box as a "Xob-d".</p>
<p dir="ltr">Makes me think of error correction coding with overhead set to 0 (Qr codes is one example where that's an available option), using the key as the seed for the randomness commonly employed in error correction algorithms. </p>
<p dir="ltr">> Now, I believe, but could be wrong here, that if you have such a<br>
> "perfect" diffusion mechanism, you need very little confusion to<br>
> create a secure cipher.<br>
><br>
> in catenative notation, using no S-boxes whatsoever and xor as<br>
> a trivial, reversible method of combining message with key, I<br>
> can't think of a single attack that applies to this utterly<br>
> simple, fast, three-and-a-half round construction:<br>
><br>
> M > ^key | D-box | ^key | D-box | ^key | D-box | ^key = C<br>
><br>
> And the decryption is in fact the very same operation using the<br>
> reversed D-boxes:<br>
><br>
> C > ^key | Xob-d | ^key | Xob-d | ^key | Xob-d | ^key = M</p>
<p dir="ltr">[...]</p>
<p dir="ltr">> But I think this is different.  This is a construction I'm<br>
> actually confident in for mathematical reasons, and it's<br>
> fast, and it requires very little state, and it's general,<br>
> and it could be ridiculously fast (and small) in silicon,<br>
> and it's so simple that it would be easy to get right.<br>
><br>
> Am I hallucinating here?  Can anybody put this firmly in<br>
> category B, or should I start writing a paper and some code<br>
> to submit for the next design competition?  Surely this is<br>
> too simple to've not been considered and debunked by someone<br>
> smarter than me.</p>
<p dir="ltr">I'm no professional, so I might be missing something obvious to the experts, but here's a reference to what this reminds me of:</p>
<p dir="ltr">XOR-encrypt-XOR mode (XEX): <a href="http://en.wikipedia.org/wiki/Xor-encrypt-xor">http://en.wikipedia.org/wiki/Xor-encrypt-xor</a></p>
<p dir="ltr">AFAICT I believe it should be secure IF the diffusion (computationally) hides all statistical biases in the original plaintext and if the diffusion is (computationally) uncorrelated from the application of XOR before and after it, and if it is (computationally) indistinguishable from random and thus effectively unpredictable (like a strong hash).</p>
<p dir="ltr">Attacks against XOR all relies on knowing statistics about the bits of plaintext (diffusion output in this case). Repeated XOR of the same bit string of terabytes of fully random data doesn't reveal anything about what the string is because nobody knows what the original data was supposed to be.</p>
<p dir="ltr">If your diffusion effectively makes it impossible to predict if any given bit should be 1 or 0 without knowing the entire plaintext, and if known plaintext + ciphertext don't reveal the key, I don't see a flaw here (for a single block).</p>
<p dir="ltr">However, with biased diffusion outputs, you can perform an attack similar to those against RC4 and XOR blocks against each other (if in ECB mode) and try statistical attacks to uncover a possible raw diffusion output that you try to reverse.</p>
<p dir="ltr">Say the worst case is ECB mode encryption of a counter (can you think of a worse one?). You'll perform the diffusion on what's essentially a bunch of iterations of your key. All those diffusion outputs must be computationally uncorrelated and unpredictable. Even knowing it is a counter that has been encrypted, you shouldn't be able to guess the effect on the diffusion. </p>
<p dir="ltr">If the diffusion output are statistically correlated, you can extract the XOR'ed key given enough ciphertexts. The diffusion output simply needs to be computationally indistinguishable from random even against chosen plaintext attacks.</p>