<div dir="ltr"><div class="gmail_default" style="font-size:small">I was just looking through some articles on cryptographic digests setting out the criteria for acceptance and it occurs to me that as specified they are necessary but not sufficient.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><i style="font-family:sans-serif;font-size:14px">Pre-image resistance</i><span style="font-family:sans-serif;font-size:14px"></span><dl style="margin-top:0.2em;margin-bottom:0.5em;font-family:sans-serif;font-size:14px"><dd style="margin-left:1.6em;margin-bottom:0.1em;margin-right:0px">Given a hash value <i>h</i> it should be difficult to find any message <i>m</i> such that <i>h</i> = hash(<i>m</i>).</dd></dl></div><div class="gmail_default" style="font-size:small">That is necessary but I would want h to effectively disclose no useful information whatsoever about m. Not the number of bits, not the parity, nothing.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">So I have been designing deranged hash functions that have the correct work factor but are wrong, wrongety wrong.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">So SHA2-Yuk is defined as </div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">H(x) = (SHA2(x OR 1) OR 1) XOR (x AND 1)</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Where the boolean operators only act on the last bit in the input.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">The intent here is to ensure that the hash values of adjacent inputs are paired such that H(x) XOR H(x XOR 1) = 1.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">This would obviously be a highly undesirable property in a digest but it is not excluded by our traditional definition of second preimage resistance.</div><div class="gmail_default" style="font-size:small"><br></div></div>