History First Second Third
The Hitchhiker’s Guide to the SHA-3 Competition
Orr Dunkelman Computer Science Department University of Haifa
4 July, 2012
Orr Dunkelman The Hitchhiker’s Guide to the SHA-3 Competition 1/ 46
The Hitchhikers Guide to the SHA-3 Competition Orr Dunkelman - - PowerPoint PPT Presentation
History First Second Third The Hitchhikers Guide to the SHA-3 Competition Orr Dunkelman Computer Science Department University of Haifa 4 July, 2012 Orr Dunkelman The Hitchhikers Guide to the SHA-3 Competition 1/ 46 History First
History First Second Third
Orr Dunkelman The Hitchhiker’s Guide to the SHA-3 Competition 1/ 46
History First Second Third
Orr Dunkelman The Hitchhiker’s Guide to the SHA-3 Competition 2/ 46
History First Second Third HF MD5/SHA1 History
Orr Dunkelman The Hitchhiker’s Guide to the SHA-3 Competition 3/ 46
History First Second Third HF MD5/SHA1 History
Orr Dunkelman The Hitchhiker’s Guide to the SHA-3 Competition 4/ 46
History First Second Third HF MD5/SHA1 History
◮ (Cryptographic) Hash Functions are means to securely
Orr Dunkelman The Hitchhiker’s Guide to the SHA-3 Competition 5/ 46
History First Second Third HF MD5/SHA1 History
◮ (Cryptographic) Hash Functions are means to securely
Orr Dunkelman The Hitchhiker’s Guide to the SHA-3 Competition 5/ 46
History First Second Third HF MD5/SHA1 History
◮ (Cryptographic) Hash Functions are means to securely
Orr Dunkelman The Hitchhiker’s Guide to the SHA-3 Competition 5/ 46
History First Second Third HF MD5/SHA1 History
◮ The main problem is the definition of securely. ◮ For signature schemes, two basic requirements exist: 1 Second preimage resistance: given x, it is hard to find x′
2 Collision resistance: it is hard to find x1, x2 s.t.
Orr Dunkelman The Hitchhiker’s Guide to the SHA-3 Competition 6/ 46
History First Second Third HF MD5/SHA1 History
◮ The main problem is the definition of securely. ◮ For signature schemes, three basic requirements exist: 1 Preimage resistance: given y = h(x), it is hard to find x
2 Second preimage resistance: given x, it is hard to find x′
3 Collision resistance: it is hard to find x1, x2 s.t.
Orr Dunkelman The Hitchhiker’s Guide to the SHA-3 Competition 6/ 46
History First Second Third HF MD5/SHA1 History
◮ Hash functions were quickly adopted in other places:
◮ Password files (storing h(pwd, salt) instead of pwd). ◮ Bit commitments schemes (commit — h(b, r), reveal —
◮ Key derivation functions (take k = h(gxy mod p)). ◮ MACs (long story). ◮ Tags of files (to detect changes). ◮ Inside PRNGs. ◮ Inside protocols (used in many “imaginative” ways). ◮ . . . Orr Dunkelman The Hitchhiker’s Guide to the SHA-3 Competition 7/ 46
History First Second Third HF MD5/SHA1 History
The Hitch Hiker’s Guide to the Galaxy has a few things to say on the subject of hash functions. A hash function, it says, is about the most massively useful thing a cryptographer can have. Partly it has great practical value — you can use it to replace random oracles in real protocols when you need them; you can use them to make signatures faster; you can use it along with salts to have better password files; you can commit to bits using it; you can derive keys using it; produce pseudo random numbers using it; authenticate data with it, and of course, just hash the data when you need a digest. More importantly, a hash function has immense psychological value. For some reason, if a strag (strag: non-cryptographer) discovers that a cryptographer has his hash function with him, he will automatically assume that he is also in possession of a symmetric-key encryption, a public-key encryption, a voting protocol, a zero-knowledge protocol, etc.
cryptographer any of these or a dozen other protocols that the cryptographer is too “busy” do himself. What the strag will think is that any cryptographer who can design protocols, follow bits, avoid differentials, and SAT solvers, and still knows where his hash function is is clearly a man to be reckoned with.
Orr Dunkelman The Hitchhiker’s Guide to the SHA-3 Competition 8/ 46
History First Second Third HF MD5/SHA1 History
◮ Started with Rivest’s MD4. ◮ Following a few cryptanalytic attempts, was upgraded to
◮ MD5, also known to many as md5sum generate tags of
◮ Became very popular given its high speed, alleged
◮ Later, it was used as the basis for the SHA-0 and SHA-1
Orr Dunkelman The Hitchhiker’s Guide to the SHA-3 Competition 9/ 46
History First Second Third HF MD5/SHA1 History
◮ To hash a message M the following steps are performed: 1 M is padded with ‘1’ as many 0’s as needed (up to 512)
2 pad(M) is divided into ℓ blocks of 512 bits, i.e.,
3 The 128-bit chaining value h0 is initialized. 4 For i = 1, 2, . . . , ℓ, hi = H(hi−1, mi) (the compression
5 The output is hℓ
i 3 2 1 Orr Dunkelman The Hitchhiker’s Guide to the SHA-3 Competition 10/ 46
History First Second Third HF MD5/SHA1 History
◮ The internal state (chaining value) of MD5, is treated as
◮ The initial value h0 is:
Orr Dunkelman The Hitchhiker’s Guide to the SHA-3 Competition 11/ 46
History First Second Third HF MD5/SHA1 History
◮ Let hi−1 = (A0, B0, C0, D0). ◮ Let the message block be Mi = (W0, W1, . . . , W15) ◮ For i = 0, 1, . . . , 63: 1 Di+1 ← Ci 2 Ci+1 ← Bi 3 Bi+1 ← Bi + (Ai + Fi(Bi, Ci, Di) + Ki + Wg(i)) ≪ si 4 Ai+1 ← Di ◮ hi ← (A0 + A64, B0 + B64, C0 + C64, D0 + D64).
Orr Dunkelman The Hitchhiker’s Guide to the SHA-3 Competition 12/ 46
History First Second Third HF MD5/SHA1 History
A0 B0 C0 D0
K1
W1
f1
≪ s1
Ki
Wi
fi
≪ si
Feed Forward
Orr Dunkelman The Hitchhiker’s Guide to the SHA-3 Competition 13/ 46
History First Second Third HF MD5/SHA1 History
◮ Each round, a different message word is used, a different
Orr Dunkelman The Hitchhiker’s Guide to the SHA-3 Competition 14/ 46
History First Second Third HF MD5/SHA1 History
Orr Dunkelman The Hitchhiker’s Guide to the SHA-3 Competition 15/ 46
History First Second Third HF MD5/SHA1 History
◮ First of all, these hash functions are Merkle-Damg˚
Orr Dunkelman The Hitchhiker’s Guide to the SHA-3 Competition 16/ 46
History First Second Third HF MD5/SHA1 History
◮ First of all, these hash functions are Merkle-Damg˚
◮ Most of the nonlinearity is introduced either in addition or
Orr Dunkelman The Hitchhiker’s Guide to the SHA-3 Competition 16/ 46
History First Second Third HF MD5/SHA1 History
◮ First of all, these hash functions are Merkle-Damg˚
◮ Most of the nonlinearity is introduced either in addition or
◮ An immediate consequence — easy to approximate the
Orr Dunkelman The Hitchhiker’s Guide to the SHA-3 Competition 16/ 46
History First Second Third HF MD5/SHA1 History
◮ First of all, these hash functions are Merkle-Damg˚
◮ Most of the nonlinearity is introduced either in addition or
◮ An immediate consequence — easy to approximate the
◮ Easy to define the conditions when the approximation
Orr Dunkelman The Hitchhiker’s Guide to the SHA-3 Competition 16/ 46
History First Second Third HF MD5/SHA1 History
◮ First of all, these hash functions are Merkle-Damg˚
◮ Most of the nonlinearity is introduced either in addition or
◮ An immediate consequence — easy to approximate the
◮ Easy to define the conditions when the approximation
◮ Along with a simple message expansion, relatively slow
∗multi-block collision, neutral bits, message modification, advance
Orr Dunkelman The Hitchhiker’s Guide to the SHA-3 Competition 16/ 46
History First Second Third HF MD5/SHA1 History
Orr Dunkelman The Hitchhiker’s Guide to the SHA-3 Competition 17/ 46
History First Second Third HF MD5/SHA1 History
Orr Dunkelman The Hitchhiker’s Guide to the SHA-3 Competition 18/ 46
History First Second Third HF MD5/SHA1 History
Orr Dunkelman The Hitchhiker’s Guide to the SHA-3 Competition 19/ 46
History First Second Third HF MD5/SHA1 History
Orr Dunkelman The Hitchhiker’s Guide to the SHA-3 Competition 20/ 46
History First Second Third HF MD5/SHA1 History
Orr Dunkelman The Hitchhiker’s Guide to the SHA-3 Competition 20/ 46
History First Second Third Timeline Candidates
Orr Dunkelman The Hitchhiker’s Guide to the SHA-3 Competition 21/ 46
History First Second Third Timeline Candidates
◮ January 2007: NIST announces that a SHA-3
◮ November 2007: NIST publishes the official rules of the
◮ August 2008: First submission deadline. ◮ October 2008: The real deadline.
Orr Dunkelman The Hitchhiker’s Guide to the SHA-3 Competition 22/ 46
History First Second Third Timeline Candidates
◮ January 2007: NIST announces that a SHA-3
◮ November 2007: NIST publishes the official rules of the
◮ August 2008: First submission deadline. ◮ October 2008: The real deadline. ◮ 64 candidates were submitted. ◮ NIST went over them, and identified 51 which satisfied a
Orr Dunkelman The Hitchhiker’s Guide to the SHA-3 Competition 22/ 46
History First Second Third Timeline Candidates
◮ January 2007: NIST announces that a SHA-3
◮ November 2007: NIST publishes the official rules of the
◮ August 2008: First submission deadline. ◮ October 2008: The real deadline. ◮ 64 candidates were submitted. ◮ NIST went over them, and identified 51 which satisfied a
Orr Dunkelman The Hitchhiker’s Guide to the SHA-3 Competition 22/ 46
History First Second Third Timeline Candidates
Orr Dunkelman The Hitchhiker’s Guide to the SHA-3 Competition 23/ 46
History First Second Third Timeline Candidates
◮ There is an ongoing debate what a broken hash function
Orr Dunkelman The Hitchhiker’s Guide to the SHA-3 Competition 24/ 46
History First Second Third Timeline Candidates
◮ There is an ongoing debate what a broken hash function
Orr Dunkelman The Hitchhiker’s Guide to the SHA-3 Competition 24/ 46
History First Second Third Timeline Candidates
◮ There is an ongoing debate what a broken hash function
1 Practical. 2 Close to Practical. 3 (Time, Memory) is better then for generic attacks (e.g.,
4 Time × Memory is less than required in generic attacks. 5 Money for finding {collision, second preimage, preimage}
Orr Dunkelman The Hitchhiker’s Guide to the SHA-3 Competition 24/ 46
History First Second Third Timeline Candidates
◮ At that point NIST had 27 broken submissions out of 51. ◮ They discarded the broken ones (24 left). ◮ MD6 was withdrawn (23 left).
Orr Dunkelman The Hitchhiker’s Guide to the SHA-3 Competition 25/ 46
History First Second Third Timeline Candidates
◮ At that point NIST had 27 broken submissions out of 51. ◮ They discarded the broken ones (24 left). ◮ MD6 was withdrawn (23 left). ◮ To further reduce the list of candidates to about 15, they
Orr Dunkelman The Hitchhiker’s Guide to the SHA-3 Competition 25/ 46
History First Second Third Timeline Candidates
◮ At that point NIST had 27 broken submissions out of 51. ◮ They discarded the broken ones (24 left). ◮ MD6 was withdrawn (23 left). ◮ To further reduce the list of candidates to about 15, they
◮ NIST allowed tweaks (small changes which do not
◮ And in July 2009 announced the second round candidates.
Orr Dunkelman The Hitchhiker’s Guide to the SHA-3 Competition 25/ 46
History First Second Third Candidates Process
Orr Dunkelman The Hitchhiker’s Guide to the SHA-3 Competition 26/ 46
History First Second Third Candidates Process
Orr Dunkelman The Hitchhiker’s Guide to the SHA-3 Competition 27/ 46
History First Second Third Candidates Process
◮ During the second round, all 14 candidates were analyzed. ◮ Hamsi was the only one that was (marginally) broken. ◮ Distinguishing properties were reported for the full
◮ These attacks do not scale to the full hash function (at
◮ Attacks on almost the full compression functions of
◮ JH and Blake were also analyzed.
Orr Dunkelman The Hitchhiker’s Guide to the SHA-3 Competition 28/ 46
History First Second Third Candidates Process
◮ During the second round, all 14 candidates were analyzed. ◮ Hamsi was the only one that was (marginally) broken. ◮ Distinguishing properties were reported for the full
◮ These attacks do not scale to the full hash function (at
◮ Attacks on almost the full compression functions of
◮ JH and Blake were also analyzed. ◮ Some primitives received less cryptanalytic attention.
Orr Dunkelman The Hitchhiker’s Guide to the SHA-3 Competition 28/ 46
History First Second Third Candidates Process
◮ Shabal was submitted with a security
Orr Dunkelman The Hitchhiker’s Guide to the SHA-3 Competition 29/ 46
History First Second Third Candidates Process
◮ Shabal was submitted with a security
◮ Shabal’s compression function can be
Orr Dunkelman The Hitchhiker’s Guide to the SHA-3 Competition 29/ 46
History First Second Third Candidates Process
◮ Shabal was submitted with a security
◮ Shabal’s compression function can be
◮ Shabal’s team fixed the proof.
Orr Dunkelman The Hitchhiker’s Guide to the SHA-3 Competition 29/ 46
History First Second Third Candidates Process
◮ Shabal was submitted with a security
◮ Shabal’s compression function can be
◮ Shabal’s team fixed the proof. ◮ A new distinguishing attack on Shabal⋆
Orr Dunkelman The Hitchhiker’s Guide to the SHA-3 Competition 29/ 46
History First Second Third Candidates Process
◮ Shabal was submitted with a security
◮ Shabal’s compression function can be
◮ Shabal’s team fixed the proof. ◮ A new distinguishing attack on Shabal⋆
◮ Luckily for Shabal — not so easy to
Orr Dunkelman The Hitchhiker’s Guide to the SHA-3 Competition 29/ 46
History First Second Third Candidates Process
Orr Dunkelman The Hitchhiker’s Guide to the SHA-3 Competition 30/ 46
History First Second Third Candidates Process
◮ You can easily distinguish between h(·) and a random
Orr Dunkelman The Hitchhiker’s Guide to the SHA-3 Competition 30/ 46
History First Second Third Candidates Process
◮ You can easily distinguish between h(·) and a random
Orr Dunkelman The Hitchhiker’s Guide to the SHA-3 Competition 30/ 46
History First Second Third Candidates Process
◮ You can easily distinguish between h(·) and a random
◮ You cannot find two inputs (a, b) that satisfy some
Orr Dunkelman The Hitchhiker’s Guide to the SHA-3 Competition 30/ 46
History First Second Third Candidates Process
◮ You can easily distinguish between h(·) and a random
◮ You cannot find two inputs (a, b) that satisfy some
Orr Dunkelman The Hitchhiker’s Guide to the SHA-3 Competition 30/ 46
History First Second Third Candidates Process
◮ You can easily distinguish between h(·) and a random
◮ You cannot find two inputs (a, b) that satisfy some
◮ Known-key distinguisher approach: It is possible to find a
Orr Dunkelman The Hitchhiker’s Guide to the SHA-3 Competition 30/ 46
History First Second Third Candidates Process
◮ You can easily distinguish between h(·) and a random
◮ You cannot find two inputs (a, b) that satisfy some
◮ Known-key distinguisher approach: It is possible to find a
◮ . . . and if you do not like this name, feel free to use:
Orr Dunkelman The Hitchhiker’s Guide to the SHA-3 Competition 30/ 46
History First Second Third Candidates Process
◮ Some teams had many people on them. Some not. ◮ All teams submitted C code, but not all submitted
◮ Some teams supply measurements using method A, some
◮ Some teams supply measurements on a machine type A,
◮ Some teams used compiler X, some Y, . . . ◮ Some teams had . . .
Orr Dunkelman The Hitchhiker’s Guide to the SHA-3 Competition 31/ 46
History First Second Third Candidates Process
◮ eBASH — An effort to run everything everywhere. 1 Strong points: lots of machines, easy to submit a new
2 Weak points: still someone needs to implement, takes
3 Measurement method can be “attacked”: submit a hash
◮ sphlib — An effort to implement everything by one guy
1 Strong point: portable code is sometimes important. 2 Weak points: based on a one-man show (who is actually
Orr Dunkelman The Hitchhiker’s Guide to the SHA-3 Competition 32/ 46
History First Second Third Candidates Process
Orr Dunkelman The Hitchhiker’s Guide to the SHA-3 Competition 33/ 46
History First Second Third Candidates Process
Orr Dunkelman The Hitchhiker’s Guide to the SHA-3 Competition 34/ 46
History First Second Third Candidates Process
◮ Less people working on hardware implementation. ◮ More optimization targets (throughput vs. size vs. energy
◮ More technologies (ASIC vs. FPGA). ◮ Less common to share the “code”.
Orr Dunkelman The Hitchhiker’s Guide to the SHA-3 Competition 35/ 46
History First Second Third Finalists Performance Security Outcome
Orr Dunkelman The Hitchhiker’s Guide to the SHA-3 Competition 36/ 46
History First Second Third Finalists Performance Security Outcome
Orr Dunkelman The Hitchhiker’s Guide to the SHA-3 Competition 37/ 46
History First Second Third Finalists Performance Security Outcome
1 BLAKE 2 Grøstl 3 JH 4 KECCAK 5 Skein
Orr Dunkelman The Hitchhiker’s Guide to the SHA-3 Competition 37/ 46
History First Second Third Finalists Performance Security Outcome
◮ Each of the five finalists has different design
◮ Narrow pipe (Haifa/UBI): BLAKE and Skein, ◮ Double pipe: Grøstl and JH, ◮ Sponge: KECCAK
◮ Each of them relies on different “security” mechanisms:
◮ ARX: BLAKE, KECCAK, and Skein, ◮ S-boxes: Grøstl and JH Orr Dunkelman The Hitchhiker’s Guide to the SHA-3 Competition 38/ 46
History First Second Third Finalists Performance Security Outcome
Orr Dunkelman The Hitchhiker’s Guide to the SHA-3 Competition 39/ 46
History First Second Third Finalists Performance Security Outcome
◮ 8-bit platforms are not as extinct as many people believe
◮ The new SHA-3 would need to run on these platforms as
◮ The XBX project aims at being the eBASH extension to
◮ In general, Blake, Skein, and KECCAK are leading in
Orr Dunkelman The Hitchhiker’s Guide to the SHA-3 Competition 40/ 46
History First Second Third Finalists Performance Security Outcome
◮ Of the 5 finalists, two have distinguishing properties for
1 KECCAK (a zero sum distinguisher, in time complexity
2 JH (a rebound distinguisher, in time complexity of 2304). ◮ While they somewhat invalidate the security proofs of JH
Orr Dunkelman The Hitchhiker’s Guide to the SHA-3 Competition 41/ 46
History First Second Third Finalists Performance Security Outcome
Orr Dunkelman The Hitchhiker’s Guide to the SHA-3 Competition 42/ 46
History First Second Third Finalists Performance Security Outcome
◮ Selecting something which offers less security than
◮ Selecting something much slower than SHA. ◮ If performance requirements much larger than SHA.
Orr Dunkelman The Hitchhiker’s Guide to the SHA-3 Competition 43/ 46
History First Second Third Finalists Performance Security Outcome
◮ Selecting something which offers less security than
◮ Selecting something much slower than SHA. ◮ If performance requirements much larger than SHA.
Orr Dunkelman The Hitchhiker’s Guide to the SHA-3 Competition 43/ 46
History First Second Third Finalists Performance Security Outcome
◮ SHA-3 took quite a lot of effort — analysis and
◮ Many cryptanalysts spent a lot of time designing their
◮ Then, they worked hard on breaking other SHA-3
Orr Dunkelman The Hitchhiker’s Guide to the SHA-3 Competition 44/ 46
History First Second Third Finalists Performance Security Outcome
◮ SHA-3 took quite a lot of effort — analysis and
◮ Many cryptanalysts spent a lot of time designing their
◮ Then, they worked hard on breaking other SHA-3
◮ Hence, little time to work on SHA-1/SHA-2 . . .
Orr Dunkelman The Hitchhiker’s Guide to the SHA-3 Competition 44/ 46
History First Second Third Finalists Performance Security Outcome
◮ SHA-3 took quite a lot of effort — analysis and
◮ Many cryptanalysts spent a lot of time designing their
◮ Then, they worked hard on breaking other SHA-3
◮ Hence, little time to work on SHA-1/SHA-2 . . . ◮ What if this is all a scheme to make cryptanalysts work
Orr Dunkelman The Hitchhiker’s Guide to the SHA-3 Competition 44/ 46
History First Second Third Finalists Performance Security Outcome
Orr Dunkelman The Hitchhiker’s Guide to the SHA-3 Competition 45/ 46
History First Second Third Finalists Performance Security Outcome
Orr Dunkelman The Hitchhiker’s Guide to the SHA-3 Competition 46/ 46