Two messages, same Hash!
Discover a message that matches the hash of your input! Select MD5, SHA-1, or SHA-256, and choose between an incremental search or a Genetic Algorithm (GA) to find collisions. Real-time progress updates display below, with the top-performing results showcased at the end.
Collison Attacker Engine..
Collision Search Settings | |
---|---|
| |
Attempt | Message | Base Message | Hash | Status |
---|
About Hamming Distance in Hash Collisions
Curious about how we measure how "close" two hashes are? Meet the Hamming Distance—a key tool in our collision attacker! It counts the number of bit positions where two hashes differ, helping us gauge their similarity. The fewer the differences, the closer we are to a collision. Let’s break it down:
How it works:
- We take two hexadecimal hash strings (like those from MD5, SHA-1, or SHA-256).
- Each hex character (e.g., a
or f
) represents 4 bits of the hash.
- We compare each pair of characters by converting them to numbers, using a bitwise XOR to find differing bits, and counting those differences.
- The total count is the Hamming Distance, which feeds into our similarity percentage (100% means a perfect match!).
Example Calculation - 1:
Let’s compare two MD5 hashes: a1b2c3d4e5f6a7b8
and a1b2c3d4e5f6a7b9
. They differ only in the last character (b8
vs. b9
). Here’s the step-by-step:
- Focus on b8
vs. b9
:
- b8
= hex b*16 + 8
= 184 (binary: 10111000
).
- b9
= hex b*16 + 9
= 185 (binary: 10111001
).
- XOR: 184 ^ 185 = 1
(binary: 00000001
).
- Count 1s: The binary 00000001
has 1 bit set, so 1 bit differs.
- Other characters are identical, so the total Hamming Distance = 1.
- For MD5 (128 bits), similarity = 100 - (1 / 128) * 100 = 100 - 0.78125 = 99.21875
, or 99.2%.
Example Calculation - 2:
Let’s compare two partial MD5 hashes: d1c2c3d4f4f6b8a
(15 characters) and a1b2c3d4e5f6a7b9
(first 15 characters: a1b2c3d4e5f6a7b
). Here’s the step-by-step:
- Compare each character pair:
- Pos 1: d
(13 = 1101
) vs. a
(10 = 1010
) → XOR: 13 ^ 10 = 7
(0111
) → 3 bits differ.
- Pos 2: 1
(1 = 0001
) vs. 1
(1 = 0001
) → XOR: 1 ^ 1 = 0
(0000
) → 0 bits differ.
- Pos 3: c
(12 = 1100
) vs. b
(11 = 1011
) → XOR: 12 ^ 11 = 7
(0111
) → 3 bits differ.
- Pos 4: 2
(2 = 0010
) vs. 2
(2 = 0010
) → XOR: 2 ^ 2 = 0
(0000
) → 0 bits differ.
- Pos 5: c
(12 = 1100
) vs. c
(12 = 1100
) → XOR: 12 ^ 12 = 0
(0000
) → 0 bits differ.
- Pos 6: 3
(3 = 0011
) vs. 3
(3 = 0011
) → XOR: 3 ^ 3 = 0
(0000
) → 0 bits differ.
- Pos 7: d
(13 = 1101
) vs. d
(13 = 1101
) → XOR: 13 ^ 13 = 0
(0000
) → 0 bits differ.
- Pos 8: 4
(4 = 0100
) vs. 4
(4 = 0100
) → XOR: 4 ^ 4 = 0
(0000
) → 0 bits differ.
- Pos 9: f
(15 = 1111
) vs. e
(14 = 1110
) → XOR: 15 ^ 14 = 1
(0001
) → 1 bit differs.
- Pos 10: 4
(4 = 0100
) vs. 5
(5 = 0101
) → XOR: 4 ^ 5 = 1
(0001
) → 1 bit differs.
- Pos 11: f
(15 = 1111
) vs. f
(15 = 1111
) → XOR: 15 ^ 15 = 0
(0000
) → 0 bits differ.
- Pos 12: 6
(6 = 0110
) vs. 6
(6 = 0110
) → XOR: 6 ^ 6 = 0
(0000
) → 0 bits differ.
- Pos 13: b
(11 = 1011
) vs. a
(10 = 1010
) → XOR: 11 ^ 10 = 1
(0001
) → 1 bit differs.
- Pos 14: 8
(8 = 1000
) vs. 7
(7 = 0111
) → XOR: 8 ^ 7 = 15
(1111
) → 4 bits differ.
- Pos 15: a
(10 = 1010
) vs. b
(11 = 1011
) → XOR: 10 ^ 11 = 1
(0001
) → 1 bit differs.
- Total Hamming Distance: 3 + 0 + 3 + 0 + 0 + 0 + 0 + 0 + 1 + 1 + 0 + 0 + 1 + 4 + 1 = 14
bits.
- For a 15-character (60-bit) partial MD5 hash, similarity = 100 - (14 / 60) * 100 = 100 - 23.3333 = 76.6667
, or 76.7%.
- Note: For a full MD5 (128 bits), we’d need the remaining characters, but this shows the process for the given portion.
This distance guides our search: a lower number means we’re closer to a collision! Huge thanks to Grok for helping craft this explanation for the Deep Inside workshop series.
Acknowledgments
Special thanks to Grok, for its invaluable assistance in creating this collision attack topic for Deep Inside workshop series.