MD2 Hash

Technical details, regex signatures, and cracking commands for the MD2 algorithm.

Regex Identification Signature:
^(\$md2\$)?[a-f0-9]{32}$
Not supported natively by Hashcat
John the Ripper Command:
← Back to Hash Identifier

What is MD2?

MD2 (Message Digest 2) was designed by Ron Rivest in 1990 as a lightweight cryptographic hash function, originally intended for use in secure communications protocols like SSL (then still in its early stages). Structurally, MD2 operates on fixed-length blocks of 16 bytes, padding input data to a multiple of 16 using a simple scheme that appends a byte with the padding length followed by null bytes. The algorithm employs a 48-byte checksum (or "checksum byte") derived from the input, which is iteratively updated during processing. MD2’s core mechanism involves a 128-bit output hash generated via 18 rounds of permutation and substitution, where each round applies a bitwise transformation to the checksum and input data using a fixed 256-byte transformation table (T). Unlike its successor MD4, MD2 prioritizes efficiency over raw speed, making it particularly suited for constrained environments like embedded systems or early network protocols where computational overhead was a critical concern.

MD2’s vulnerabilities stem from its design trade-offs and cryptographic weaknesses. The absence of a salt or iterative hashing mechanism renders it susceptible to brute-force attacks, as identical inputs produce identical hashes, enabling precomputation of rainbow tables. Its fixed-length block processing and simple padding scheme also make it prone to collision attacks, with known collisions discovered within hours of its publication. Additionally, MD2’s reliance on a static transformation table (T) and its 18-round structure—designed for minimal computational cost—lacks the avalanche effect seen in modern hashes, allowing GPU/CPU optimizations to accelerate cracking via parallelized brute-force or meet-in-the-middle attacks. The algorithm’s obsolescence is further cemented by its exclusion from NIST’s SHA family and its failure to meet modern security standards, rendering it unsuitable for any contemporary cryptographic application.

Identifying MD2 Hashes

Identifying a hash blindly is often difficult because multiple algorithms can output strings of the exact same length. For example, a standard 32-character hexadecimal string could be MD5, NTLM, MD4, or LM. To definitively identify MD2, security researchers analyze the hash against a strict regular expression (regex) signature (shown above) to find structural matches.

How to Crack MD2

If you need to recover the plaintext password for a MD2 hash during a penetration test or forensics investigation, you must supply the correct module ID to your cracking software. Use the exact commands provided at the top of this page to target the hash successfully.