|
Posted by James Hess on December 30, 2007, 11:07 am
If you were Registered and logged in, you could reply and use other advanced thread options Randell_D wrote:
> I've always led the belief that if something can be created/built,
> then it can be "uncreated/unbuilt". In technology this is sometimes
> referred to as reverse-engineering. I understand too how hashing can
> be used within programs and fast database lookups but I failed
> miserably discussing the subject of hashes with someone who could not
> understand when I told them that you cannot reverse the process... I
> know you can crudely hack it (using John the Ripper for example) but
> you cannot "uncompress it" so to speak.
>
> So... my question here to you good people is... why can't a hash be...
> well... unhashed?
Take one of the simpler types of hashes, it will make a better example.
Say you have a database key you want to map to values
A common technique is to take the ASCII value of the first character...
this is an 8-bit hash.
for example let's add the word 'Pie' to our hash table, since P has ASCII
value 0x50, our hash function says "Pie" = 0x50
HashTable[0x50] = { :Pie => "blah blah " }
The key 'Apple' hashes to 0x41, so
HashTable[0x40] = { :Apple => "blah blah" }
Then we have the key "Pineapple" which also hashes to 0x50.
So we add that to our database....
HashTable[0x50] = { :Pie => "blah blah", :Pineapple => "blah blah" }
Note that We cannot examine "0x50" and know what we were looking for.
Since the database key is 24 bits, 72 bits, or even of variable length,
and our hash function has a much smaller range of outputs.
The only way we have of constructing a function to 'reverse' the hash
is to have some knowledge of what possible values might have been hashed.
This hash is clearly not suitable for cryptographic use, because there
are so few bits, and it's trivial to find something that hashes to 0x50
other than our desired input.
--
-Jimmy
|