Preimage Resistance
1 min read
Pronunciation
[pree-im-ij ri-zis-tuhns]
Analogy
Imagine you have a specific paint color (the hash output). Preimage resistance means it's practically impossible to figure out the exact original combination of paints (the input message) that were mixed to create that specific target color, even if you can try mixing paints yourself.
Definition
Key Points Intro
Preimage resistance ensures that a hash value does not reveal the original input.
Key Points
Given a hash value h, it should be computationally hard to find any input m such that H(m) = h.
This is the property that makes hash functions 'one-way'.
Crucial for password hashing; if an attacker gets a hashed password, they shouldn't be able to find the original password.
The difficulty of finding a preimage is typically around 2^n operations for an n-bit hash function.
Example
When a system stores password hashes, preimage resistance prevents an attacker who obtains the list of hashes from easily reversing them to find the actual passwords.
Technical Deep Dive
Preimage resistance means that for a hash function H, given an output y, it is computationally infeasible to find an input x such that H(x) = y. A brute-force attack would involve trying all possible inputs until one produces the target hash. For an n-bit hash function, this would take on average 2^n attempts, which is infeasible for typical cryptographic hash sizes (e.g., 2^256 for SHA-256).
Caveat
While theoretically strong, if the input space for the message 'm' is small (e.g., common passwords), an attacker might be able to find a preimage by hashing all possible inputs in that small space (dictionary attack), even if the hash function itself is preimage resistant against general inputs.
Preimage Resistance - Related Articles
No related articles for this term.