Read this lesson as text

SHA-256

Cryptography · Axiom Academy

Understanding the cryptographic hash function that powers modern security SHA-256 belongs to the SHA-2 family, which includes several variants designed for different security levels and performance requirements: SHA-224: 224-bit output (truncated SHA-256) SHA-256: 256-bit output (most widely used) SHA-384: 384-bit output (truncated SHA-512) SHA-512: 512-bit output (highest security) All variants use the same underlying Merkle-Damgard construction with Davies-Meyer compression, differing primarily in word size, number of rounds, and output length. 2. Message Padding and Block Processing Before hashing, SHA-256 prepares the input message through a specific padding scheme: Step 1: Append a single '1' bit to the message Step 2: Pad with '0' bits until length ≡ 448 (mod 512) Step 3: Append original message length as 64-bit integer Result: Message length is now a multiple of 512 bits The padded message is divided into 512-bit blocks, each processed through 64 rounds of computation using the compression function. 3. Compression Function Operations SHA-256's compression function uses sophisticated bitwise operations to ensure cryptographic strength: These functions are combined in 64 rounds, each using a message schedule word and a round constant, ensuring that every output bit depends on every input bit. 4. The 64 Rounds of Computation Each 512-bit message block undergoes 64 rounds of processing with eight 32-bit working variables (a, b, c, d, e, f, g, h):

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