Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

im::md5(3pm) [debian man page]

IM::MD5(3pm)						   Internet Message Perl modules					      IM::MD5(3pm)

NAME
IM::MD5 - MD5 message-digesting SYNOPSIS
use IM::MD5; $digest = &md5_str($text); DESCRIPTION
The IM::MD5 module handles MD5 message-digest algorithm. This modules is provided by IM (Internet Message). EXAMPLES
&md5_str("") returns d41d8cd98f00b204e9800998ecf8427e. &md5_str("a") returns 0cc175b9c0f1b6a831c399e269772661. &md5_str("abc") returns 900150983cd24fb0d6963f7d28e17f72. &md5_str("message digest") returns f96b697d7cb7938d525a2f31aaf161d0. &md5_str("abcdefghijklmnopqrstuvwxyz") returns c3fcd3d76192e4007dfb496cca67e13b. &md5_str("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789") returns d174ab98d277d9f5a5611c2c9f419d9f. &md5_str("12345678901234567890123456789012345678901234567890123456789012345678901234567890") returns 57edf4a22be3c955ac49da2e2107b67a. % perl -MIM::MD5 -e 'IM::MD5::MD5_TEST()' COPYRIGHT
This modules is derived from md5.pl copyrighted by NAKAMURA, Motonori <motonori@econ.kyoto-u.ac.jp>. It is converted to Perl4 from C version derived from the RSA Data Security, Inc. MD5 Message-Digest Algorithm. IM (Internet Message) is copyrighted by IM developing team. You can redistribute it and/or modify it under the modified BSD license. See the copyright file for more details. IM151 2011-05-25 IM::MD5(3pm)

Check Out this Related Man Page

md5(3EXT)						    Extended Library Functions							 md5(3EXT)

NAME
md5, md5_calc, MD5Init, MD5Update, MD5Final - MD5 digest functions SYNOPSIS
cc [ flag ... ] file ... -lmd5 [ library ... ] #include <md5.h> void md5_calc(unsigned char *output, unsigned char *input, unsigned int inlen); void MD5Init(MD5_CTX *context); void MD5Update(MD5_CTX *context, unsigned char *input, unsigned int inlen); void MD5Final(unsigned char *output, MD5_CTX *context); DESCRIPTION
These functions implement the MD5 message-digest algorithm, which takes as input a message of arbitrary length and produces as output a 128-bit "fingerprint" or "message digest" of the input. It is intended for digital signature applications, where large file must be "com- pressed" in a secure manner before being encrypted with a private (secret) key under a public-key cryptosystem such as RSA. md5_calc() The md5_calc() function computes an MD5 digest on a single message block. The inlen-byte block is pointed to by input, and the 16-byte MD5 digest is written to output. MD5Init(), MD5Update(), MD5Final() The MD5Init(), MD5Update(), and MD5Final() functions allow an MD5 digest to be computed over multiple message blocks; between blocks, the state of the MD5 computation is held in an MD5 context structure, allocated by the caller. A complete digest computation consists of one call to MD5Init(), one or more calls to MD5Update(), and one call to MD5Final(), in that order. The MD5Init() function initializes the MD5 context structure pointed to by context. The MD5Update() function computes a partial MD5 digest on the inlen-byte message block pointed to by input, and updates the MD5 context structure pointed to by context accordingly. The MD5Final() function generates the final MD5 digest, using the MD5 context structure pointed to by context; the 16-byte MD5 digest is written to output. After calling MD5Final(), the state of the context structure is undefined; it must be reinitialized with MD5Init() before being used again. RETURN VALUES
These functions do not return a value. EXAMPLES
Example 1: Authenticate a message found in multiple buffers The following is a sample function that must authenticate a message that is found in multiple buffers. The calling function provides an authentication buffer that will contain the result of the MD5 digest. int AuthenticateMsg(unsigned char *auth_buffer, struct iovec *messageIov, unsigned int num_buffers) { MD5_CTX md5_context; unsigned int i; MD5Init(&md5_context); for(i=0, i<num_buffers; i++ { MD5Update(&md5_context, messageIov->iov_base, messageIov->iov_len); messageIov += sizeof(struct iovec); } MD5Final(auth_buffer, &md5_context); return 0; } Example 2: Use md5_calc() to generate the MD5 digest Since the buffer to be computed is contiguous, the md5_calc() function can be used to generate the MD5 digest. int AuthenticateMsg(unsigned char *auth_buffer, unsigned char *buffer, unsigned int length) { md5_calc(buffer, auth_buffer, length); return(0); } ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Stable | +-----------------------------+-----------------------------+ |MT-Level |MT-Safe | +-----------------------------+-----------------------------+ SEE ALSO
libmd5(3LIB) Rivest, R., The MD5 Message-Digest Algorithm, RFC 1321, April 1992. SunOS 5.10 20 Sep 2001 md5(3EXT)
Man Page