<div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Den sön 18 juli 2021 01:18Ray Dillinger <<a href="mailto:bear@sonic.net">bear@sonic.net</a>> skrev:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<br>
     Counter mode, classically, is P XOR E(Ctr) = C.  Using the same set<br>
of operations the same number of times each you can implement a clearly<br>
superior counter mode E(P XOR Ctr) = C.  This second mode suffers none<br>
of the above indignities and makes no sacrifice in efficiency.  It<br>
dominates the original XOR counter mode in security vs. efficiency,<br>
requiring no new operations.  Therefore there is no excuse for using the<br>
original XOR counter mode ever again.<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">XOR is not a good combiner here for a plain counter, P XOR Ctr exposes if the plaintext iterates (or rather decreases) by the same value as the counter in between blocks. If P goes down by one and Ctr up by one, C is identical for the for the two blocks. </div><div dir="auto"><br></div><div dir="auto">Either the counter must be pseudorandom or you must use a different combiner like a keyed permutation (double block cipher invocation per message block). </div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
</blockquote></div></div></div>