Skip to main content

What Are SHA-512/224 and SHA-512/256?

SHA-512/224 and SHA-512/256 are two cryptographic hash functions from the SHA-2 family.

Their names look somewhat unusual at first glance:

SHA-512/224
SHA-512/256

The first part of the name reveals which internal structure the algorithms are based on:

SHA-512

The number after the slash, by contrast, gives the length of the hash value produced:

SHA-512/224 → 224 bits
SHA-512/256 → 256 bits

This creates an initially surprising situation.

SHA-512/224 produces exactly as many output bits as SHA-224.

SHA-512/256 produces exactly as many output bits as SHA-256.

Nevertheless, in each case they are different hash functions.

A SHA-512/256 hash is therefore not the same as a SHA-256 hash.

The Complete SHA-2 Family​

With SHA-512/224 and SHA-512/256, we've reached the two variants that were still missing from our look at the SHA-2 family so far.

SHA-2 comprises:

AlgorithmHash lengthWord sizeBlock sizeRounds
SHA-224224 bits32 bits512 bits64
SHA-256256 bits32 bits512 bits64
SHA-384384 bits64 bits1024 bits80
SHA-512512 bits64 bits1024 bits80
SHA-512/224224 bits64 bits1024 bits80
SHA-512/256256 bits64 bits1024 bits80

This already shows the decisive difference.

SHA-512/224 and SHA-512/256 structurally belong to the 64-bit side of the SHA-2 family.

They use:

  • 64-bit words,
  • 1024-bit message blocks,
  • a message schedule with 80 words,
  • and 80 compression rounds per block.

That makes them internally much more closely related to SHA-512 than to SHA-224 or SHA-256.

What Does SHA-512/t Mean?​

FIPS 180-4 uses the general designation:

SHA-512/t

Here, t stands for the desired length of the hash value.

In simplified terms:

SHA-512/t
│
└── length of the hash value in bits

For the two standardized variants, the following applies:

t = 224 → SHA-512/224
t = 256 → SHA-512/256

t must be less than 512. In addition, t = 384 is excluded, because SHA-384 already exists as a hash function based on the SHA-512 structure with a 384-bit output.

FIPS 180-4 defines SHA-512/224 and SHA-512/256 as approved variants.

How Does SHA-512/224 Work?​

SHA-512/224 uses the basic structure of SHA-512.

A message is first prepared and split into:

1024-bit blocks

Each block is processed with 64-bit words. From the first 16 words, a message schedule with a total of:

80 words

is created.

Then follow:

80 compression rounds

per message block.

Internally, like SHA-512, the algorithm has a state of eight 64-bit words:

8 × 64 bits = 512 bits

At the end, however, only:

224 bits

of it are output as the hash value.

The finished SHA-512/224 hash therefore consists of:

28 bytes

or:

56 hexadecimal characters

How Does SHA-512/256 Work?​

SHA-512/256 uses the same basic 64-bit structure.

Here, too, the algorithm works with:

64-bit words
1024-bit blocks
80 words in the message schedule
80 compression rounds

The difference lies in the desired output length.

SHA-512/256 delivers:

256 bits

That corresponds to:

32 bytes

or:

64 hexadecimal characters

And this is exactly where it gets particularly interesting.

Is SHA-512/256 the Same as SHA-256?​

No.

Both algorithms do produce a hash value of exactly:

256 bits

Internally, however, they work with different structures.

PropertySHA-256SHA-512/256
Hash length256 bits256 bits
Word size32 bits64 bits
Block size512 bits1024 bits
Message schedule64 words80 words
Rounds6480
Internal state256 bits512 bits

The identical output length therefore says nothing yet about how the hash value was calculated.

In simplified form:

the same message
│
┌────────────┴────────────┐
│ │
SHA-256 SHA-512/256
│ │
32-bit words 64-bit words
512-bit blocks 1024-bit blocks
64 rounds 80 rounds
│ │
▼ ▼
256 bits 256 bits

Both results have the same length.

The hash values are nevertheless not identical.

If you want to follow the structure of SHA-256 in detail, you'll find it in How Does SHA-256 Work?. You'll also find a direct comparison of the 32-bit and the 64-bit structure of SHA-2 in SHA-256 vs. SHA-512 – What Is the Difference?.

And SHA-512/224 Is Not SHA-224​

The same applies to SHA-512/224.

Both SHA-224 and SHA-512/224 produce:

224 bits

But here, too, the internal structures differ considerably:

PropertySHA-224SHA-512/224
Hash length224 bits224 bits
Word size32 bits64 bits
Block size512 bits1024 bits
Message schedule64 words80 words
Rounds6480

Here we see again an important property of cryptographic hash functions:

The length of the hash value alone doesn't identify the algorithm.

A 256-bit hash could come from SHA-256, SHA-512/256, or even SHA3-256, for example.

Why Not Simply Take SHA-512 and Cut Off the Hash?​

Now you might come up with a different idea.

If SHA-512/256 is based on SHA-512, couldn't you simply calculate SHA-512 and then remove the last 256 bits:

SHA-512(message)
│
▼
512 bits
│
▼
first 256 bits

But that, too, is not SHA-512/256.

The same principle applies to SHA-512/224.

SHA-512/224 and SHA-512/256 use their own initial hash values.

The calculation therefore already begins with a different internal state than an ordinary SHA-512 hash.

The following therefore generally applies:

SHA-512/256(message)
≠
first 256 bits of SHA-512(message)

and:

SHA-512/224(message)
≠
first 224 bits of SHA-512(message)

We already know the principle from SHA-224 and SHA-384.

With SHA-512/t, however, the standard goes one step further.

Where Do the Initial Hash Values Come From?​

For SHA-512/224 and SHA-512/256, FIPS 180-4 doesn't just define concrete initial hash values.

The standard also describes a procedure with which the initial hash values for SHA-512/t are generated.

This procedure is called:

SHA-512/t IV Generation Function

That is interesting because the initial hash values thereby depend systematically on the desired output length t.

The SHA-512/t IV Generation Function​

The starting point is the normal initial hash values of SHA-512.

Each of the eight 64-bit words is combined with the hexadecimal constant:

a5a5a5a5a5a5a5a5

via XOR.

In simplified form:

SHA-512 initial values
│
▼
XOR with a5a5a5a5a5a5a5a5
│
▼
modified initial values

With these modified initial hash values, a SHA-512 calculation is then performed.

The message used is the ASCII text:

SHA-512/t

where t is replaced by the concrete output length.

For SHA-512/256, for example, the message is:

SHA-512/256

For SHA-512/224, accordingly:

SHA-512/224

The result of this calculation forms the initial hash values of the respective SHA-512/t variant.

In simplified form, the process looks like this:

normal SHA-512 IVs
│
▼
XOR with A5A5A5A5A5A5A5A5
│
▼
temporary IVs
│
│
├── hash "SHA-512/224"
│ │
│ ▼
│ IVs for SHA-512/224
│
└── hash "SHA-512/256"
│
▼
IVs for SHA-512/256

As a result, each variant gets its own initial hash values.

Why Go to This Trouble?​

The different initial hash values ensure that SHA-512/224 and SHA-512/256 are independent functions.

They do use the same basic compression structure as SHA-512, but start this calculation from a different state.

In particular, this prevents SHA-512/t from being understood simply as a different representation of an ordinary SHA-512 hash.

We now encounter this pattern several times within SHA-2:

SHA-224 ≠ truncated SHA-256
SHA-384 ≠ truncated SHA-512
SHA-512/224 ≠ truncated SHA-512
SHA-512/256 ≠ truncated SHA-512

The decisive difference arises in each case before the actual processing of the message.

Try Out the Differences Yourself​

At this point, we can compare several variants with exactly the same input.

Enter any text. The tool calculates:

  • SHA-224,
  • SHA-512/224,
  • SHA-256,
  • SHA-512/256,
  • and SHA-512.

This produces two particularly interesting comparisons:

SHA-224
vs.
SHA-512/224

Both deliver 224 bits.

And:

SHA-256
vs.
SHA-512/256

Both deliver 256 bits.

In addition, we can compare SHA-512/224 and SHA-512/256 with a correspondingly truncated ordinary SHA-512 hash.

Compare SHA-224/256 and SHA-512/224/256

SHA-256 and SHA-512/256 both produce 256 bits. Does that make them the same algorithm? 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.

That lets you see directly:

The same hash length doesn't mean the same algorithm.

The number of differing bits shown is only a visual comparison for your specific input — not a security score and not a measure of entropy or collision resistance.

SHA-512/256 and SHA-256 Compared Directly​

SHA-512/256 and SHA-256 in particular are a good example of this.

Both produce:

256 bits

and, according to NIST's figures, have the same generic security strengths:

PropertySHA-256SHA-512/256
Collision resistance128 bits128 bits
Preimage resistance256 bits256 bits

Nevertheless, they are different algorithms.

SHA-256 works on the 32-bit structure of the SHA-2 family.

SHA-512/256, by contrast, works on the 64-bit structure of SHA-512 and truncates the resulting SHA-512/t state to 256 bits.

How Secure Is SHA-512/224?​

NIST lists the following security strengths for SHA-512/224:

PropertySecurity strength
Collision resistance112 bits
Preimage resistance224 bits
Second-preimage resistance224 bits

The collision and preimage security strengths thus correspond to the values you'd expect from an idealized hash function with 224 bits of output.

For a collision, the generic effort, due to the birthday effect, is roughly:

2^112

For a preimage attack, roughly:

2^224

How Secure Is SHA-512/256?​

For SHA-512/256, NIST lists:

PropertySecurity strength
Collision resistance128 bits
Preimage resistance256 bits
Second-preimage resistance256 bits

The generic effort for a collision is thus roughly:

2^128

and for a preimage attack:

2^256

With respect to these generic security strengths, SHA-512/256 thus has the same values as SHA-256.

The internal construction is nevertheless a different one.

I explain in more detail what exactly distinguishes these three security properties from one another in the articles on collision resistance, preimage resistance, and second-preimage resistance. What 224 or 256 bits of security strength mean in practice is described in How Secure Are 128, 256, and 512 Bits?.

Why Do SHA-512/224 and SHA-512/256 Exist?​

The two algorithms combine two properties:

SHA-512-like internal structure
+
shorter output

That lets applications use a SHA-512-based 64-bit structure without having to store or transmit a 512-bit hash value.

Which variant makes sense, however, depends on the respective protocol, standard, and use case.

The existence of SHA-512/256, for example, doesn't mean you should generally replace SHA-256 with SHA-512/256.

Both are SHA-2 algorithms approved by NIST.

For applications where interoperability of hash functions is required, NIST recommends implementing at least SHA-256.

SHA-512/256 Is Not SHA3-256 Either​

With the names, things can easily get confusing by now.

These three algorithms all produce a 256-bit hash:

SHA-256
SHA-512/256
SHA3-256

Internally, however, they differ considerably.

AlgorithmFamilyBasic structureOutput
SHA-256SHA-232-bit SHA-2256 bits
SHA-512/256SHA-264-bit SHA-512/t256 bits
SHA3-256SHA-3Keccak256 bits

The number 256 merely describes the length of the hash value here.

It doesn't say that the algorithms work the same way internally.

This becomes especially important when we deal with SHA-3 later.

The Key Takeaways​

SHA-512/224 and SHA-512/256 are two hash functions from the SHA-2 family.

Both are based on the basic 64-bit structure of SHA-512:

  • 64-bit words,
  • 1024-bit blocks,
  • 80 words in the message schedule,
  • 80 compression rounds.

Their outputs, however, are shorter:

SHA-512/224 → 224 bits
SHA-512/256 → 256 bits

SHA-512/224 is therefore still not the same as SHA-224.

And SHA-512/256 is not the same as SHA-256.

An ordinary SHA-512 hash that is truncated to 224 or 256 bits afterward doesn't simply yield SHA-512/224 or SHA-512/256 either.

For this, FIPS 180-4 defines the SHA-512/t IV generation function, with which dedicated initial hash values are generated for the respective variants.

With that, our journey through the SHA-2 family is complete:

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

We've thus gotten to know not only the individual variants, but also an important principle:

The length of a hash value alone doesn't yet tell you which algorithm produced it.

Sources and Standards​

  1. National Institute of Standards and Technology (NIST), FIPS 180-4 – Secure Hash Standard (SHS) Normative specification of SHA-224, SHA-256, SHA-384, SHA-512, as well as SHA-512/224 and SHA-512/256. Also includes the SHA-512/t IV generation function.

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

  3. National Institute of Standards and Technology (NIST), Policy on Hash Functions NIST policy on the use of the SHA-2 and SHA-3 families.