NAME

digest::md5 - Computes a MD5 message digest.
digest::sha1 - Computes a SHA1 message digest.

SYNOPSIS

digest::md5 ?mode? args...
digest::sha1 ?mode? args...

DESCRIPTION

Those commands provide a pure Tcl solution for computing a MD5 or SHA1 message digest. From now, command refers to either digest::md5 or digest::sha1. Valid options are:

command encode string

convert the MD5 digest string from a binary string into an ASCII string of hexadecimal digits.

command decode string

convert the digest string from a ASCII string of hexadecimal digits into a binary string.

command create
command append md5ctx string
command close md5ctx

create, append and close a new incremental context.

command digest string ...

Takes one of more arguments, and returns the message digest for the concaenation of all its arguments. Arguments are not actually concatenated in memory.

command hmac key string

Returns the hmac of string under the choosen key as a hexadecimal string.

BENCHMARKS

Those benchmarcks might help you decide whereas this pure Tcl implementation is fast enough, or if the C implementation better suits your needs.

Tcl Version Digest C.P.U. O.S. kbytes per second
8.4 MD5 Intel PIII-766Mhz Linux 2.4.19 315
8.4 SHA1 Intel PIII-766Mhz Linux 2.4.19 110

CREDITS

The MD5 encryption is based on the definition of MD5 in RFC 1321 (April 1992) .

The SHA1 encryption is based on the definition of SHA1 in FIPS-180-1 (April 1995) .


© 1999-2002 Evolane - all rights reserved.

© 2001-2002 Evolane - tous droits réservés. Pour toute remarque, envoyez un courrier électronique à webmaster@evolane.com