开发者

Is it possible to create a file with a given size and MD5 hash?

Of course I know is possible to create a file with a certain size and how to do it. But is it possible to create a file with a certain size and also a certain MD5 fingerpri开发者_如何学JAVAnt?


Not being able to find a file with a certain hash is one of the defining properties of a cryptographic hash function such as md5.

While md5 has been broken, those breaks only allow you to create two different files (images) with the same hash, but not with a predetermined hash.

What you want is called a pre-image attack, and since md5 is still unbroken concerning that attack, you need to bruteforce.

This requires 264 (2128/2) hashing operations on average, which is far beyond anything we can get with current computers.

Wikipedia has an article on pre-image attacks too:
http://en.wikipedia.org/wiki/Preimage_attack


Just creating a file with a given MD5 hash is difficult enough without adding the size requirement.

You could try a rainbow table, but that requires a long time to create and a huge amount of memory to store.


Theoretically, yes. Practically, it will most likely require computation of all permutations of all n bytes in a file -- baiscally, brute-forcing. Which means, this is hardly doable in any reasonable timeframe.


MD5 is a cryptographic hash algorithm. Its sole point of being is that it is not easy to make a file with a specific hash.

Having said that, researchers have recently found flaws in the algorithm. There is some info on the Wikipedia page.


The MD5 algorithm is not reversible (generally speaking) so the answer is no. Unless of course you know the MD5 hash of some string and you put that string in the file. But I guess that would not make a lot of sense.


Every file you create will have a certain size and a certain MD5 hash.

If you want a predetermined size and MD5 hash, this is not practically possible (you would have to calculate all hashes to all possible inputs).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜