Hash
/hæʃ/ · Noun · Verb · Security & Infosec
Definitions
A fixed-size output produced by a hash function from arbitrary input data. Cryptographic hashes are one-way (irreversible), deterministic, and collision-resistant, used for password storage, file integrity, and digital signatures.
In plain English: A digital fingerprint created from any piece of data — always the same length, and even a tiny change in the input creates a completely different fingerprint.
Hash tables (hash maps, dictionaries) use hash functions internally to achieve O(1) average-case lookups — the fundamental data structure powering Python dicts, JavaScript objects, and database indexes. Understanding hash collisions and load factors is essential for system design interviews.
Example: 'The password isn't stored in plain text — it's hashed with bcrypt using a random salt. Even if the database is breached, the passwords can't be reversed.'
Source: data structure usage
Etymology
- 1953
- Hans Peter Luhn at IBM files a patent for hash tables, using the metaphor of chopping and mixing (like hashing food)
- 1991
- Ron Rivest publishes MD5, making cryptographic hashing mainstream for password storage and file integrity
- 2004
- Researchers find MD5 collisions, beginning a decade-long migration to SHA-256 and beyond
Origin Story
Chopping data into fixed-size pieces, like a chef with a cleaver
The word **hash** in computing comes from the culinary term: to *hash* means to chop and mix food into small, uniform pieces — think corned beef hash. A **hash function** does the same to data: it takes input of any size and chops it down to a fixed-size output (the hash value or digest).
The concept of hash functions dates to the 1950s, with Hans Peter Luhn at IBM credited with early work on hashing for data retrieval. The term "hash" for this operation appears in computing literature by the early 1960s. The key property is that the same input always produces the same output, but you can't reconstruct the input from the output (for cryptographic hashes).
Today, hashes are everywhere: password storage, data integrity verification, Git commit IDs, blockchain blocks, hash tables in virtually every programming language, and digital signatures. The humble act of chopping data into fixed-size pieces turned out to be one of the most fundamental operations in all of computer science.
Coined by: Hans Peter Luhn (early work); computing community
Context: IBM, 1950s
Fun fact: Git's entire architecture is built on SHA-1 hashes. Every file, every commit, every tree object is identified by its hash. Linus Torvalds chose SHA-1 not for security but for data integrity — which became ironic when SHA-1 was broken in 2017, prompting Git's gradual migration to SHA-256.