<div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-size:small"><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Aug 12, 2022 at 3:37 AM Natanael <<a href="mailto:natanael.l@gmail.com">natanael.l@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Den fre 12 aug. 2022 02:43Phillip Hallam-Baker <<a href="mailto:hallam@gmail.com" target="_blank">hallam@gmail.com</a>> skrev:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">



<div>
<div dir="ltr">
<div></div>
<div>
<div dir="ltr"></div>
<h2 style="margin:16px 0px 4px;font-family:"Sofia Pro",Arial,Helvetica,sans-serif;font-weight:700;line-height:27px;text-align:center">
</h2>
<div dir="ltr">
<p style="margin:0px;font-size:25.8px;line-height:normal">
<span style="font-family:UICTFontTextStyleEmphasizedBody;font-size:17pt">Was at Jasper Van Woudenberg’s BlackHat talk on side channels. Had some thunks.</span></p>
<p style="margin:0px;font-size:25.8px;line-height:normal">
<span style="font-family:UICTFontTextStyleEmphasizedBody;font-size:17pt"><br>
</span></p>
</div>
<div dir="ltr"><br>
</div>
<div>According to the traditional threat model, the IV used to initialize a block cipher mode is not sensitive and is passed in clear text.</div>
<div dir="ltr"><br>
</div>
<div dir="ltr">I don’t do this in the Mesh, I generate the IV and the Key from a KDF using different tags. This was not done for a security reason, it just avoided an additional set of data. The reason for doing this was to prevent reuse of the IV. Every data
 sequence that is encrypted is encrypted using parameters derived from the primary key by means of a unique salt.</div>
<div dir="ltr"><br>
</div>
<div dir="ltr"><br>
</div>
<div dir="ltr">But now consider the effect of using KDF generation of the IV and OCB mode so that the plaintext data being encrypted is tweaked before going into the block cipher. This has the effect of masking the plaintext before it is input to the block,
 provided that the IV is secret.</div>
<div dir="ltr"><br>
</div>
<div dir="ltr">This would limit the scope for side channel exploits but not eliminate them. An attacker could still work on the key derivation schedule, but that is kinda hard because it is a one-off. Another possibility would be to work back from the output.</div>
<div dir="ltr"><br>
</div>
<div dir="ltr">Perhaps if we designed a mode with integrated masking???</div></div></div></div></blockquote></div></div><div dir="auto"><br></div><div dir="auto">Encryption modes hiding the nonce has already been proposed. </div><div dir="auto"><br></div><div dir="auto"><a href="https://dl.acm.org/doi/abs/10.1007/978-3-030-26948-7_9" target="_blank">https://dl.acm.org/doi/abs/10.1007/978-3-030-26948-7_9</a></div></div></blockquote><div><br></div><div class="gmail_default" style="font-size:small">I published specifications with running code using the construction hiding the nonce before that. I am pretty sure I raised the KDF construct here before I used it. I usually do. It certainly seems to me that the construction is better. The paper looks at the question in a bit more detail.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">But that is not the part of the problem that was interesting me. The bit that I think we should take a look at is whether the OCB tweakage on the input does make side channel cryptanalysis harder and if so whether we should develop a version using it on the output as well.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">One way to do that today would be to double encrypt in OCB mode under separate keys and IVs.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">I don't think this is going to be a sufficient concern for many applications but it certainly will be for some.</div></div></div>