Take the 2-minute tour ×
Information Security Stack Exchange is a question and answer site for Information security professionals. It's 100% free, no registration required.

I mean "normal" collisions not based on any attack.

How do i calculate it?

share|improve this question
    
Can you be a little more specific? –  Rell3oT May 6 '13 at 0:57
    
Let say a = md5(sha256(someval)) b = md5(sha256(otherval)) What are the chances that a == b? why? –  kR105 May 6 '13 at 2:09

1 Answer 1

up vote 4 down vote accepted

The relevant principle here is the birthday attack. It roughly states that for a 2n algorithm, your probably of a random collision is between any two items is 50% once you generate 2(n/2) outputs.

When looking at a hashing algorithm, the naive consideration of the algorithm is that the odds are bassed only on the last iteration. In this way, a 128 bit algorithm doesn't care if you feed it 1 bit or a million bits: your odds of collision should be the same for a given number of unique inputs (as you can obviously only input 2 different one-bit values).

Thus, the answer for a 128 bit algorithm is that it has a 50% chance of a collision occurring between any two values after 264 outputs have been created.

share|improve this answer
    
This is what i was looking for, thank you! –  kR105 May 6 '13 at 2:16
    
It is also worth noting that 2^64 is a teeny tiny fraction of the 2^128 hash space. –  lynks May 6 '13 at 7:48

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.