in reply to Re^6: 64-bit digest algorithms
in thread 64-bit digest algorithms

If I understand your intent correctly you have some message text that you wish to hash to 64 bits. The funnelling weakness is a potential issue for the hash algorithm, but is not a concern for the one off (per message) mixing of, say, a 128 bit MD5 digest down to 64 bits. By using an xor mix of the two 64 bit fields you are retaining the entropy and distribution characteristics present in the individual fields so long as there isn't a problem with coupling between bits (and for MD5 that seems unlikely).

The sort of code I had in mind would be something like:

use strict; use warnings; use Digest::MD5; my $msg = 'The quick brown fox jumps over the lazy dog.'; my $digest = Digest::MD5::md5_hex ($msg); $digest = substr ($digest, 0, 8) ^ substr ($digest, 8, 8); print unpack ('H16', $digest), "\n";

Perl reduces RSI - it saves typing

Replies are listed 'Best First'.
Re^8: 64-bit digest algorithms
by BrowserUk (Patriarch) on Nov 15, 2008 at 06:53 UTC