4 ms·
Imagine you're storing a four-digit PIN (or even 10-digit phone numbers in the U.S.) and you decide to hash them with SHA256 because security. The key space --
by jlgaddis 9y ago
Imagine you're storing a four-digit PIN (or even 10-digit phone numbers in the U.S.) and you decide to hash them with SHA256 because security.
The key space -- the total number of all possible PINs -- is really small; there are only 10,000 of them. One could simply "pre-compute" the SHA256 hashes of all 10,000 possible PINs and store them in a table.
When you receive a hashed value, it's really simple -- and, more importantly, very fast -- to just look up the hash in the table and get back the original PIN (a.k.a. "inverting" it).
It's kinda the same thing as "rainbow tables", if you recall those.