in reply to Re: Alternative Perl encryption module
in thread Alternative Perl encryption module

What is wrong with 16 bytes? You could always use substr {ducks for cover}

Why duck for cover? It's exactly what he should do. Digest::SHA1 is an excellent hashing algorithm that produces a 160 bit hash. If that's "too big" (for some curious reason) then take the first 10 bytes of an SHA1 hash; you'll have an excellent hashing algorithm that produces a 80 bit hash. The only downside is that the chance of colissions is much much higher.

BTW, you may note I've changed the subject line since SHA1 is not an encryption module; and I might also add that if the author doesn't know the difference between encryption and hashing, he probably shouldn't be doing either but instead read up on cryptography.

Using crypto the right way is hard, I can highly recommend you read some of Bruce Schneier's publications, such as Security Pitfalls in Cryptography and Why Cryptography is Harder than it Looks.

  • Comment on Re: Re: Alternative Perl hashing module

Replies are listed 'Best First'.
Re: Re: Re: Alternative Perl hashing module
by Anonymous Monk on Mar 10, 2003 at 17:24 UTC
    I am the original author-the reason I am looking for a smaller hash is that I am using it in connection with compression, so the smaller the better-as is clear I know very little about encryption but for my purpose I do not need to know the background theory-I think I'll go with the idea of using the first ten bytes of the SHA1 digest-Thanks for all the suggestions!!!-Val