Skip to main content

What Is SHA-224?

SHA-224 is a cryptographic hash function from the SHA-2 family. It processes data of arbitrary length and produces a hash value with a fixed length of 224 bits.

That corresponds to:

  • 28 bytes
  • 56 hexadecimal characters

SHA-224 is closely related to SHA-256. Both algorithms use the same basic 32-bit structure, process messages in 512-bit blocks, and perform 64 compression rounds for each block.

Nevertheless, SHA-224 is not simply SHA-256 with a shorter hash value.

The most important difference begins before the first compression round: SHA-224 uses different initial hash values.

SHA-224 Belongs to the SHA-2 Family​

SHA-2 refers to a family of several related cryptographic hash functions.

These include:

  • SHA-224
  • SHA-256
  • SHA-384
  • SHA-512
  • SHA-512/224
  • SHA-512/256

As we saw in What Is SHA-2?, these algorithms can be roughly divided into two groups.

SHA-224 and SHA-256 work internally with 32-bit words.

SHA-384, SHA-512, and SHA-512/224 and SHA-512/256, by contrast, use 64-bit words.

SHA-224 is thus structurally particularly closely related to SHA-256.

How Long Is a SHA-224 Hash?​

A SHA-224 hash consists of exactly:

224 bits

or:

28 bytes

In hexadecimal representation, four bits are represented by one character. A complete SHA-224 hash therefore has:

224 / 4 = 56

hexadecimal characters.

The length is independent of how large the input is.

Whether you process a single letter, a text, or a large file with SHA-224: the result always has 224 bits.

This fixed output length is precisely a fundamental property of hash functions.

How Does SHA-224 Work?​

If you already know How Does SHA-256 Work?, the basic process will look very familiar.

SHA-224 uses:

PropertySHA-224
Hash length224 bits
Word size32 bits
Block size512 bits
Message schedule64 words
Rounds per block64

In simplified terms, processing works like this:

  1. The message is prepared and padded.
  2. It is split into 512-bit blocks.
  3. Each block is divided into sixteen 32-bit words.
  4. From these, a message schedule with 64 words is created.
  5. The compression function processes the block over 64 rounds.
  6. The internal hash state is updated.
  7. At the end, 224 bits are output as the hash value.

This is essentially the same basic structure we already got to know with SHA-256.

Is SHA-224 Simply a Truncated SHA-256 Hash?​

No.

This is probably the most important difference to remember about SHA-224.

You might initially assume:

SHA-256
↓
256-bit hash
↓
remove the last 32 bits
↓
SHA-224

That is not how SHA-224 works, however.

SHA-224 and SHA-256 do use the same basic compression structure, but begin the calculation with different initial hash values.

These initial hash values form the starting state of the hash calculation.

Since this state already differs before the first message block is processed, the subsequent internal states also develop differently.

Therefore:

SHA-224(message)
≠
first 224 bits of SHA-256(message)

With SHA-224, the output is indeed limited at the end to seven 32-bit words — that is, 224 bits. But the internal state computed beforehand is not the same as with SHA-256, because of the different initial hash values.

The Initial Hash Values Make the Difference​

Both SHA-224 and SHA-256 begin with eight 32-bit words as their internal starting state.

For SHA-224, the Secure Hash Standard defines its own values.

In simplified terms, we can picture the difference like this:

Message
│
▼
Padding / blocks
│
┌─────────────┴─────────────┐
│ │
SHA-224 SHA-256
│ │
SHA-224 initial values SHA-256 initial values
│ │
▼ ▼
64 rounds 64 rounds
│ │
▼ ▼
different internal different internal
state state
│ │
▼ ▼
224 bits 256 bits

So the algorithms use the same basic machine, but start that machine from different states.

That makes SHA-224 an independent hash function, rather than merely a truncated representation of SHA-256.

Try Out the Difference Yourself​

The easiest way to observe the difference is with the same input.

Enter any text. The tool calculates three values from it:

  • the SHA-224 hash,
  • the SHA-256 hash,
  • and the first 224 bits of the SHA-256 hash.

That lets you compare SHA-224 directly with a SHA-256 hash truncated to 224 bits.

Compare SHA-224 and SHA-256

Is SHA-224 just a SHA-256 hash with the last 32 bits missing? Try it with your own text.

0 characters, 0 UTF-8 bytes

This implementation is for illustration. For production cryptography, vetted cryptographic libraries should be used.

Both comparison values are exactly 224 bits long — nevertheless, they differ for your input.

The tool additionally shows how many of the 224 bits differ. This number only describes the difference for the specific input and, taken on its own, is not a measure of cryptographic security.

The decisive point is a different one: SHA-224 starts the calculation with its own initial hash values. It is therefore an independent hash function, and not merely a shorter representation of SHA-256.

SHA-224 and SHA-256 Compared​

The technical similarities are greater than the differences:

PropertySHA-224SHA-256
Hash length224 bits256 bits
Word size32 bits32 bits
Block size512 bits512 bits
Words in the message schedule6464
Compression rounds6464
Initial hash valuesownown

The most obvious difference is the output length.

SHA-224 produces:

224 bits

SHA-256 produces:

256 bits

This difference also affects the generic collision resistance.

How Secure Is SHA-224?​

For an ideal hash function with an output of n bits, the generic effort for finding a collision, due to the birthday effect, is roughly on the order of:

2^(n/2)

For SHA-224, that gives:

2^112

For a generic preimage attack, by contrast, the order of magnitude is:

2^224

NIST accordingly lists a collision-resistance strength of 112 bits and a preimage-resistance strength of 224 bits for SHA-224.

For comparison:

AlgorithmCollision resistancePreimage resistance
SHA-224112 bits224 bits
SHA-256128 bits256 bits

Because of its longer output, SHA-256 thus offers a higher generic security strength against these two classes of attack.

I explain in more detail why collision resistance corresponds to only about half the hash length in The Birthday Paradox and in How Does a Birthday Attack Work?.

What About Second-Preimage Resistance?​

With second-preimage resistance, the situation is somewhat more nuanced.

According to the estimates given by NIST, the security strength for SHA-224 also depends on the length of the processed message. It therefore cannot simply be stated as a blanket 224 bits for every message.

If you want to understand why preimage resistance and second-preimage resistance, despite their similar-sounding names, describe different security properties, you can find a detailed explanation in What Is Second-Preimage Resistance?.

Why Does SHA-224 Exist at All?​

SHA-224 offers a shorter output than SHA-256, but uses its basic 32-bit structure.

A SHA-224 hash requires:

28 bytes

while SHA-256 requires:

32 bytes

The difference is therefore only four bytes per hash value.

In many modern applications, this storage saving is not particularly relevant. However, there are protocols, data formats, and cryptographic constructions in which a particular hash or security length is required.

SHA-224 provides such a 224-bit output within the standardized SHA-2 family.

For new interoperable applications, however, NIST recommends implementing at least SHA-256.

Should I Use SHA-224 or SHA-256?​

If you're not tied to SHA-224 by an existing protocol, standard, or data format, SHA-256 is usually the more obvious choice, especially when interoperability matters.

SHA-256:

  • has a longer output,
  • offers a higher generic collision and preimage security strength,
  • is very widely used,
  • and is recommended by NIST as a minimum implementation for applications where interoperability of hash functions is required.

That doesn't mean SHA-224 is fundamentally "insecure."

The choice of a hash function should always depend on the specific use case and the requirements of the standard or protocol being used.

And for some tasks, neither SHA-224 nor SHA-256 alone is the right solution.

An important example is storing passwords: for that, you shouldn't simply use a fast general-purpose hash function such as SHA-224 or SHA-256.

SHA-224 Is Not SHA3-224​

Here, too, the name can easily cause confusion.

In addition to SHA-224, there is:

SHA3-224

Both algorithms produce a hash value with 224 bits.

But they belong to different hash families:

SHA-224 → SHA-2
SHA3-224 → SHA-3

SHA-3 is based on a fundamentally different construction than SHA-2.

The identical output length therefore doesn't mean the algorithms are internally related or produce the same hash for the same input.

We'll therefore cover SHA-3 as an algorithm section of its own.

The Key Takeaways​

SHA-224 is a cryptographic hash function from the SHA-2 family and produces a 224-bit hash value.

It is closely related to SHA-256:

  • both work with 32-bit words,
  • both process 512-bit blocks,
  • both use a message schedule with 64 words,
  • both perform 64 compression rounds per block.

SHA-224 is nevertheless not simply a truncated SHA-256 hash.

The two algorithms use different initial hash values. As a result, their internal states differ already during the calculation.

SHA-224 offers a generic collision-resistance strength of 112 bits and a preimage-resistance strength of 224 bits.

Once you've understood SHA-224, the next step within the SHA-2 family is particularly interesting: What Is SHA-384? follows a similar principle, but is internally based on the 64-bit structure of SHA-512.

Sources and Standards​

  1. National Institute of Standards and Technology (NIST), FIPS 180-4 – Secure Hash Standard (SHS) Normative specification of SHA-224 and the other algorithms of the SHA-2 family. Includes padding, initial hash values, functions, constants, message schedule, and compression function.

  2. National Institute of Standards and Technology (NIST), Hash Functions Overview of the hash functions approved by NIST and of their collision, preimage, and second-preimage security strengths.

  3. National Institute of Standards and Technology (NIST), Policy on Hash Functions Recommendation to implement at least SHA-256 when applications or protocols require interoperability of hash functions.