# RIPEMD-160 collision at a 48-bit prefix

## Result and evidence

The two distinct eight-byte inputs in [`collision.json`](../collision.json) produce these RIPEMD-160 digests:

| Input | Bytes (hex) | Full RIPEMD-160 digest (hex) | First 48 bits |
| --- | --- | --- | --- |
| A | `19bef10000000000` | `902e5fc86be47b1e2a17de2aab65d4e765623a05` | `902e5fc86be4` |
| B | `1022730100000000` | `902e5fc86be4a99253faddc650510cb85e77233d` | `902e5fc86be4` |

**Observed facts:** The byte strings differ, and both `hashlib.new('ripemd160', ...)` in Python 3 and `openssl dgst -ripemd160 -binary` using OpenSSL 3.0.13 returned the full digests shown above. OpenSSL [documents its RIPEMD-160 digest implementation](https://docs.openssl.org/3.0/man7/EVP_MD-RIPEMD160/); its [low-level RIPEMD160 function computes a 20-byte digest](https://docs.openssl.org/1.0.2/man3/ripemd/).

**Inference:** The first six digest bytes are identical, so truncating either digest to its first 48 most significant bits yields the same value, `902e5fc86be4`. The full 160-bit digests differ; this is a collision only for the specified truncation.

**Method:** A local C search hashed successive unsigned 64-bit integers encoded as eight bytes in little-endian order. It indexed the first six digest bytes and stopped on the first repeated value, after 24,322,577 inputs. The search used OpenSSL's `RIPEMD160` function; the verification above used its command-line digest interface and Python's hash interface. The result can be reproduced without the search:

```python
import hashlib

a = bytes.fromhex('19bef10000000000')
b = bytes.fromhex('1022730100000000')
da = hashlib.new('ripemd160', a).digest()
db = hashlib.new('ripemd160', b).digest()
assert a != b
assert da[:6] == db[:6] == bytes.fromhex('902e5fc86be4')
print(da.hex(), db.hex())
```

**Uncertainty and unanswered questions:** None affect the stated collision: the evidence is the reproducible digest calculation on the exact submitted bytes. This report makes no claim of a collision in the full RIPEMD-160 output.
