Re: Looking for a fast implementation of a hash algorithim
- From: Robert Wessel <robertwessel2@xxxxxxxxx>
- Date: Thu, 29 Sep 2011 05:38:09 -0500
On Thu, 29 Sep 2011 17:56:25 +0800, Jonathan Wilson
<jfwfreo@xxxxxxxxxxx> wrote:
I am in need of a fast C/C++ implementation of a hash algorithim.
I have no idea which algorithim I should choose (MD5, SHA, others)
The biggest risk we have is a chosen-plaintext attack (i.e. where someone
could come up with specifically chosen data and then modify it to still be
valid to the code that parses it but also match the hash)
Previously we used an implementation of CRC32 because we were more
concerned about corrupted data than malicious attacks but we now have found
that malicious attacks are a concern so we need something a bit stronger.
I need something that is licensed with a permissive license (BSD, public
domain etc)
Can anyone suggest which algorithim I should be using here and where to get
a fast implementation under a nice license?
Try one of the SHA-2 variants. SHA-256 should do just fine. While
there are (at least theoretical) weaknesses in SHA-1, no solid ones
have surfaced yet for SHA-2 (although there are some concerns, they're
not likely to result in anything practical for quite some time, if
ever).
SHA-2 is widely studied, used in a huge number of applications, is
fairly fast, and is not under any sort of license. There are many
implementations out there, many of those free or open source. Rolling
your own is not hard either, although I'd recommend one of the many
good quality free implementations.
And it's certainly easy enough to try - if there are performance
issues, try something more complex then. FWIW, on modern CPUs,
reasonable implementations of SHA-256 are around a couple of dozen
clocks cycles per input byte for moderate sized inputs (say a couple
of hundred bytes), with shorter messages doing worse
.
- References:
- Looking for a fast implementation of a hash algorithim
- From: Jonathan Wilson
- Looking for a fast implementation of a hash algorithim
- Prev by Date: Looking for a fast implementation of a hash algorithim
- Next by Date: Re: The Most Profound Distillation of the Feedack from Modern Cyptography.
- Previous by thread: Looking for a fast implementation of a hash algorithim
- Next by thread: Re: Looking for a fast implementation of a hash algorithim
- Index(es):
Relevant Pages
|