The Digest method will take an existing Data Blob, and calculate its hash/digest value.
The result will be stored to OutBlob
initialized by your program. The resulting Blob will *always*
contain 16/20 bytes, depending on whether MD5 or SHA1 algorithm
type
is used.
To provide some background theory, a hash/digest function is a
transformation that takes a variable size input, and
returns a fixed size byte array/string. A hash function is
said to be one-way, because it is hard to invert it -
meaning it's almost impossible to determine the original
data from it's hashed equivalent.
Hash functions do not require any secret key, they
operate by internal algorithm only. A typical example would
be:
Dim crypt As New
wodCryptCom
Dim i_blob As New MemBlob
Dim o_blob As New MemBlob
i_blob.Text = "this is text to be
digested"
crypt.Type = MD5
crypt.Digest i_blob, o_blob
Debug.Print o_blob.ToBase64
result:
GlFJb6uRzUC7MeLUBLdVzg==
Hash functions are usually used when both parties in a
conversation need to prove they both have same data (but
don't want to reveal it to other side, just in
case...). They both calculate their digest and, if they
match, then both parties have same data. If it does not match then the
other party cannot derive the original data given the hash value alone.