coolaj86/mediabox — Issue #1: Hash Security / Collisions?
Author: coolaj86
Created: 2012-01-14 21:15:03+00:00
State: open

Obviously, MD5 is a bad choice as the probability of a random "birthday" collision is significant around [820 billion documents](http://en.wikipedia.org/wiki/Birthday_attack#The_mathematics).

That's within the realm of what MediaBox could one day see (150 documents per person on the planet is not very much).

sha1 on ARM: is about as fast as md5, which can be done in less time than it takes to read the file from disk.

sha224 and 256 are the same speed, but significantly slower

cat:

real 1m34.530s
user 0m0.250s
sys 0m18.352s

md5sum:
2302ebde81b341ba5d4a0ffda02c185a /mnt/wd-500gb/iTunes/iTunes Media/Movies/Inception/Inception.m4v

real 1m35.062s
user 0m34.188s
sys 0m13.172s

sha1sum:
317fea80a371658e3d962d678fca07f26220d522 /mnt/wd-500gb/iTunes/iTunes Media/Movies/Inception/Inception.m4v

real 1m39.069s
user 1m2.766s
sys 0m15.570s

sha224sum:
e0f4f66c6778e7473e9f6a4904c57e51f6ed732e0faa2d09573690a7 /mnt/wd-500gb/iTunes/iTunes Media/Movies/Inception/Inception.m4v

real 2m25.517s
user 1m49.242s
sys 0m15.547s

sha256sum:
16b7cf808591356f838943bd47e6584e9a79433c8d2f04df153d9d54f2b7afe1 /mnt/wd-500gb/iTunes/iTunes Media/Movies/Inception/Inception.m4v

real 2m25.111s
user 1m49.703s
sys 0m15.000s