Are file hash codes really unique identifiers?
<p>It is often said in judicial opinions and legal briefs that the hash value derived from a file is like a fingerprint that uniquely corresponds to the source file. See, e.g., <a href="http://www.ca5.uscourts.gov/opinions/pub/17/17-41116-CR0.pdf" rel="nofollow noreferrer">http://www.ca5.uscourts.gov/opinions/pub/17/17-41116-CR0.pdf</a> </p>

<p>While this may be true in a practical sense, I question whether it is literally true. It is my understanding that the hash function is a many-to-one function, and therefore multiple source files could produce the same hash value. I understand that the utility of the hash function is that making a small change to a source file does not result in a small change to hash value derived from that file.</p>

<p>My understanding was confirmed by posters on the stack exchange computer science website  See, <a href="https://math.stackexchange.com/questions/2889072/can-different-source-files-produce-the-same-hash-value">https://math.stackexchange.com/questions/2889072/can-different-source-files-produce-the-same-hash-value</a></p>

<blockquote>
  <p>Are file hash codes really unique identifiers?</p>
</blockquote>

<p>Literally, no, they are not. And the reason is obvious: the <a href="https://en.wikipedia.org/wiki/Pigeonhole_principle" rel="nofollow noreferrer">pigeonhole principle</a>. However, given the current state of affairs in mathematics and computing, the chance of <em>false positives</em> is way too low to prevail in court under a standard of <em>proof beyond a reasonable doubt</em> in decisions that rely on hash values as evidence.</p>

<p>Once a person is able to present multiple different files which are associated to the same hash value, any legal precedent and jury instruction that relies on the assumption of <em>uniqueness</em> of hash values (and likewise, of digital signatures) would need to be stricken. But it is unrealistic to expect this to happen anytime soon.</p>

<p>I agree with @IñakiViggers' answer to a point. I take exception to his statement that: </p>

<blockquote>
  <p>... the chance of false positives is way too low to prevail in court under a standard of proof beyond a reasonable doubt... </p>
</blockquote>

<p>I would say instead that <em>to a degree</em> it depends upon <strong><em>which</em></strong> hash algorithm was used. For example, the MD5 algorithm has "extensive vulnerabilities", and is "only [effective] against unintentional corruption" (see Ref 1). In other words, it is not only realistic, <em>it has already happened</em> for certain algorithms. Yet these algorithms remain in wide use. Why? Because they are fit for some purposes, but not others. </p>

<p>Consequently, I would answer the OP's question this way: </p>

<blockquote>
  <p>Hash codes provide an assurance of uniqueness with a high degree of probability, but it is not an absolute guarantee. Also, the strength of this assurance hinges on two factors:  </p>
  
  <ol>
  <li>which algorithm was used to calculate the hash (digest), and  </li>
  <li>the "intent of usage"; in other words was it used with the intent of discerning accidental errors (e.g. as in the <code>git</code> protocol), or was it intended to act as a backstop against deliberate file manipulation (e.g. as in a high-value contract)  </li>
  </ol>
</blockquote>

<p>As a point of speculation only, I would hazard a guess that the reason the OP's referenced legal opinion still stands is that the absolute veracity of a hash value has not met the appropriate legal challenge. It is, after all, an opinion, and subject to change as the facts themselves do. </p>

<p>[1: ]<a href="https://en.wikipedia.org/wiki/MD5" rel="nofollow noreferrer">https://en.wikipedia.org/wiki/MD5</a></p>

internet software privacy