cr-marcstevens / hashclash

Project HashClash - MD5 & SHA-1 cryptanalysis
Other
742 stars 87 forks source link

Detectcoll doesn't provide message differential for textcoll. #38

Closed angea closed 3 months ago

angea commented 3 months ago

I ran a freshly compiled Detectcoll on one of your Textcoll samples:

00000000: 5445 5854 434f 4c4c 4259 6647 694a 5545  TEXTCOLLBYfGiJUE
00000010: 5448 5134 6841 634b 534d 6435 7a59 7067  THQ4hAcKSMd5zYpg
00000020: 7166 3159 5244 686b 6d78 486b 6850 5770  qf1YRDhkmxHkhPWp
00000030: 7472 6b6f 797a 3238 776e 4939 5630 6148  trkoyz28wnI9V0aH
00000040: 6541 7561 4b6e 616b                      eAuaKnak

I get no dm output, and an unexpected collision detected on block 8 (!).

Found collision in block 8:
   dm: 
   ihv1=e22ebfe49e2ac02a9b6b3769cd599281
   ihv2=622ebfe41e2ac02a1b6b37694d599281
*coll* 2542aa6a2a4979848a15cab9b51ce25d original1-1.txt
819293a9def038dedb582f465c1026a33cc8a9e9 original1-1.txt
angea commented 3 months ago

It works now !

It now returns:

Found collision in block 8:
   dm: 
   ihv1=e22ebfe49e2ac02a9b6b3769cd599281
   ihv2=622ebfe41e2ac02a1b6b37694d599281
Found collision in block 7:
   dm: dm5=00000400 
   ihv1=67452301efcdab8998badcfe10325476
   ihv2=67452301efcdab8998badcfe10325476
*coll* 2542aa6a2a4979848a15cab9b51ce25d original1-1.txt
819293a9def038dedb582f465c1026a33cc8a9e9 original1-1.txt

What about that weird block counting (8,7...) ?

cr-marcstevens commented 3 months ago

Also fixed. Was due to internal counter being multiplied by 8 for the Merkle-Damgard strengthening in the MD5 message block padding.

cr-marcstevens commented 3 months ago

Closing as fixed.

angea commented 3 months ago

Thanks!

FTR It now returns:

Found collision in block 0:
   dm: 
   ihv1=e22ebfe49e2ac02a9b6b3769cd599281
   ihv2=622ebfe41e2ac02a1b6b37694d599281
Found collision in block -1:
   dm: dm5=00000400 
   ihv1=67452301efcdab8998badcfe10325476
   ihv2=67452301efcdab8998badcfe10325476
*coll* 2542aa6a2a4979848a15cab9b51ce25d original1-1.txt
819293a9def038dedb582f465c1026a33cc8a9e9 original1-1.txt
angea commented 3 months ago

The block index is fixed now, thanks!

Found collision in block 1:
   dm: 
   ihv1=e22ebfe49e2ac02a9b6b3769cd599281
   ihv2=622ebfe41e2ac02a1b6b37694d599281
Found collision in block 0:
   dm: dm5=00000400 
   ihv1=67452301efcdab8998badcfe10325476
   ihv2=67452301efcdab8998badcfe10325476
*coll* 2542aa6a2a4979848a15cab9b51ce25d original1-1.txt
819293a9def038dedb582f465c1026a33cc8a9e9 original1-1.txt