Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to generate MD5 Hash value that Hashes to itself?

Tags:

hash

md5sum

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

How to write the program?

like image 333
Steven You Avatar asked Oct 27 '25 19:10

Steven You


2 Answers

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.

like image 89
sashoalm Avatar answered Oct 30 '25 17:10

sashoalm


I was interested too, so i wrote following pascal program:

program hash;

uses md5;

var a, b: string;

begin

b:='d41d8cd98f00b204e9800998ecf8427e'; //md5sum of /dev/null

repeat

a:=md5Print(md5String(b));
b:=md5Print(md5String(a));

until a=b;

writeln(a);
writeln(b);

end.

It running for about five days already, but still no result yet)))

like image 32
trimethoxy Avatar answered Oct 30 '25 17:10

trimethoxy



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!