The fact that any document can contain its own MD5 hash embedded in there should be hugely concerning enough.
The hash also happens to start with 5EAF00D.
The fact that any document can contain its own MD5 hash embedded in there should be hugely concerning enough.
The hash also happens to start with 5EAF00D.
And a PNG version too: https://news.ycombinator.com/item?id=32956964
But no one has made an exclusively plaintext (ASCII) MD5-quine yet, and I suspect doing so may be impossible given the characteristics of collision blocks.
1. a document containing "1", whose hash begins with "1"
2. a document containing "12", whose hash begins with "12"
3. a document containing "123", whose hash begins with "123"
#1 is certain to exist. #2 exists, but would take 16x as long to brute force. #3 would take 16x longer again. If this pattern doesn't continue until 2^128, where would it stop, and why?
All hashes can be brute forced this way, even secure ones SHA-2. Its security relies on the fact that the earth doesn't contain enough computing power to execute a brute force attack within the universe's lifetime.
Therein lies the problem.
Also the fact that it would need to be constrained to 7-bit ASCII only, and on top of that be "valid" in its natural language. It's a neat trick to make two documents look completely different with the same hash, but looking at the techniques which are required, they all rely on a binary file format and copious amounts of data which are effectively "hidden" --- all of which do not apply to a text file.
The problem is that we currently don't know how find it more efficiently than with exhaustive search, AFAIK.
Edit: previously on HN: https://news.ycombinator.com/item?id=614079
By that logic, SHA 256 is also broken:
$ cat >sha256.py
from hashlib import sha256
s = 'from hashlib import sha256\ns = %r\nprint sha256(s%%s).hexdigest()\n'
print sha256(s%s).hexdigest()
$ sha256sum sha256.py
14cc85c420ced317fdb73e9403ac3f6e1d96d19c70ae0dce8da9b8d96fa0b4d3 sha256.py
$ python sha256.py
14cc85c420ced317fdb73e9403ac3f6e1d96d19c70ae0dce8da9b8d96fa0b4d3
(Yes, PDF is turing complete. Yes, that's terrible. No, it doesn't have anything to do with hash function deficiencies; it's turing complete on (malicious) purpose, just like webpages with javascript.)Alright, I'll bite: at what byte offset in the binary file contents does a trivial encoding[0] of the MD5 hash occur?
> the NES ROM is only the first 40k of the file. It is not able to scan itself and print out a hash that way.
It is possible to encode the effects of multiple blocks of arbitrary[1] data on a hash function internal state (independently of what state you start in) in much less space than that data actually takes up, although I'll grant that actually doing so is somewhat impressive in it's own right, so I don't have a trivial translation to SHA 256 immediately ready to post.
Edit: tracked down my saved version:
$ md5sum pocorgtfo14.pdf
5eaf00d25c14232555a51a50b126746c pocorgtfo14.pdf
$ grep -aoi 5eaf00d pocorgtfo14.pdf || echo not found
not found
$ # using ...b126746c because 5eaf00... has a nul
$ grep -aoF $(printf '\xb1\x26\x74\x6c') pocorgtfo14.pdf || echo not found
not found
The MD5 is definitely not clearly in the plaintext here, though it could be only mildly unclear.0: Eg, I'd accept 31 34 63 63 38 35 63 34 ... as an encoding of 14cc85c4... from above.
1: Including random/incompressible data.
NES ROM still doesn't have any access to the rest of the file though.
(I've never tried to built one of these, so I could be just totally wrong here).
I think that's pretty amazing, to be honest.