Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
virtual P6R::P6ERR P6R::p6IDigest::calculateMD5 ( P6CRYPTODATASOURCE pInData,
P6BOOL  base64Encode,
P6CRYPTODATASINK pOutData 
)
pure virtual

MD5 (Message Digest Algorithm 5) is a cryptographic hash function that was designed by Ron Rivest in 1991 to replace MD4 and is specified in RFC 1321.

It's digest length is 128 bits. MD5 has been found to not be collision resistent and should therefore not be used in application that require it. MD5 has been found vulnerable to attack in 2008 and therefore should not be used in new designs. It is provided for compatibility with previous protocols and applications which specify it's use. The MD5 of either a file (both binary and text) or a buffer can be calculated.

See Also
RFC-1321
Parameters
pInData[ in ] Pointer to the data to calculate the MD5 over.
base64Encode[ in ] Flag indicating whether the MD5 should be encoded in base64 (otherwise it is binary string)
pOutData[ in ] Pointer to where to copy the MD5 digest value.
Returns
SuccessP6R::eOk 
FailureP6R::eNotInitializedA successful call to initialize was not made before this call.
P6R::eInvalidArgOne of the parameters is NULL.
P6R::eNotFoundFile data source does not exist.
P6R::eIoErrorWrite to file data sink failed.
P6R::eTooSmallThe buffer data sink is too small to contain the generated value.
P6R::eTooBig/td>Internal error
P6R::eFailAndExceptionThe digest calculation failed. Exception record provides detailed error info.