Re: [zooko@zooko.com: [Revctrl] colliding md5 hashes of human-meaningful documents]
- From
- Morten Welinder <mwelinder@gmail.com>
- Date
- Jun 12, 2005, 13:14 UTC
- Message-ID
- <118833cc050612061452f0eb3e@mail.gmail.com>
- In-Reply-To
- <20050612082555.GB6620@pasky.ji.cz>
I looked at this.
If you can find just *one* colliding pair that does not contain a few select bytes like 0x22 (quote), 0x5c (backslash) and perhaps 0x0a then it is trivial to make a colliding pair of C programs.
Call the initial pair (A,B) and make the programs
/* Common prefix that happens to have integer block size
ending just before the A below. */
const char junk[] = "AB";
/* "AA" in program 1, "AB" in program 2. */
...
int
main ()
{
int hsize = sizeof (junk) / 2;
if (memcmp (junk, junk + hsize, hsize))
return do_program_2 ();
else
return do_program_1 ();
}