Template:Comparison of SHA functions

class="wikitable" style="margin-top: 0px; width:100%; text-align:center;"

|+ Comparison of SHA functions {{Navbar|Comparison of SHA functions|plain=1|style=float:right}}

style="vertical-align:bottom;"

! colspan="2" rowspan="2" | Algorithm and variant

! rowspan="2" | Output size
(bits)

! rowspan="2" | Internal
state size
(bits)

! rowspan="2" | Block size
(bits)

! rowspan="2" | Rounds

! rowspan="2" | Operations

! rowspan="2" | Security against collision attacks
(bits)

! rowspan="2" | Security against length extension attacks
(bits)

! colspan="2" | Performance on Skylake (median cpb){{cite web |url=http://bench.cr.yp.to/results-hash.html#amd64-skylake |title=Measurements table|website=bench.cr.yp.to}}

! rowspan="2" | First published

style="vertical-align:bottom;"

! Long messages

! 8 bytes

style="vertical-align:top;"

| colspan="2" | MD5 (as reference)

128128
{{nowrap|(4 × 32)}}
5124
{{nowrap |(16 operations}} in each round)
And, Xor, Or, Rot, {{nowrap|Add (mod 232)}}{{Bad|≤ 18
(collisions found){{Cite tech report|first1=Xie|last1=Tao|first2=Fanbao|last2=Liu|first3=Dengguo|last3=Feng|year=2013|title=Fast Collision Attack on MD5|work=Cryptology ePrint Archive|publisher=IACR|url=https://eprint.iacr.org/2013/170.pdf}}}}
{{Bad|0}}4.9955.001992
style="vertical-align:top;"

| colspan="2" | {{nowrap|SHA-0}}

rowspan="2" | 160rowspan="2" | 160
{{nowrap|(5 × 32)}}
rowspan="2" | 512rowspan="2" | 80rowspan="2" | And, Xor, Or, Rot, {{nowrap|Add (mod 232)}}{{Bad|< 34
(collisions found)}}
rowspan="2" {{Bad|0}}≈ SHA-1≈ SHA-11993
style="vertical-align:top;"

| colspan="2" | {{nowrap|SHA-1}}

{{Bad|< 63
(collisions found){{Cite tech report|last1=Stevens|first1=Marc|author-link1=Marc Stevens (cryptology)|last2=Bursztein|first2=Elie|author-link2=Elie Bursztein|last3=Karpman|first3=Pierre|last4=Albertini|first4=Ange|last5=Markov|first5=Yarik|title=The first collision for full SHA-1|publisher=Google Research|url=https://shattered.io/static/shattered.pdf}}

  • {{cite web |author=Marc Stevens |author2=Elie Bursztein |author3=Pierre Karpman |author4=Ange Albertini |author5=Yarik Markov |author6=Alex Petit Bianco |author7=Clement Baisse |date=February 23, 2017 |title=Announcing the first SHA1 collision |website=Google Security Blog |url=https://security.googleblog.com/2017/02/announcing-first-sha1-collision.html}}}}
3.4752.001995
style="vertical-align:top;"

| rowspan="4" | {{nowrap|SHA-2}}

SHA-224
SHA-256
224
256
256
{{nowrap|(8 × 32)}}
51264And, Xor, Or,
Rot, Shr, {{nowrap|Add (mod 232)}}
{{Good|112
128}}
{{Bad|32
0}}
7.62
7.63
84.50
85.25
2004
2001
style="vertical-align:top;"

| SHA-384

384rowspan="3" | 512
{{nowrap|(8 × 64)}}
rowspan="3" | 1024rowspan="3" | 80rowspan="3" | And, Xor, Or,
Rot, Shr, {{nowrap|Add (mod 264)}}
{{Good|192}}{{Good|{{nowrap|128}}}}5.12135.752001
style="vertical-align:top;"

| SHA-512

512{{Good|256}}{{Bad|0Without truncation, the full internal state of the hash function is known, regardless of collision resistance. If the output is truncated, the removed part of the state must be searched for and found before the hash function can be resumed, allowing the attack to proceed.}}5.06135.502001
style="vertical-align:top;"

| {{nowrap|SHA-512/224}}
{{nowrap|SHA-512/256}}

224
256
{{Good|112
128}}
{{Good|288
256}}
{{nowrap|≈ SHA-384}}{{nowrap|≈ SHA-384}}2012
style="vertical-align:top;"

| rowspan="2" | {{nowrap|SHA-3}}

SHA3-224
SHA3-256
SHA3-384
SHA3-512
224
256
384
512
rowspan="2" | 1600
{{nowrap|(5 × 5 × 64)}}
1152
1088
832
576
rowspan="2" | {{nowrap|24}}{{cite web|url=http://keccak.noekeon.org/specs_summary.html |title=The Keccak sponge function family |access-date=2016-01-27}}rowspan="2" | And, Xor, Rot, Not{{Good|112
128
192
256}}
{{Good|448
512
768
1024}}
8.12
8.59
11.06
15.88
154.25
155.50
164.00
164.00
rowspan="2" | 2015
style="vertical-align:top;"

| SHAKE128
SHAKE256

{{nowrap|d (arbitrary)}}
{{nowrap|d (arbitrary)}}
1344
1088
{{Good|min(d/2, 128)
{{nowrap|min(d/2, 256)}}}}
{{Good|{{nowrap|256
512}}}}
7.08
8.59
155.25
155.50

{{Template reference list}}

{{documentation

|content=

{{no documentation}}

Category:Computer security templates

}}