Beginner Topic 17 of 51 Security & Cryptography
Hash Functions
Functions mapping data to fixed-size fingerprints.
How it works
A cryptographic hash function maps input of any size to a fixed-size digest and is designed to be one-way, so it is infeasible to find an input for a given hash, to find a second input with the same hash and to find any two inputs that collide. A tiny change in the input changes the output completely, the avalanche effect. Hashes are deterministic and fast, and they underpin integrity checks, signatures and many protocols.
Where it is used
File checksums, software download verification, digital signatures, Git object identifiers, blockchains, deduplication and password-hashing constructions use hash functions.
Common pitfall
Broken functions such as MD5 and SHA-1 should not be used for security because collisions can be created. Hashes are not encryption and cannot be reversed, but short or guessable inputs can be brute-forced. A plain hash does not authenticate the sender; use an HMAC. For passwords, use slow dedicated algorithms.
Where it fits in the course
Hash Functions is topic 17 of 51 in Security & Cryptography, rated Beginner. It follows RSA. The next topic is SHA Family.
Practice and explore
- Open the interactive lesson, with a mini quiz.
- Take the Security & Cryptography quiz.
- Explore the Hash Table visualizer: Hash function, buckets and chaining collisions.
How to study this topic
- Read the explanation above and restate the definition in your own words.
- Open the interactive lesson and answer its mini quiz.
- Read the common pitfall, then write a short example that avoids it.
- Check your understanding in the Security & Cryptography quiz, and revisit the topic if you miss a question.
Frequently asked questions
What is Hash Functions?
Where do people use Hash Functions?
What is the most common mistake with Hash Functions?
What should I learn before this topic?
How can I practice it?
Is Hash Functions hard to learn?
How long does it take to learn Hash Functions?
Which topics are related to Hash Functions?
What should I study after Hash Functions?
Related topics
- RSA (Security & Cryptography)
- SHA Family (Security & Cryptography)
- Asymmetric Encryption (Security & Cryptography)
- Digital Signatures (Security & Cryptography)
- Functions and Relations (Theory & Discrete Math)
- Functions and Graphs (Math for Computing)
- Hash Tables (Data Structures)