git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Hash collision count

From
ISImre Simon <imres.g@gmail.com>
Date
Apr 24, 2005, 21:24 UTC
Message-ID
<68ff9fa6050424142416fbadcd@mail.gmail.com>
In-Reply-To
<426AEBAE.1060402@pobox.com>
On 4/23/05, Jeff Garzik <jgarzik@pobox.com> wrote:
Show 10 quoted lines
> Petr Baudis wrote:
> > -DCOLLISION_CHECK
> 
> Cool.  I am happy, then :)
> 
> Make sure that's enabled by default...
> 
> Thanks,
> 
>         Jeff
I would like to second the suggestion that this should be enabled by default.

First, I do think it is highly unlikely that a collision will ever be found. Actually because of this if one is found it would be an important byproduct of git and it would probably influence future system designs. Hence, I believe that it is worth loosing some efficiency in order to illuminate better this question of the collision.

I would like to add a reciepe by which one would surely produce a collision with two files of the same length and quite similar to each other. I believe that there is a popular belief that this is pretty much impossible. Of course, we do not have time to execute this algorithm, but I believe that it convinces everyone that similar files *do* exist (actually in abundance) with the same hash.

1. Take your favorite text file, at least 160 characters long. 
2. Choose 160 positions in this file.
3. For each position choose your favorite mispelling of that character.
4. Produce all 2^160 text files, all of the same length, choosing for
each position either the original or the alternate character
5. Add an arbitrary file of the same length, different from the above

Two of these files have the same sha1 hash. Or, for that matter, for any 160 bit hash the same is true.

Cheers, Imre Simon
Previous: Jeff GarzikNext: Jon Seymour
Message 9 of 14 in “Hash collision count”
  1. Jeff GarzikApr 23, 2005
  2. Jeff GarzikApr 23, 2005
  3. Ray HeasmanApr 23, 2005
  4. Jeff GarzikApr 23, 2005
  5. Petr BaudisApr 23, 2005
  6. Jeff GarzikApr 24, 2005
  7. Petr BaudisApr 24, 2005
  8. Jeff GarzikApr 24, 2005
  9. Imre SimonApr 24, 2005
  10. Whales falling on houses - was: Hash collision countJon Seymour, Apr 24, 2005
  11. Tom LordApr 25, 2005
  12. Petr BaudisApr 26, 2005
  13. Ray HeasmanApr 24, 2005
  14. David LangApr 24, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.