7
A co-worker made a System in Java that encounters collisions in a series of MD5 hash passwords. But he did not stop to analyze the results, he made only a statement that they exist. Only that I would like to prove this, someone happens to know the existence of two different passwords that could have the same MD5 hash?
The Wikipedia talks more about collisions and vulnerabilities.
To clarify the problem, something that seems simple to understand, but that seems not to have been very clear, what I want is the two distinct values that caused the same hash MD5, example, typing in the Workbench:
set @valor1 := 'senha_distinta1????';
set @valor2 := 'senha_distinta2????';
SELECT MD5(@valor1) AS hashA, MD5(@valor2) AS hashB;
where: Hasha = hashB
Obs: I tried to put the following input values to test the suggested examples and both returned at different hash values:
set @a:= "d131dd02c5e6eec4693d9a0698aff95c 2fcab58712467eab4004583eb8fb7f89
55ad340609f4b30283e488832571415a 085125e8f7cdc99fd91dbdf280373c5b
d8823e3156348f5bae6dacd436c919c6 dd53e2b487da03fd02396306d248cda0
e99f33420f577ee8ce54b67080a80d1e c69821bcb6a8839396f9652b6ff72a70";
set @b:= "d131dd02c5e6eec4693d9a0698aff95c 2fcab50712467eab4004583eb8fb7f89
55ad340609f4b30283e4888325f1415a 085125e8f7cdc99fd91dbd7280373c5b
d8823e3156348f5bae6dacd436c919c6 dd53e23487da03fd02396306d248cda0
e99f33420f577ee8ce54b67080280d1e c69821bcb6a8839396f965ab6ff72a70";
set @a:=Replace(@a," ","");
set @a:=Replace(@a,"
","");
set @b:=Replace(@b,"
","");
set @b:=Replace(@b," ","");
SELECT MD5(@a) as hashA, MD5(@b) as hashB, @a as valorA, @b as valorB;
Possible duplicate of How the MD5 hash algorithm works?
– Pedro Sanção
@Sanction, you are roundly wrong, the question is not a duplicate and also does not answer my question, it just informs the functioning of the algorithm, what I need is real examples that there are collisions. So far I’ve only seen claims about it, but nothing is conclusive.
– Ivan Ferrer
Look I think the question does not answer this directly, but states and provide the links on the subject, it is not really a duplicate, but I tell you one thing, the sha1 that also presented the same problem later, now being recommended the sha-2, that "maybe" She may have the same problem, but I don’t know how often. I voted because I left it open because although the other question is practically the same as your answer there speaks little about the security problem. Let’s see what the others think.
– Guilherme Nascimento
Actually after reading some links I noticed that the issue of passwords and files with md5 may vary, taking into account this your question is quite different really from the other. It should be kept open anyway, I just think the title was not good (but it is my opinion). If no one responds later I try to formulate a response. See you later.
– Guilherme Nascimento
Why did the salt ?
– Edilson
@Edilson O salt exists to avoid Rainbow Tables (break multiple passwords for the "price" of one), has nothing to do with collisions.
– mgibsonbr
@mgibsonbr, really, when quoting salt I have become oblivious to conversation, when the problem at stake is another.
– Edilson
I don’t understand why I was denied, but okay. I believe that this is a way for people to show that they could not understand the question, therefore negative. It’s normal not to understand something you don’t know.
– Ivan Ferrer
The answer to the question is simple. YES. Mathematically it is proven that qq hash has collisions. Now having passwords with the same output hash is very difficult. More common than a long bit string generates a collision for a short string.
– Marcos Regis
in your example using Workbench, try to make an UNHEX of your hexdecimal string:
SELECT MD5(UNHEX(@a)) as hashA, MD5(UNHEX(@b)) as hashB, UNHEX(@a) as valorA, UNHEX(@b) as valorB;
– Tobias Mesquita
@Tobymosque That! That’s what I was trying to explain to AP but I wasn’t able to make myself understand (by the way, I updated my answer, I hope this point is a little more clear).
– mgibsonbr
It worked @Tobymosque, I believe your answer cleared my question, thank you. I would put that as a response.
– Ivan Ferrer
My comment is not an answer, I just pointed out that your code adapted from the example given by @mgibsonbr was not working as expected. In my view the answer of Gibson is complete and I do not need to add anything the same.
– Tobias Mesquita