Search code examples
hashmd5sum

How to generate MD5 Hash value that Hashes to itself?


Is it possible to generate a text file, the content of which is the file's hash/md5 value.

How to write the program?


Solution

  • If such a file exists, it is possible to generate it by trying every possible MD5 hash and checking if its MD5 hash equals it. But since all possible MD5 hashes are a finite set, such a special MD5 value might not even exist at all.

    Note: you asked only if it's possible, not how much time it would take.