Subject: Re: RelCache (aka ELF prebinding) news
To: None <tech-userlevel@netbsd.org>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: tech-userlevel
Date: 12/02/2002 04:51:46
> At first I decided to use CRC32, but some people pointed out that
> it's too weak to be used as hash. If CRC32 was used, could you
> explain how to avoid hash collision between files? Although
> collision would very rarely occur, but people want a perfect one.
Actually, with a 32-bit hash, collisions become expected somewhere
around 64K entries - plausible for many types of system (especially
those involving a lot of developer activity, meaning running many
different executables, even though most of them only a few times).
If you're concerned about accident, why not use a 128-bit CRC? It
can't be that hard to find an appropriate polynomial of degree 128.
(No, I don't have one on tap, but I know there are books that explain
how to find one; I've seen them.)
Of course, CRCs (of any length) are worthless against malice; if you
are concerned about people deliberately provoking collisions, you will
need something stronger in that regard.
/~\ The ASCII der Mouse
\ / Ribbon Campaign
X Against HTML mouse@rodents.montreal.qc.ca
/ \ Email! 7D C8 61 52 5D E7 2D 39 4E F1 31 3E E8 B3 27 4B