Skip to content
Checksum algorithm · Format description concepts

SHA-224 hash algorithm: the 224-bit digest and its use in fixity

Published Formatory editorial team

SHA-224 is a cryptographic hash function of the SHA-2 family, specified in FIPS 180-4, that produces a 224-bit message digest.

Preservation systems record the algorithm name next to each stored digest so that a later fixity check recomputes the same function.

SHA-224 was added to the Secure Hash Standard in a 2004 change notice to FIPS 180-2 and lives today in FIPS 180-4, the NIST publication that defines the whole SHA-2 family: SHA-224, SHA-256, SHA-384, SHA-512 and the truncated SHA-512/224 and SHA-512/256. Its output is a 224-bit digest, written as 56 hexadecimal characters. Its purpose was a hash whose security strength, 112 bits, matched that of three-key Triple DES and 2048-bit RSA, so that protocols could pair algorithms of equal strength.

For people who manage files, the details of that pairing matter less than a simple fact: SHA-224 is one of the checksum algorithms a repository may meet in fixity records, manifests and format registry descriptions.

How it relates to SHA-256

Under the hood SHA-224 is SHA-256 with two changes. It starts from different initial hash values (eight 32-bit constants defined in FIPS 180-4), and it outputs only the first 224 bits of the final state. The block size (512 bits), the 64 rounds and the speed are the same, so SHA-224 is no faster than SHA-256. Because of the different starting values, a SHA-224 digest is not the first 56 characters of a SHA-256 digest of the same file, a mistake that occasionally turns up in hand-written verification scripts.

The 512/224 variant is a different function again: it is derived from SHA-512 and also produces 224 bits. Records that just say “SHA-224” mean the SHA-256-based function, and confusing the two produces mismatches that look like file corruption.

SHA-224 in fixity checking

A fixity check recomputes a file’s digest and compares it with a stored value. For that to work years later, the record has to state precisely which algorithm produced the digest. In PREMIS, this is the job of messageDigestAlgorithm, next to messageDigest and the originator of the value. A digest stored without its algorithm is close to useless, and the identifier of the algorithm should come from a controlled list so that “SHA224”, “sha-224” and “SHA-224” do not end up as three different values.

SHA-224 is rarely the default in preservation tools. MD5 persists for legacy reasons, and SHA-256 or SHA-512 dominate new systems; the BagIt specification (RFC 8493), for instance, names SHA-256 and SHA-512 as the algorithms implementations should support. SHA-224 tends to appear where an existing system or a protocol chose it, and a repository receiving such data should keep the supplied digests and add its own in a preferred algorithm. Recording both keeps the chain of evidence back to the depositor intact.

Checksums versus media and formats

A digest says nothing about format; it treats the file as a sequence of bytes. That is its strength for fixity and its limit for anything else. Two files with different digests can be the same image in different encodings, and a file can keep a valid digest while its format becomes unreadable. Digests also do not protect the storage itself: a write-once medium prevents accidental overwriting, while a fixity check only detects damage after it has happened.

One trick is worth knowing. The digest of an empty input (shown in the example above) recurs in real collections whenever a transfer silently produced zero-byte files, and searching a fixity database for that exact value is a cheap way to find them. The vocabulary index and the file format identification guide cover the identification side that digests leave open.

Example in RDF

$ printf '' | sha224sum
d14a028c2a3a2bc9476102bb288234c415a2b01f828ea62ac5b3e42f  -

<premis:fixity>
  <premis:messageDigestAlgorithm>SHA-224</premis:messageDigestAlgorithm>
  <premis:messageDigest>d14a028c2a3a2bc9476102bb288234c415a2b01f828ea62ac5b3e42f</premis:messageDigest>
  <premis:messageDigestOriginator>https://example.org/agents/ingest-service</premis:messageDigestOriginator>
</premis:fixity>

Questions about SHA-224

How long is a SHA-224 hash?

224 bits, which is 28 bytes. Written in hexadecimal it is 56 characters long; in Base64 it takes 40 characters with padding. The length alone distinguishes it from SHA-1 (40 hex characters) and SHA-256 (64).

Is SHA-224 just a shortened SHA-256?

Almost. It runs the SHA-256 compression function but starts from a different set of eight initial hash values, then keeps only the first seven 32-bit words of the result. Truncating a SHA-256 digest by hand does not give a SHA-224 digest.

Is SHA-224 secure?

No practical attacks are known. Its collision resistance is rated at 112 bits, lower than SHA-256's 128 bits. NIST guidance plans to retire 112-bit security strengths for new uses after 2030, which makes SHA-256 or stronger the safer choice for new systems.

How do I compute a SHA-224 checksum?

On Linux, GNU coreutils includes sha224sum, which prints the digest followed by the file name. OpenSSL offers openssl dgst -sha224, Python has hashlib.sha224, and most programming languages expose it in their standard cryptography library. Results from all of these should match exactly.

What is the SHA-224 hash of an empty file?

d14a028c2a3a2bc9476102bb288234c415a2b01f828ea62ac5b3e42f. Seeing this value in a fixity record is a useful warning sign: the file it describes was zero bytes long when the digest was computed, which often points to a failed transfer or an export that never wrote its data.

More from Format description concepts

All 16 in this group