Method

MD5


Description

Returns the MD5 message-digest value of a String. This is the raw data as bytes, so convert it to something such as hexadecimal to display it.

Usage

result = MD5(str)

Part

Type

Description

result

String

The MD5 message digest form of the passed String.

str

String

The input string to be parsed.

Notes

The MD5 function uses the RSA Data Security, Inc. MD5 Message-Digest Algorithm. The MD5 algorithm is intended for digital signature applications, where a file must be compressed in a secure manner before being encrypted with a private (secret) key under a public-key cryptosystem such as RSA. It is a technology for verifying data integrity and is similar in concept to checksum techniques.

Use the MD5 function to process the raw data to be processed. For complete information on the MD5 message digest format, see RFC 1321.

The MD5Digest class implements the same algorithm but is capable of processing a large file in segments. The MD5 function is better suited for short strings that need to be encrypted such as passwords, account numbers, and private transaction strings.

To compare the MD5 hash from an outside source like PHP often requires that the RB hash be converted to a hex string with EncodeHex for comparison.

Sample code

Var bytes As String
bytes = MD5("Hello world")

' To display the hash, convert it to hexadecimal
Var hex As String
hex = EncodeHex(bytes)
MessageBox(hex)

Compatibility

All project types on all supported operating systems.

See also

MD5Digest class; Crypto.MD5 function