digestpp 1.0
C++11 header-only message digest library
Loading...
Searching...
No Matches
MD5

MD5 Algorithm More...

Typedefs

typedef hasher< detail::md5_providerdigestpp::md5
 MD5 hash function.
 

Detailed Description

MD5 Algorithm

Typedef Documentation

◆ md5

MD5 hash function.

Historic hash function designed by Ronald Rivest in 1991.

Warning
MD5 is cryptographically BROKEN and MUST NOT be used for any security purpose. Practical collision attacks have been demonstrated since 2004, and chosen-prefix collision attacks are now computationally feasible.

Known vulnerabilities:

  • Collision attacks: trivial (seconds on modern hardware)
  • Chosen-prefix collisions: practical (2019 research)
  • Used in real-world attacks (Flame malware, 2012)
  • Should never be used for digital signatures, certificates, or password storage

MD5 may still be acceptable for legacy protocol compatibility (when no security is required).

Type:
Cryptographic hash function.
Output size:
128 bits
Default size:
128 bits
Example:
// Output an MD5 digest of a string
hasher.absorb("The quick brown fox jumps over the lazy dog");
std::cout << hasher.hexdigest() << '\n';
Main class template implementing the public API for hashing.
Definition hasher.hpp:38
std::string hexdigest() const
Return hex digest of absorbed data.
Definition hasher.hpp:372
hasher & absorb(const T *data, size_t len)
Absorbs bytes from a C-style pointer to character buffer.
Definition hasher.hpp:86
Example output:
9e107d9d372bb6826bd81d3542a419d6
See also
hasher, sha256, blake2b, skein512