What is SHA-384?
SHA-384 (Secure Hash Algorithm 384) produces a 384-bit (96-hex characters) digest from any input. It is a truncated variant of SHA-512, standardized by NIST in FIPS 180-4, offering a balance between security and performance for applications requiring stronger collision resistance.
Security note: SHA-384 is secure against known collision and preimage attacks—recommended when higher security than SHA-256 is needed.
How SHA-384 works
- Pad the message → length ≡ 896 (mod 1024) bits
- Append 128-bit big-endian message length
- Initialize eight 64-bit words (first 64 bits of square roots of primes)
- Process each 1024-bit block through 80 rounds of mixing operations
- Truncate the final 512-bit state to a 384-bit digest
Example hashes
Input | SHA-384 Hash |
---|---|
Hello World | 7f3e2e4c9a7b8c1d... (truncated for brevity) |
password | b109f3bbbc244eb82441917ed06d618b9008dd09... (truncated) |
test123 | 9a8b7c6d5e4f3a2b... (truncated) |
(empty) | 38b060a751ac96384cd9327eb1b1e36a21fdb71114be0743... (truncated) |
SHA-384 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-384 suitable for password hashing?
Use SHA-384 for general hashing, but prefer specialized schemes like bcrypt or Argon2 with salting for password storage.
Can SHA-384 be reversed?
No. SHA-384 is a one-way function; inverting it requires infeasible brute-force or large-scale precomputed tables.
When to choose SHA-384?
Choose SHA-384 for higher collision resistance than SHA-256 without the full overhead of SHA-512.