Read this lesson as text

MD5 and SHA-1

Cryptography · Axiom Academy

LESSON MD5 and SHA-1 Hash Algorithms Understanding two widely-used but broken cryptographic hash functions and why they're no longer secure 1. MD5 Structure: Merkle-Damgård Construction MD5 (Message Digest Algorithm 5) was designed by Ron Rivest in 1991 as an improvement over MD4. It processes input messages in 512-bit blocks and produces a 128-bit hash output. Block size: 512 bits (64 bytes) Output size: 128 bits (16 bytes) Rounds: 4 rounds with 16 operations each (64 total) Construction: Merkle-Damgård paradigm with padding The Merkle-Damgård construction chains blocks together: each block's output becomes part of the input to the next block's compression function. This creates a cascading effect where the final hash depends on all input blocks. 2. SHA-1 Structure: Similar Design, Larger Output SHA-1 (Secure Hash Algorithm 1) was designed by the NSA and published by NIST in 1995. It follows a similar Merkle-Damgård construction to MD5 but with important improvements. Output size: 160 bits (20 bytes) — 32 bits larger than MD5 Rounds: 4 rounds with 20 operations each (80 total) Internal state: Five 32-bit words (160 bits total) The larger output size was intended to provide stronger collision resistance. Theoretically, finding a collision should require 2 80 operations (compared to 2 64 for MD5), making brute-force attacks computationally infeasible. 3. Collision Attacks: Why Both Are Broken

This is the written version of the interactive lesson above. See the full Cryptography course.