5 ms·
No, cryptographic hash has an additional property. It is one way. So, given a hash it is hard to derive original input. Collision resistance is a separate prop
by AstralStorm 10y ago
No, cryptographic hash has an additional property. It is one way. So, given a hash it is hard to derive original input.
Collision resistance is a separate property which can be fulfilled without one way property.
Maybe you want hash numbers that are not predictable by an attacker, but sip hash is not salted either. Plus salting does not require a cryptographic hash either.
- koverstreet 10y agoUh, what? Siphash isn't a cryptographic hash function. It's a keyed hash function designed not to leak the key.
- valarauca1 10y ago>It is one way. So, given a hash it is hard to derive original input. This is the definition of a Hash Function. Not a cryptographic Hash Function. Cryptographic Hashes should NEVER collide, on any inputs, ever, period. The moment it is found too, the algorithm is considered depreciated. This is why MD5 shouldn't be used anymore, there is a generalized algorithm for producing collisions. Cryptographic hashes are overkill for HashTables/HashMaps because you can't use 128/256/512bit address spaces unless your attempt to store all the information in the galaxy or observable universe. And modern computers just aren't there yet. Also they are very slow. So when your masking a 512bit output, down to 16bits of your HashTable you just lose the will never collide guarantee. Then something that operates at 10GB/s, and can collide sounds better then something that runs at 150MB/s and will still collide anyways.
- luchs 10y ago>This is the definition of a Hash Function. Not a cryptographic Hash Function. No, a hash function is just any function which can be used to put values into a hash map. If your inputs are numbers, modulo will work fine as a hash function, but is obviously not one-way. >Cryptographic Hashes should NEVER collide, on any inputs, ever, period. This is obviously not possible, as the output of the cryptographic hash function is of fixed-length while the input is variable-length. Finding collision just needs to be hard, not impossible.
- valarauca1 10y agomodulo will work fine as a hash function, but is obviously not one-way. Modulo is a one way trap door operation. Proof via arrogance: X % 100 = 50 Solve for X Solution X = F(n) where F(n) = 100*n+50 (for all n > 1) This does indeed meet the requirements of a hash functions. Modulu is a bad hash function because it is poorly distributed. Cryptographic Hashes should NEVER collide, on any inputs, ever, period. >This is obviously not possible NIPS says if you observe 2 inputs of a cryptographic hash which compute to the same digest the hash is considered depreciated. So yes my definition is correct. Obviously yes all cryptographic hashes aren't unique for every input. As they maybe N bytes long. And simply a logic will tell you there is more information in N bytes of data vs 64 bytes (512bits). The real issue is, prove it. Testing even the 512bit address space will take you longer then the heat death of the universe, so good luck!
- dgacmu 10y agoNo - per the definition of a trapdoor function: "For any k ∈ K, without trapdoor tk, for any PPT algorithm, the probability to correctly invert fk (i.e., given fk(x), find a pre-image x' such that fk(x' ) = fk(x)) is negligible" https://en.wikipedia.org/wiki/Trapdoor_function https://en.wikipedia.org/wiki/Trapdoor_function Note that the definition is about a pre-image, not necessarily the input used to create it in the first place. Second, that definition is absolutely not correct. "Never" would require that the size of the output of the hash function be equivalent to the size of the universe of possible inputs, which it obviously isn't. There's a very important difference between "never be observed in practice" and "never, period." You're not using the language precisely, and that's very dangerous when talking about hashing and cryptography.
- AstralStorm 10y agoPre-image is even simpler. A good cryptographic hash also prevents second pre-image attack e.g. pre-image based on multiple hashes. None of those properties is needed for indexing into hash table. Good collision resistance is all that is required and salting for more paranoid cases.
- deleted 10y ago[deleted]
- JohnStrange 10y agoAny hash function provably collides for at least two inputs, unless we're talking about perfect hashing. The only exception would be a hash function that does not compress, where the output is larger than the input. That's not a hash-function, though. > you just lose the will never collide guarantee There is no such guarantee, in fact, the opposite is guaranteed. It's just very unlikely that you get a collision - that's a desirable property of any hash function -, and it should be hard to create a collision because the function is hard to reverse - that's a desirable property of any cryptographic hash function, as the OP laid out.
- Ar-Curunir 10y agoCollision resistance implies onewayness for compressing hash functions. You can invert a hashed value, and if your inversion procedure is randomised, then there is a high probability that you'll end up with a different input.
- chias 10y ago> Collision resistance implies onewayness for compressing hash functions. No it doesn't. These are independent properties. That is, collision resistance does not imply onewayness, and onewayness does not imply collision resistance. Collision Resistance: it is hard to find x != x' such that h(x) = h(x') One Wayness: Given y, an n-bit string randomly chosen from the output space of h(), it is hard to find any x such that h(x) = y. Proof that CR does not imply OW: Suppose g() is collision resistant and outputs n bits. Define h(x) to be 0x if x is n bits long, otherwise 1x. Collisions are hard to find: if y starts with 1 there are no collisions, and if it starts with 0 then you'd need to find a collision in g(), which is collision resistant. h() is not one way: given a random y in the output space, with probability 1/2 it is trivial to find an x such that h(x) = y. Proof that OW does not imply CR: Suppose that g() is one-way. Define h(x) = g(x) with the last bit truncated. h() is one-way because you cannot invert h without inverting g(). h() is not collision resistant because for any x, h(x0) = h(x1)