Mhash:

Mhash is a free (under GNU Lesser GPL) library which provides a uniform interface to a large number of hash algorithms. These algorithms can be used to compute checksums, message digests, and other signatures.

The HMAC support implements the basics for message authentication, following RFC 2104. In the later versions some key generation algorithms, which use hash algorithms, have been added. The manpage for mhash is mhash.3.html.

At the time of writing this, the library supports the algorithms:

SHA1, SHA160, SHA192, SHA224, SHA384, SHA512, HAVAL128, HAVAL160, HAVAL192, HAVAL224, HAVAL256, RIPEMD128, RIPEMD256, RIPEMD320, MD4, MD5, TIGER, TIGER128, TIGER160, ALDER32, CRC32, CRC32b, WHIRLPOOL, GOST, SNEFRU128, SNEFRU256

Mapping these to bitlengths, we can see:

AlgorithmOutput Bitlength
Name3232b128160192224256320384512
SHA1YYYYY
HAVALYYYYY
RIPEMDYYY
MD2, 4, 5
TIGERYYONL
ALDERY
CRCYY
WHIRLPOOLONL
GOSTONL
SNEFRUYY

Key:

Y : The name is suffixed by the bit-length
Number : The name is suffixed by this number
ONL : There is no suffix
I : The hash is not secure at this length
X : The hash has been padded and is not as strong as the bit-length suggests

Here you can download mhash source code

Note: Win32 DLLs have been removed. Use cygwin to compile.



Development:

If you like libmhash and you'd like to contribute to the development process, you should subscribe to the mhash mailing list. To subscribe, follow the instructions at: http://lists.sourceforge.net/mailman/listinfo/mhash-dev. Patches, bugfixes, suggestions, should be addressed to this list. Announcements of new versions and description of changes will be posted there.

Access to the mhash CVS repository is available through anonymous cvs:
To access it enter the following commands:

$ cvs -d:pserver:anonymous@cvs.mhash.sourceforge.net:/cvsroot/mhash login Password: (just hit RETURN) $ cvs -d:pserver:anonymous@cvs.mhash.sourceforge.net:/cvsroot/mhash co mhash To update your checkout, change into the mhash directory and execute: $ cvs update -dP

To compile from cvs, first run the buildconf script. It needs these programs: autoconf, automake and libtool. All these programs can be found at the nearest GNU mirror.

Interfaces:

Gustavo Niemeyer has developed a comprehensive Python interface to mhash. You may find it at http://labix.org/python-mhash.

Links:

nettle: A low level crypto library
The sourceforge mhash project page

Projects that use mhash:

shash: A program that uses libmhash to produce secure message digests
gtk-splitter: A utility which splits files.

Additional information on hashing can be found at the Hashing Function Lounge, including a summary of what algorithms have known security flaws.

About the authors:

The authors of libmhash are Nikos Mavroyanopoulos and Sascha Schumann. Please don't contact the authors directly for questions about libmhash, use the developers mailing list instead.

SourceForge Logo