The probability of a hash collision between n files if there are N possible hashes, assuming that each hash is equally likely, is roughly 1-e^(-n^2/(2N))[1]. Let's suppose that there are roughly a trillion, that is, 2^20, files; this is way more than the actual number of files, by the way. And let's suppose that we have a 256-bit hash such that every 256-bit string is equally likely(a reasonable assumption as long as the hash hasn't been defeated)--the number of possible hashes is 2^256. So the chance of a collision is roughly 1-e^(-2^80/(2^257)); since the number inside the exponential is so small, we can approximate it as 2^-177, or less than 10^-53. That number is so small that it's more likely your office will get hit by multiple independent meteors.
Again all of this assumes unifrom distribution. The files used in dropbox are not guaranteed to be random or uniformly distributed. As I already said in my initial comment, various different files types have internal structures which may (again if you are unlucky) result in multiple different files of those types tending to have similar hashes.
One of the goals of a good hash is a uniform distribution. The source files don't have to be random at all. I wouldn't put any money on the odds of by accident hitting a systematic flaw that security researchers haven't yet found in analyzing the hash.
That said, I think it will be possible to deliberately create a collision in SHA256 at some point in the future.
Comments
How did you do that math? To get a hash collision you only need two files and some bad luck.
The probability of a hash collision between n files if there are N possible hashes, assuming that each hash is equally likely, is roughly 1-e^(-n^2/(2N))[1]. Let's suppose that there are roughly a trillion, that is, 2^20, files; this is way more than the actual number of files, by the way. And let's suppose that we have a 256-bit hash such that every 256-bit string is equally likely(a reasonable assumption as long as the hash hasn't been defeated)--the number of possible hashes is 2^256. So the chance of a collision is roughly 1-e^(-2^80/(2^257)); since the number inside the exponential is so small, we can approximate it as 2^-177, or less than 10^-53. That number is so small that it's more likely your office will get hit by multiple independent meteors.
[1]This formula is taken from http://en.wikipedia.org/wiki/Birthday_paradox
Again all of this assumes unifrom distribution. The files used in dropbox are not guaranteed to be random or uniformly distributed. As I already said in my initial comment, various different files types have internal structures which may (again if you are unlucky) result in multiple different files of those types tending to have similar hashes.
One of the goals of a good hash is a uniform distribution. The source files don't have to be random at all. I wouldn't put any money on the odds of by accident hitting a systematic flaw that security researchers haven't yet found in analyzing the hash.
That said, I think it will be possible to deliberately create a collision in SHA256 at some point in the future.
That's true, but what sort of level of "luck" are we talking about?
Flipping a coin "head or tails" odds?
Buying a winning lottery ticket odds?
Or winning the lottery without buying a ticket and having the atoms forming the winning ticket spontaneously appear in your pocket odds?
Yeah it's _possible_, but 1:2^256 odds are not really something you need to worry about...