VideoTools
|
MD5 message digest class. More...
#include <gmd5.h>
Classes | |
struct | Masked |
An overload discriminator for G::Md5::hmac() More... | |
Static Public Member Functions | |
static std::string | digest (const std::string &input) |
Creates an MD5 digest. More... | |
static std::string | digest (const std::string &input_1, const std::string &input_2) |
An overload which processes two input strings. | |
static std::string | printable (const std::string &input) |
Converts a binary string into a printable form, using a lowercase hexadecimal encoding. More... | |
static std::string | hmac (const std::string &key, const std::string &input) |
Computes a Hashed Message Authentication Code using MD5 as the hash function. More... | |
static std::string | hmac (const std::string &masked_key, const std::string &input, Masked) |
An hmac() overload using a masked key. More... | |
static std::string | mask (const std::string &key) |
Computes a masked key for hmac() from the given shared key, returning a printable string. More... | |
|
static |
Creates an MD5 digest.
The resulting string is not generally printable and it may have embedded NULs.
Definition at line 165 of file gmd5_native.cpp.
|
static |
Computes a Hashed Message Authentication Code using MD5 as the hash function.
This is typically for challenge-response authentication where the plaintext input is an arbitrary challenge string from the server that the client has to hmac() using their shared private key.
See also RFC2104 [HMAC-MD5].
For hash function H with block size B (64) and output size L (16), using shared key SK:
The H() function processes a stream of blocks; the first parameter above represents the first block, and the second parameter is the rest of the stream (zero-padded up to a block boundary).
The shared key can be up to B bytes, or if more than B bytes then K is the L-byte result of hashing the shared-key. K is zero-padded up to B bytes for XOR-ing.
Definition at line 159 of file gmd5_native.cpp.
|
static |
An hmac() overload using a masked key.
A masked key (MK) is the result of doing the initial, plaintext-independent parts of HMAC computation, taking the intermediate results of both the inner and outer hash functions.
Definition at line 143 of file gmd5_native.cpp.
|
static |
Computes a masked key for hmac() from the given shared key, returning a printable string.
Definition at line 129 of file gmd5_native.cpp.
|
static |
Converts a binary string into a printable form, using a lowercase hexadecimal encoding.
See also RFC2095.
Definition at line 185 of file gmd5_native.cpp.