Hot answers tagged 2nd-preimage-resistance
4
You are not asking for a collision but for a preimage.
Collision attack: the attacker computes two messages m and m', distinct from each other, such that m and m' hash to the same value.
Preimage: the attacker is given a goal (a hash value h) and finds a message m which hashes to h.
MD5 is weak for collisions, but not for preimages: no attack method is ...
3
We know no practically feasible way to do what you ask for, except if the hash X=acf3602b5eb9a2db3e365d3043682faf or the content of the file wczasp.rb was prepared specially to make that possible.
Assuming that the content of file wczasp.rb is arbitrary, what is asked would be a preimage attack. This is further sub-classified as first preimage if only the ...
3
Actually, to the best of our knowledge, it's computationally infeasible.
By the terminology what we use when we discuss cryptographical hash functions, you're not asking for a hash collision (which is "find two different messages that hash to the same value"), but instead you're asking for a hash preimage (which is "for this hash value, find a message that ...
3
Consider the function $H$ transforming a message $m$ to the SHA-512 hash of the first 1024 bits of $m$ (right-padded with $1024-n$ zero bits if the bit length $n$ of $m$ is less than 1024).
$H$ is first-preimage resistant, but not second-preimage resistant: once you have a first preimage $m_1$, it is trivial to get another $m_2$ with the same hash (e.g. ...
2
As far as I am aware, there are no practical known second pre-image attacks on MD5, under the conditions you listed.
However: if the attacker can control any part of the original, I would worry about using MD5 in this setting. Its security in this setting may be fragile and there may well be cleverer attacks than anything currently in the literature. I ...
2
I have ask as part of my answer, "What problem are you trying to solve?"
Do you want a secure unkeyed hash function? If you do, then there are plenty of them around. Even some of the ones that are broken for some uses might be okay for yours (SHA-1 springs to mind -- note the discussion above on HMAC and how broken a hash function has to be). But really, ...
Only top voted, non community-wiki answers of a minimum length are eligible