From Wikipedia, the free encyclopedia
  (Redirected from SHA-384)
Jump to: navigation, search
Designers National Security Agency
First published 2001
Certification FIPS PUB 180-4, CRYPTREC, NESSIE
Digest sizes 224, 256, 384, or 512 bits
Structure Merkle–Damgård construction
Rounds 64 or 80
Best public cryptanalysis


Pseudo collision attack against up to 46 rounds of SHA-256.[2]


SHA-256 and SHA-512 are novel hash functions computed with 32-bit and 64-bit words, respectively. They use different shift amounts and additive constants, but their structures are otherwise virtually identical, differing only in the number of rounds. SHA-224 and SHA-384 are simply truncated versions of the first two, computed with different initial values. SHA-512/224 and SHA-512/256 are also truncated versions of SHA-512, but the initial values are generated using the method described in FIPS PUB 180-4. The SHA-2 family of algorithms are patented in US 6829355 . The United States has released the patent under a royalty-free license.[3]

In 2005, security flaws were identified in SHA-1, namely that a mathematical weakness might exist, indicating that a stronger hash function would be desirable.[4] Although SHA-2 bears some similarity to the SHA-1 algorithm, these attacks have not been successfully extended to SHA-2.

Currently, the best public attacks break preimage resistance 52 rounds of SHA-256 or 57 rounds of SHA-512, and collision resistance for 46 rounds of SHA-256, as shown in the "Cryptanalysis and Validation" section below.[1][2]

Hash standard[edit]

\operatorname{Ch}(E,F,G) = (E \and F) \oplus (\neg E \and G) \operatorname{Ma}(A,B,C) = (A \and B) \oplus (A \and C) \oplus (B \and C) \Sigma_0(A) = (A\!\ggg\!2) \oplus (A\!\ggg\!13) \oplus (A\!\ggg\!22) \Sigma_1(E) = (E\!\ggg\!6) \oplus (E\!\ggg\!11) \oplus (E\!\ggg\!25)
The bitwise rotation uses different constants for SHA-512. The given numbers are for SHA-256. The red \color{red}\boxplus is addition modulo 232.



In February 2004, a change notice was published for FIPS PUB 180-2, specifying an additional variant, SHA-224, defined to match the key length of two-key Triple DES.[6] In October 2008, the standard was updated in FIPS PUB 180-3, including SHA-224 from the change notice, but otherwise making no fundamental changes to the standard. The primary motivation for updating the standard was relocating security information about the hash algorithms and recommendations for their use to Special Publications 800-107 and 800-57.[7][8][9] Detailed test data and example message digests were also removed from the standard, and provided as separate documents.[10]



In July 2012, NIST revised SP800-57, which provides guidance for cryptographic key management. The publication disallows creation of digital signatures with a hash security lower than 112-bits after 2013. The previous revision from 2007 specified the cutoff to be the end of 2010.[9] In August 2012, NIST revised SP800-107 in the same manner.[8]

The NIST hash function competition selected a new hash function, SHA-3, in 2012.[13] The SHA-3 algorithm is not derived from SHA-2.

Comparison of SHA functions[edit]


Further information: Merkle–Damgård construction
Algorithm and
MD5 (as reference) 128 128
SHA-0 160 160
SHA-1 160 160
512 264 − 1 80 add mod 232, and, or, xor, rot <80 (theoretical attack[15] in 261) 192
SHA-2 SHA-224
SHA-3 SHA3-224
d (arbitrary)
d (arbitrary)
24 and, xor, not, rot 112
min(d/2, 128)
min(d/2, 256)



CPU Architecture Frequency Algorithm Word size (bits) Cycles/Byte x86 MiB/s x86 Cycles/Byte x86-64 MiB/s x86-64
SHA-512 64-bit 43.66 76 8.48 394
SHA-512 64-bit 88.36 41 12.43 292


Testing was performed by the University of Illinois at Chicago on their hydra8 system running an Intel Xeon E3-1275 V2 at a clock speed of 3.5 GHz, and on their hydra9 system running an AMD A10-5800K at a clock speed of 3.8 GHz.[16] The referenced cycles per byte speeds above are the median performance of an algorithm digesting a 4096 byte message using the SUPERCOP cryptographic benchmarking software.[17] The MiB/s performance is extrapolated from the CPU clockspeed on a single core, real world performance will vary due to a variety of factors.





Several cryptocurrencies use SHA-2 as part of their proof-of-work scheme. The rise of ASIC SHA-2 accelerator chips has led to the use of scrypt-based proof-of-work schemes.


The SHA-2 functions are not as widely used as SHA-1, despite their better security. Reasons might include lack of support for SHA-2 on systems running Windows XP SP2 or older,[24] or a lack of perceived urgency since SHA-1 collisions have not yet been found.

Cryptanalysis and validation[edit]




Increased interest in cryptographic hash analysis during the SHA-3 competition produced several new attacks on the SHA-2 family, the best of which are given in the table below. Only the collision attacks are of practical complexity; none of the attacks extend to the full round hash function. At FSE 2012, researchers at Sony gave a presentation suggesting pseudo collision attacks could be extended to 52 rounds on SHA-256 and 57 rounds on SHA-512 by building upon the biclique pseudo preimage attack.[26]

Published in Year Attack Method Attack Variant Rounds Complexity
New Collision attacks Against
Up To 24-step SHA-2 [27]
2008 Deterministic Collision SHA-256 24/64 228.5
SHA-512 24/80 232.5
Preimages for step-reduced SHA-2 [28] 2009 Meet-in-the-middle Preimage SHA-256 42/64 2251.7
43/64 2254.9
SHA-512 42/80 2502.3
46/80 2511.5
Advanced meet-in-the-middle
preimage attacks [29]
SHA-512 42/80 2494.6
Higher-Order Differential Attack
on Reduced SHA-256 [2]
2011 Differential Pseudo Collision SHA-256 46/64 2178
46/64 246
Bicliques for Preimages: Attacks on
Skein-512 and the SHA-2 family [1]
2011 Biclique Preimage SHA-256 45/64 2255.5
SHA-512 50/80 2511.5
Pseudo Preimage SHA-256 52/64 2255
SHA-512 57/80 2511

Official validation[edit]



Examples of SHA-2 variants[edit]

Hash values of empty string.

0x d14a028c2a3a2bc9476102bb288234c415a2b01f828ea62ac5b3e42f
0x e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
0x 38b060a751ac96384cd9327eb1b1e36a21fdb71114be07434c0cc7bf63f6e1da274edebfe76f65fbd51ad2f14898b95b
0x cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e
0x 6ed0dd02806fa89e25de060c19d3ac86cabb87d6a0ddd05c333b84f4
0x c672b8d1ef56ed28ab87c3622c5114069bdd3ad7b8f9737498d0c01ecef0967a


0x 730e109bd7a8a32b1cb9d9a09aa2325d2430587ddbc0c38bad911525
0x 619cba8e8e05826e9b8c519c0a5c68f4fb653e8a3d8aa04bb2c8cd4c




Initialize hash values:
h0 := 0x6a09e667
h1 := 0xbb67ae85
h2 := 0x3c6ef372
h3 := 0xa54ff53a
h4 := 0x510e527f
h5 := 0x9b05688c
h6 := 0x1f83d9ab
h7 := 0x5be0cd19

Initialize array of round constants:
k[0..63] :=

append the bit '1' to the message
    length (modulo 512 in bits) is 448.

Process the message in successive 512-bit chunks:
break message into 512-bit chunks
for each chunk

    for i from 16 to 63

    Initialize working variables to current hash value:
    a := h0
    b := h1
    c := h2
    d := h3
    e := h4
    f := h5
    g := h6
    h := h7

    Compression function main loop:
    for i from 0 to 63
        temp2 := S0 + maj
        h := g
        g := f
        f := e
        e := d + temp1
        d := c
        c := b
        b := a
        a := temp1 + temp2

    Add the compressed chunk to the current hash value:
    h0 := h0 + a
    h1 := h1 + b
    h2 := h2 + c
    h3 := h3 + d
    h4 := h4 + e
    h5 := h5 + f
    h6 := h6 + g
    h7 := h7 + h

Produce the final hash value (big-endian):



  • the initial hash values h0 through h7 are different, and
  • the output is constructed by omitting h7.
SHA-224 initial hash values (in big endian):
h[0..7] :=


  • the message is broken into 1024-bit chunks,
  • there are 80 rounds instead of 64,
  • the word size used for calculations is 64 bits long,
  • the shift and rotate amounts used are different.

           0x510e527fade682d1, 0x9b05688c2b3e6c1f, 0x1f83d9abfb41bd6b, 0x5be0cd19137e2179

SHA-512 round constants:

              0x59f111f1b605d019, 0x923f82a4af194f9b, 0xab1c5ed5da6d8118, 0xd807aa98a3030242, 0x12835b0145706fbe, 
              0x243185be4ee4b28c, 0x550c7dc3d5ffb4e2, 0x72be5d74f27b896f, 0x80deb1fe3b1696b1, 0x9bdc06a725c71235, 
              0xc19bf174cf692694, 0xe49b69c19ef14ad2, 0xefbe4786384f25e3, 0x0fc19dc68b8cd5b5, 0x240ca1cc77ac9c65, 
              0x2de92c6f592b0275, 0x4a7484aa6ea6e483, 0x5cb0a9dcbd41fbd4, 0x76f988da831153b5, 0x983e5152ee66dfab, 
              0xa831c66d2db43210, 0xb00327c898fb213f, 0xbf597fc7beef0ee4, 0xc6e00bf33da88fc2, 0xd5a79147930aa725, 
              0x06ca6351e003826f, 0x142929670a0e6e70, 0x27b70a8546d22ffc, 0x2e1b21385c26c926, 0x4d2c6dfc5ac42aed, 
              0x53380d139d95b3df, 0x650a73548baf63de, 0x766a0abb3c77b2a8, 0x81c2c92e47edaee6, 0x92722c851482353b, 
              0xa2bfe8a14cf10364, 0xa81a664bbc423001, 0xc24b8b70d0f89791, 0xc76c51a30654be30, 0xd192e819d6ef5218, 
              0xd69906245565a910, 0xf40e35855771202a, 0x106aa07032bbd1b8, 0x19a4c116b8d2d0c8, 0x1e376c085141ab53, 
              0x2748774cdf8eeb99, 0x34b0bcb5e19b48a8, 0x391c0cb3c5c95a63, 0x4ed8aa4ae3418acb, 0x5b9cca4f7763e373, 
              0x682e6ff3d6b2b8a3, 0x748f82ee5defb2fc, 0x78a5636f43172f60, 0x84c87814a1f0ab72, 0x8cc702081a6439ec, 
              0x90befffa23631e28, 0xa4506cebde82bde9, 0xbef9a3f7b2c67915, 0xc67178f2e372532b, 0xca273eceea26619c, 
              0xd186b8c721c0c207, 0xeada7dd6cde0eb1e, 0xf57d4f7fee6ed178, 0x06f067aa72176fba, 0x0a637dc5a2c898a6, 
              0x113f9804bef90dae, 0x1b710b35131c471b, 0x28db77f523047d84, 0x32caab7b40c72493, 0x3c9ebe0a15c9bebc, 
              0x431d67c49c100d4c, 0x4cc5d4becb3e42b6, 0x597f299cfc657e2a, 0x5fcb6fab3ad6faec, 0x6c44198c4a475817]

SHA-512 Sum & Sigma:




  • the output is constructed by omitting h6 and h7.

           0x67332667ffc00b31, 0x8eb44a8768581511, 0xdb0c2e0d64f98fa7, 0x47b5481dbefa4fa4


  • t values 224 and 256 are especially mentioned as approved.


See also[edit]


  1. ^ a b c Dmitry Khovratovich, Christian Rechberger and Alexandra Savelieva (2011). "Bicliques for Preimages: Attacks on Skein-512 and the SHA-2 family". IACR Cryptology ePrint Archive. 2011:286. 
  2. ^ a b c Mario Lamberger and Florian Mendel (2011). "Higher-Order Differential Attack on Reduced SHA-256". IACR Cryptology ePrint Archive. 2011:37. 
  3. ^ Licensing Declaration for US patent 6829355.. Retrieved 2008-02-17. 
  6. ^ FIPS 180-2 with Change Notice 1
  8. ^ a b FIPS SP 800-107 Recommendation for Applications Using Approved Hash Algorithms
  10. ^ NIST Algorithm Examples, Secure Hashing
  13. ^ a b NIST Selects Winner of Secure Hash Algorithm (SHA-3) Competition
  16. ^ SUPERCOP Benchmarks Measurements of hash functions, indexed by machine
  17. ^ SUPERCOP Benchmarking Toolkit
  18. ^ "Debian codebase in Google Code". Google. Retrieved 2011-11-08. [dead link]
  20. ^ RFC 5702,
  23. ^ "Secure Hashing - NIST Computer Security Division - Computer Security Resource Center". NIST. Retrieved 2010-11-25. 
  24. ^ Microsoft Corporation,Overview of Windows XP Service Pack 3
  27. ^ Somitra Kumar Sanadhya and Palash Sarkar (2008). "New Collision attacks Against Up To 24-step SHA-2". IACR Cryptology ePrint Archive. 2008:270. 
  28. ^ Kazumaro Aoki, Jian Guo, Krystian Matusiewicz, Yu Sasaki, and Lei Wang (2009). "Preimages for step-reduced SHA-2". Advances in Cryptology - ASIACRYPT 2009. Lecture Notes in Computer Science (Springer Berlin Heidelberg) 5912: 578–597. doi:10.1007/978-3-642-10366-7_34. ISBN 978-3-642-10366-7. ISSN 0302-9743. 
  29. ^ Jian Guo, San Ling, Christian Rechberger, and Huaxiong Wang (2010). "Advanced meet-in-the-middle preimage attacks: First results on full Tiger, and improved results on MD4 and SHA-2". Advances in Cryptology - ASIACRYPT 2010. Lecture Notes in Computer Science (Springer Berlin Heidelberg) 6477: 56–75. doi:10.1007/978-3-642-17373-8_4. ISBN 978-3-642-17373-8. ISSN 0302-9743. 


External links[edit]