且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何从哈希值中获取原始值?

更新时间:2023-01-22 20:51:43

否.这通常是重点-哈希处理通常是单向的.

No. That's usually the point -- the process of hashing is normally one-way.

这对于为密码或密码设计的哈希特别重要-与设计为哈希(例如,哈希映射)的哈希不同.同样,在输入长度不受限制的情况下,将产生无限数量的值,从而导致相同的哈希值.

This is especially important for hashes designed for passwords or cryptology -- which differ from hashes designed, for say, hash-maps. Also, with an unbounded input length, there is an infinite amount of values which result in the same hash.

可以使用的一种方法是散列一堆值(例如,来自aaaaaaaa-zzzzzzz的蛮力)并查看哪个值具有相同的散列.如果找到了这个,您就找到了价值"(时间并不便宜). 彩虹表"适用于此想法(但使用空间而不是时间),但被诺斯盐击败.

One method that can be used is to hash a bunch of values (e.g. brute-force from aaaaaaaa-zzzzzzz) and see which value has the same hash. If you have found this, you have found "the value" (the time is not cheap). "Rainbow tables" work on this idea (but use space instead of time), but are defeated with a nonce salt.