Compare Old and New Hashes
Paste the exact value you store today (a file's contents, a token, a record key) and the tool computes every common digest at once so you can confirm what your migrated system should produce.
Verify a migrated record
Paste the SHA-224 value your new system produced for the same input to confirm the migration is correct.
How to Use the Hash Migration Tool
- Pick a sample record. Choose a few real inputs from the system you are migrating (a document, an API payload, a checksum target).
- Compute all digests. Confirm the MD5 or SHA-1 value matches what you have stored. That proves you are hashing exactly the same bytes (encoding, trailing newlines and whitespace all matter).
- Record the SHA-224 value. This is what your migrated code path must produce for the same input.
- Verify the new system. Paste the SHA-224 your application generated into the verify box. A match confirms the implementation; a mismatch usually points to an encoding or padding difference.
- Roll out with dual hashing. Store both digests during the transition, then retire the old column once every record has a SHA-224 value. The SHA-224 migration guide covers the full rollout and rollback plan.
What Changes When You Migrate
| Algorithm | Digest size | Hex length | Collision resistance | Status |
|---|---|---|---|---|
| MD5 | 128 bits (16 bytes) | 32 characters | Broken (practical collisions) | Do not use for security |
| SHA-1 | 160 bits (20 bytes) | 40 characters | Broken (SHAttered, 2017) | Deprecated |
| SHA-224 | 224 bits (28 bytes) | 56 characters | 112-bit security level | NIST approved |
| SHA-256 | 256 bits (32 bytes) | 64 characters | 128-bit security level | NIST approved |
Schema impact
A SHA-224 digest needs a 56-character hex column (or 28 bytes binary). Columns sized for MD5 (32) or SHA-1 (40) must be widened before dual-writing begins. Moving from SHA-256 to SHA-224 shrinks storage by 8 bytes per hash. See SHA-224 vs SHA-256 for the full comparison.
Dual-Hash Code for the Transition Period
During migration, compute the legacy digest and SHA-224 together so existing lookups keep working while new records are written with the new algorithm.
import hashlib
def dual_hash(data: bytes) -> dict:
"""Return the legacy digest and the SHA-224 digest for the same bytes."""
return {
"legacy_sha1": hashlib.sha1(data).hexdigest(), # keep until migration completes
"sha224": hashlib.sha224(data).hexdigest(), # new canonical value
}
print(dual_hash(b"abc"))
# {'legacy_sha1': 'a9993e364706816aba3e25717850c26c9cd0d89d',
# 'sha224': '23097d223405d8228642a477bda255b32aadbce4bda0b3f7e36c9da7'}
const { createHash } = require('crypto');
function dualHash(buffer) {
return {
legacyMd5: createHash('md5').update(buffer).digest('hex'), // keep until migration completes
sha224: createHash('sha224').update(buffer).digest('hex') // new canonical value
};
}
console.log(dualHash(Buffer.from('abc')));
// { legacyMd5: '900150983cd24fb0d6963f7d28e17f72',
// sha224: '23097d223405d8228642a477bda255b32aadbce4bda0b3f7e36c9da7' }
# Compare digests for a file before and after migration
openssl dgst -sha1 firmware.bin
openssl dgst -sha224 firmware.bin
Hash Migration Questions
Can I convert an existing MD5 or SHA-1 hash directly into SHA-224?
No. Hash functions are one-way, so there is no way to derive a SHA-224 value from an MD5 or SHA-1 digest. You must re-hash the original data. For files and records that is straightforward; for password hashes it means re-hashing on the user's next successful login (and, for passwords, using a slow KDF such as Argon2 or PBKDF2 rather than a bare hash).
Why do my SHA-224 values differ from this tool?
Almost always an input difference: UTF-8 versus UTF-16 encoding, a trailing newline added by a shell, or hex versus raw bytes. Hash the sample here, compare the MD5 line with your stored value first, and adjust until the legacy digest matches; the SHA-224 value will then match too. The NIST SHA-224 test vectors are a good sanity check for the implementation itself.
Should I migrate to SHA-224 or SHA-256?
Both are secure SHA-2 members. SHA-224 is the right target when storage, bandwidth or a fixed 112-bit security level matters (embedded devices, compact tokens, legacy field widths). If none of those apply, SHA-256 offers broader ecosystem support. The SHA-224 vs SHA-256 guide walks through the decision.