Hash Functions
MD5 · SHA-1 · SHA-2 · SHA-3 and collisions
Loading slides…
Open the PDF file
Summary
The lecture explains what a hash function is, why collisions are unavoidable (pigeonhole principle), the three security requirements (first-preimage, second-preimage and collision resistance), the avalanche effect and the 2^(n/2) bound that follows from the birthday paradox. It then covers the Merkle–Damgård construction, how MD5 (2004) and SHA-1 (SHAttered, 2017) were broken, a SHA-256 round, the length-extension attack and SHA-3 (Keccak, sponge). It closes with applications (integrity, digital signatures, blockchain, passwords with salt, bcrypt, scrypt and Argon2id), Python practice with hashlib and a table of which hash to use when.
Key terms
MD5
SHA-1
SHA-256
SHA-3 / Keccak
to'qnashuv
tug'ilgan kun paradoksi
ko'chki effekti
Merkle-Damgård
SHAttered
uzunlikni kengaytirish
HMAC
Argon2id
Lecture outline
- What is a hash function? The general scheme
- The pigeonhole principle: collisions are inevitable
- The three security requirements
- The avalanche effect
- The birthday paradox and the 2^(n/2) bound
- The Merkle–Damgård construction and MD5
- SHA-1 and the SHAttered attack (2017)
- The SHA-2 family and a SHA-256 round
- The length-extension attack
- SHA-3 (Keccak): the sponge construction
- Applications: integrity, signatures, blockchain, passwords
- Python practice, recommendations and conclusions