Quiz Entry - updated: 2026.07.14
What is a hash function in the most general sense, and what are the three types classified by security and key usage?
A hash function maps elements from a large (arbitrary-size) set to a small fixed-size set — like a funnel compressing data.
* Three families: a Type-1 checksum (no key, not secure), a Type-2 MAC (keyed, secure) and a Type-3 MDC (keyless, secure). *
Output sizes are typically: 128, 160, 224, 256, 384, or 512 bits.
The three types:
| Type | Key? | Crypto-Secure? | Name | Example |
|---|---|---|---|---|
| Type 1 | No | No | Checksum / check digit | ISBN, EAN, CRC |
| Type 2 | Yes | Yes | MAC (Message Authentication Code) | CBC-MAC, HMAC |
| Type 3 | No | Yes | MDC (Manipulation Detection Code) | SHA-2, SHA-3 |
Important naming note: MAC should really be called MIC (Message Integrity Code), since it provides integrity, not the full palette of authentication. The misnaming dates back to the 1970s when integrity and authenticity were conflated.
Go deeper:
Cryptographic hash function (Wikipedia) — properties, applications and the standard algorithm families.
Hashing Algorithms and Security (Computerphile) — an 11-minute intuition-builder for what a hash is and why it must be one-way.