What is SHA-512?
SHA-512 (Secure Hash Algorithm 512) produces a 512-bit (128-hex characters) digest from any input. Part of the SHA-2 family standardized by NIST in 2001, it offers maximum collision resistance for high-security applications.
Security note: SHA-512 remains secure against all known collision and preimage attacks—ideal for critical systems and large data integrity.
How SHA-512 works
- Pad the message → length ≡ 896 (mod 1024) bits
- Append 128-bit big-endian length of original message
- Initialize eight 64-bit words (first 64 bits of square roots of primes)
- Process each 1024-bit block through 80 rounds of mixing operations
- Combine results to produce a 512-bit digest
Example Hashes
Input | SHA-512 Hash |
---|---|
Hello World | 2c74fd17edafd8... (truncated) |
password | b109f3bbbc244eb8244191... (truncated) |
test123 | 8e9f0a1b2c3d4e5f... (truncated) |
(empty) | cf83e1357eefb8b... (truncated) |
SHA-512 vs. Other Hash Functions
Algorithm | Output | Security | Speed |
---|---|---|---|
SHA-256 | 256 bits | ✅ Secure | 🚀 Moderate |
SHA-384 | 384 bits | ✅ Very secure | 🚀 Moderate |
SHA-512 | 512 bits | ✅ Very secure | 🚀 Slow |
Frequently Asked Questions
Is SHA-512 suitable for password hashing?
Use SHA-512 for general hashing tasks, but for passwords choose bcrypt, Argon2 or PBKDF2 with salting for optimal security.
Can SHA-512 be reversed?
No. SHA-512 is a one-way function; reversing it requires impractical brute-force or massive precomputed tables.
When to choose SHA-512?
Choose SHA-512 for maximum collision resistance and when processing large datasets where security is paramount.