Skip to content
uencoder

MD5

MD5 is a 128-bit cryptographic hash function designed by Ronald Rivest; proven insecure by collision attacks, it is now used only for non-security purposes such as checksums.

Purpose

Provides a fast message digest for integrity checking, but is no longer suitable for security purposes due to collision attacks.

Mechanism

Processes input in 512-bit blocks, maintaining a 128-bit state (four 32-bit words). Each block goes through 4 rounds of 64 steps of nonlinear transforms (F/G/H/I) updating the state. Outputs the final 128-bit state. Collisions can be constructed in seconds.

Use cases

  • File download checksums (non-security)
  • ETag cache keys
  • Legacy system checksums (non-security)
  • Teaching examples (hash principles)

Examples

  • Input
    hello
    Output
    5d41402abc4b2a76b9719d911017c592

    128 bits = 32 hex characters

Common errors

Using MD5 to store passwords or make digital signatures
Use SHA-256 or bcrypt

Related terms

Related tools

References