1 Mar 2006 17:29
Re: [librsync-users] MD4 second-preimage attack
Donovan Baarda <abo <at> minkirri.apana.org.au>
2006-03-01 16:29:57 GMT
2006-03-01 16:29:57 GMT
On Tue, 2006-02-21 at 14:58 -0800, rsync2eran <at> tromer.org wrote: > Hi, > > A year ago we discussed the strength of the MD4 hash used by rsync and > librsync, and one of the points mentioned was that only collision > attacks are known on MD4. Well, a recent paper by Wang et al [1] shows a > several second preimage attacks. First, there's an algorithm which, > given a random message and its MD4 hash, finds another message having > the same hash with probability 2^-56. Second, if the attacker can also > alter the original message (and thus its hash) slightly, he can find a > second message having the same hash with just 2^27 MD4 invocations. For the record, here it is in the SF mailarchive. http://sourceforge.net/mailarchive/forum.php?forum_id=29760&max_rows=25&style=flat&viewmonth=200404&viewday=5 If I understand correctly, provided we add random seeds for blocksums, these weaknesses would only make attack case 4) easier. > Doubtless, even stronger attacks will soon be found. > > MD4 (with known seed) is thus completely broken, making rsync batch mode > and librsync unsafe to use in malicious environments. Please do consider > phasing out MD4. Remember we only use a small part of the md4sum for the "strong blocksum", and hence are already using less than the full md4sum. We don't really need that many bits of hash for the blocksum. The important thing for the blocksum is speed. I think md4 + random seed is pretty much the best "useful hash bits per second" for blocksums. We can adjust(Continue reading)
OpenSSL's implementation of SHA-1 is as fast as its implementation of
MD4, and both are much faster than librsync's built-in MD4. For MD4, an
efficient second-preimage attack is known, whereas for SHA1, even a
collision has not been demonstrated yet (the best attack presently known
takes ~2^63 work). Is this sufficient evidence?
> In any case, the first thing that will be tackled is changing to use the
> libmd/openssl API for hashes, which will make switching what hash we
> want to use painless... a configure option?
Makes sense, and while at it, please consider setting the default block
hash to SHA-1.
RSS Feed