<div dir="ltr"><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 Sun, Oct 3, 2021 at 4:56 PM Ron Garret <<a href="mailto:ron@flownet.com">ron@flownet.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"><br>
On Oct 2, 2021, at 5:08 PM, Jon Callas <<a href="mailto:jon@callas.org" target="_blank">jon@callas.org</a>> wrote:<br>
<br>
> <br>
> <br>
>> On Sep 16, 2021, at 20:18, Sandy Harris <<a href="mailto:sandyinchina@gmail.com" target="_blank">sandyinchina@gmail.com</a>> wrote:<br>
>> <br>
>> I have a PRNG that I want to use within the Linux random(4) driver. It<br>
>> looks remarkably strong to me, but analysis from others is needed.<br>
> <br>
> A good block cipher in counter mode makes a pretty-okay PRNG. I say pretty-okay only because I would like my PRNG not to be invertible. Iterated hash functions are better.<br>
<br>
Whatever you use you want to truncate the output, otherwise you won’t get repetitions, which you actually want from a good PRNG.<br>
<br>
rg<br></blockquote><div><br></div><div><div class="gmail_default" style="font-size:small">I am currently relying on Microsoft for the Mesh RNG. They have much more time to do a good job on this than I do. </div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">But I would like to have a belt and braces approach. If I make someone else the weak point in my system, I am inviting the rubber hose squad (or worse) to attack them.</div><br></div><div><div class="gmail_default" style="font-size:small">So the approach I am thinking of is to encrypt the output of the .NET RNG with a symmetric cipher using a key derived from a 'secret' primary seed set aside for that purpose. Something like:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">kenc = KDF (primary, DateTime.Now.ToString()) </div><br></div><div><div class="gmail_default" style="font-size:small">Of course we can kibtz whether to use AES or a stream cipher or in what mode.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">ECB should be adequate but is not if you have an attacker willing to go for the really gross technique of releasing the same random string multiple times to create a side channel. </div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">AES (XOR (rng, counter), kenc) is probably sufficient.</div><br></div></div></div></div>