SHA-512 (Secure Hash Algorithm 512-bit) is part of the SHA-2 family, published by NIST in 2001. It produces a 512-bit (128 hex character) digest — the longest standard output in the SHA-2 family — from any input of any length.
SHA-512 operates natively on 64-bit words, making it particularly efficient on modern 64-bit processors. Despite its larger output, SHA-512 is often faster than SHA-256 on 64-bit hardware because it processes 1024-bit blocks in 80 rounds rather than 512-bit blocks in 64 rounds — processing twice as much data per compression call.
/etc/shadow)SHA-512 extends the Merkle–Damgård construction used by SHA-256 to 64-bit arithmetic:
| Property | SHA-256 | SHA-512 |
|---|---|---|
| Word size | 32-bit | 64-bit |
| Block size | 512-bit | 1024-bit |
| Rounds per block | 64 | 80 |
| State size | 256-bit | 512-bit |
| Round constants | 64 | 80 |
| Output | 64 hex chars | 128 hex chars |
NIST also defines SHA-512/256 and SHA-512/224 — they run the full SHA-512 algorithm with different initialisation constants and truncate the output to 256 or 224 bits. These give you SHA-512's speed advantage on 64-bit hardware with a shorter output. They are immune to length-extension attacks by design.
| Algorithm | Output | Security | Common Uses |
|---|---|---|---|
| SHA-1 | 160-bit / 40 chars | ❌ Deprecated | Legacy systems, Git (legacy) |
| SHA-256 | 256-bit / 64 chars | ✅ Current standard | TLS, JWT, Bitcoin, passwords |
| SHA-384 | 384-bit / 96 chars | ✅ High security | TLS 1.3 cipher suites |
| SHA-512 (this tool) | 512-bit / 128 chars | ✅ Highest in SHA-2 | High-security signatures |
Is SHA-512 more secure than SHA-256?
Both are computationally secure against all known attacks. SHA-512 provides a larger security margin (256-bit collision resistance vs 128-bit for SHA-256), which is relevant for very long-term keys or high-value targets. For most applications, SHA-256 is sufficient.
Why is SHA-512 sometimes faster than SHA-256?
On 64-bit CPUs, SHA-512's 64-bit word operations map directly to native registers. SHA-256 uses 32-bit words but still runs on 64-bit hardware without native advantage. Because SHA-512 processes 1024-bit blocks (twice as large), it makes half as many compression calls for the same input, offsetting the heavier per-round cost.
Can I reverse a SHA-512 hash?
No. SHA-512 is a one-way function. Reversing it would require on average 2²⁵⁶ operations — computationally infeasible with any foreseeable technology.
What is SHA-512-crypt?
SHA-512-crypt is a password hashing scheme (defined in crypt(3)) used in Linux /etc/shadow. It applies SHA-512 in a complex multi-round loop with a salt to resist precomputation. It is different from plain SHA-512 and produces a base-64 encoded output rather than a hex string.
Should I use SHA-512 or SHA-3?
SHA-3 (Keccak) is the NIST-standardised alternative with a fundamentally different construction (sponge function, not Merkle–Damgård). SHA-3 is immune to length-extension attacks natively and provides similar security levels. SHA-512 is more widely supported and faster on most hardware today. Both are considered secure.
This website may contain affiliate links. If you click on an affiliate link and make a purchase, we may receive a small commission at no additional cost to you.