What is MD2?
MD2 is a 128-bit cryptographic hash function developed by Ronald Rivest in 1989 and optimized for 8-bit machines. The tool generates a fixed 128-bit (32-character hexadecimal) message digest from any text or file input entirely in your browser, with no data sent to any server. While MD2 produces a one-way hash unsuitable for new security applications, the tool remains useful for legacy system compatibility, checksum verification, and non-security hashing tasks where it was previously deployed.
How MD2 works
MD2 is a message-digest algorithm that compresses input of any length into a fixed 128-bit fingerprint through a deterministic process. The algorithm works in five main steps:
- Padding: The input message is extended to a multiple of 16 bytes by appending padding bytes that specify how many bytes were added
- Checksum: A 16-byte checksum is calculated and appended using a 256-byte lookup table (S-table)
- Initialize Buffer: A 48-byte processing buffer is initialized to zero
- Transform: The padded message is processed in 16-byte blocks through 18 rounds of cryptographic transformation, updating the buffer each round
- Output: The first 16 bytes of the final buffer state become the 128-bit digest, displayed as 32 hexadecimal characters
Worked Example: When you hash the text "hello", the algorithm pads it to 16 bytes, appends a checksum, processes it through multiple transformation rounds, and produces a unique 32-character hexadecimal string. The same input always produces the same output, but changing even one character in the input completely changes the hash.
How to use
- Type or paste your text into the input box.
- The MD2 hash is calculated automatically as you type.
- Choose your output encoding (Hex or Base64) if needed.
- Click Copy to copy the digest to your clipboard.
Common uses
- Generating checksums for legacy systems and databases that still use MD2 for data integrity checks
- Creating unique identifiers for non-cryptographic purposes where consistent hashing of input data is needed
- Verifying file integrity in older PKI certificates and digital signature systems that were deployed with MD2
- Testing and debugging applications that include MD2 support for backward compatibility with historical data
- Educational purposes to understand how cryptographic hash functions work and process input through deterministic algorithms
- Validating MD2 hashes from legacy systems when migrating to modern security protocols