logoalt Hacker News

openasocket • today at 6:31 PM • 2 replies • view on HN

It’s been a while since I’ve studied crypto, but doesn’t the fact that you can do this intrinsically imply a weakness in SHA-256?


Replies

kmm • today at 8:21 PM

No, it might look like a collision or even pre-image attack, but it really isn't. It hinges on the idea of quine, a program which reproduces its own source (obviously without just reading the contents from the file it's running from). The interesting part here is that the AI (ab)used the HEIC decoder to run computations.

Just for fun, here's a Python program that prints the md5 hash of its own source code

  ~> cat md5quine.py
  from hashlib import md5; c = b'from hashlib import md5; c = %r; print(md5(c %% c).hexdigest())'; print(md5(c % c).hexdigest())
  ~> md5sum md5quine.py
  ccccf89ddfe2bbca3298fa3b908324fd  quine.py
  ~> python md5quine.py
  ccccf89ddfe2bbca3298fa3b908324fd
cowlevel • today at 7:06 PM

No, it only means you can write a quine in HEIC.