Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
GrayLib::cHashMD5 Class Reference

#include <cHashMD5.h>

Inheritance diagram for GrayLib::cHashMD5:
GrayLib::cHashCodeT< 16 > Gray::cMemStatic< TYPE_SIZE >

Public Member Functions

 cHashMD5 () noexcept
 
 cHashMD5 (const char *pszHexDigest)
 
void SetHashFrom (const void *pInput, size_t nInputSize)
 
void SetHashFromStr (const char *pszString)
 
void SetHmacFrom (const BYTE *pKey, size_t nKeySize, const void *pInput, size_t nInputSize)
 
 UNITTEST_FRIEND (cHashMD5)
 
- Public Member Functions inherited from GrayLib::cHashCodeT< 16 >
bool isValidHash () const noexcept
 
size_t get_HashSize () const noexcept
 
cHashCode get_HashCode () const
 
StrLen_t GetHexDigest (OUT char *pszHexString) const
 
cStringA get_HexDigest () const
 
HRESULT put_HexDigest (const char *pszInp)
 
- Public Member Functions inherited from Gray::cMemStatic< TYPE_SIZE >
size_t get_DataLength () const noexcept
 
const BYTE * get_DataBytes () const noexcept
 
 operator const BYTE * () const noexcept
 

Static Public Member Functions

static size_t GRAYCALL ComputeHash (BYTE pOutput[16], const void *pInput, size_t nSize)
 
static size_t GRAYCALL ComputeHmac (BYTE pOutput[16], const BYTE *pKey, size_t nKeySize, const void *pInput, size_t nSize)
 

Friends

class cHashMD5Builder
 

Additional Inherited Members

- Public Attributes inherited from Gray::cMemStatic< TYPE_SIZE >
BYTE m_Data [TYPE_SIZE]
 All objects of this type are this size. More...
 
- Static Public Attributes inherited from Gray::cMemStatic< TYPE_SIZE >
static const size_t k_Size = TYPE_SIZE
 All hashes of this type are this size (bytes). More...
 
static const size_t k_SizeHexDigest = ((TYPE_SIZE * 2) + 1)
 hold a string with the hex digest of this. (chars). More...
 

Detailed Description

Hold a 16-byte MD5 hash from a stream of data. SSL_Hash_MD5 NOT known to be reversible, but possible to brute force guess. This should ideally be instance salted so it cannot be compared with other known hashes.

Note
In theory this is not as good as SHA1. In 2015 allegations of cracking for MD5? (via SLOTH attack)

Constructor & Destructor Documentation

◆ cHashMD5() [1/2]

GrayLib::cHashMD5::cHashMD5 ( )
inlinenoexcept

◆ cHashMD5() [2/2]

GrayLib::cHashMD5::cHashMD5 ( const char *  pszHexDigest)
inline

Member Function Documentation

◆ ComputeHash()

size_t GRAYCALL GrayLib::cHashMD5::ComputeHash ( BYTE  pOutput[16],
const void *  pInput,
size_t  nSize 
)
static

◆ ComputeHmac()

size_t GRAYCALL GrayLib::cHashMD5::ComputeHmac ( BYTE  pOutput[16],
const BYTE *  pKey,
size_t  nKeySize,
const void *  pInput,
size_t  nSize 
)
static

◆ SetHashFrom()

void GrayLib::cHashMD5::SetHashFrom ( const void *  pInput,
size_t  nInputSize 
)
inline

◆ SetHashFromStr()

void GrayLib::cHashMD5::SetHashFromStr ( const char *  pszString)
inline

◆ SetHmacFrom()

void GrayLib::cHashMD5::SetHmacFrom ( const BYTE *  pKey,
size_t  nKeySize,
const void *  pInput,
size_t  nInputSize 
)
inline

◆ UNITTEST_FRIEND()

GrayLib::cHashMD5::UNITTEST_FRIEND ( cHashMD5  )

Friends And Related Function Documentation

◆ cHashMD5Builder

friend class cHashMD5Builder
friend

The documentation for this class was generated from the following files: