-
-
Notifications
You must be signed in to change notification settings - Fork 179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add security tests #20
Comments
Thanks for being vocal about the "myths"! OTOH, I think that it'd be more constructive to balance out the sensationalism by mentioning the fact that MANY (most?) practical hash tables have restrictions on key size (e.g. 32 bytes) AND encoding (e.g. ascii), such that crypto/stronger hash functions like SipHash are indeed PRACTICALLY flood resistant (not really proof) to known attacks? The same cannot be said for most "weaker" hash functions. |
SipHash has nothing to do with flood resistance. It's only about seed
hiding, nothing else. Flood resistance can ONLY be done by a different
collision resolution scheme.
Am 03.01.2017 9:54 vorm. schrieb "vicaya" <[email protected]>:
… Thanks for being vocal about the "myths"! OTOH, I think that it'd be more
constructive to balance out the sensationalism by mentioning the fact that
MANY (most?) practical hash tables have restrictions on key size (e.g. 32
bytes) AND encoding (e.g. ascii), such that crypto/stronger hash functions
like SipHash are indeed PRACTICALLY flood resistant (not really proof) to
known attacks? The same cannot be said for most "weaker" hash functions.
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
<#20 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AACjUd0WFXo29wwF1c6yUb-pf-36pKCHks5rOgyzgaJpZM4K-Hxe>
.
|
"Flood resistance" is indeed not a precise term. Stronger/crypto hash is all about seed/secret/salt hiding, which, along with further restrictions (valid key size and encoding) dramatically increase the friction of seed discovery and collision generation, hence "resistance" (rather than proof) in a general sense. |
I still think that there is a great misunderstanding on your side. Can you describe plan of such attack? flood resistance idea suppose that you send keys to another network node. So:
|
Maybe read also http://perl11.org/blog/seed.html and see my offline test https://github.com/perl11/cperl/blob/master/t/op/hashflood.t and https://github.com/perl11/cperl/blob/master/t/op/seed-siphash-8-0.dat (and other collision files for more hash funcs) created in 0.003s per seed. I won't disclose much further how to get at a seed practically, as most dynamic languages are affected who rely on the false siphash security claims. ad 2. you don't need to send million keys, just as many to be able time the differences to identify collisions. 8bit should be enough locally (255 keys) with brute-force of 0.003s for siphash. ad 5. even SHA-1 is insecure and statistically bad when used in a 32bit hash table, as seen in the smhasher tests. I won't trust a crippled SHA-2 nor SHA-3 neither, but haven't tested it yet. ad 6. collisions are trivial to generate for every single hash function used in hash tables. if siphash, sha-1 or more. just brute force it for the usual hash table schemes (will not work with better ones using primes). siphash just needs twice as long, as the primary factor in siphash is mixing the seed into the box and slowness. just getting the siphash seed is not as trivial as for most other hash funcs. |
|
Did you notice one of the "take home messages" of the CCC talk linked:
(Also, the hash function attacked in that article, DJBX33X, is far from a secure hash function.) I don't know about any of the others, but this is exactly what Rust does, with a new key for every hash table. All the talk of secure hash functions being "security theatre" assumes the key is known or deducible. This article is even worse and could almost be summarized as: given the ability to run arbitrary code on a server [plus some other requirements] we can run a CPU DoS attack — well, this is pretty easy then, isn't it? If anything the advice should be use a secure hash function with a secure random key for every table, and never dump keys to log files or when serializing data. Again, I can't talk for any other language, but this is exactly what Rust does. |
No, exactly the opposite. Rust falls into the same trap as most other languages. Security against hash DoS comes from fixing the hash DoS, not by obscuring the key. |
Granted, using tree-based-maps with O(n×log(n)) complexity, or some hybrid with O(n×log(n)) worst case, is an adequate fix. But so is making sure no attacker has adequate information to predict which inputs will cause hash collisions. Even if side-channel timing attacks can be used to identify collisions (difficult over the open internet, because there are so many other delays), with a secure hash function and secret key it will still be impossible to predict new values which cause collisions. |
As I outlined above, no. There are practical remote timing attacks and there is too much independent public information on a hash table structure to bisect a key. With a dynamic language even worse, there's it's trivial. The hiding game for hashes is theatre. |
it's what every language does today. Reni's point-of-view is unpopular among language developers. |
|
There's still the myth of secure hash table functions around, esp. from the SipHash folks, as you can see at google/highwayhash#28
So add tests to prove them otherwise.
Allow all keys of char 0-255, i.e. including null and control chars. hash functions take binary input, even if some applications reject those keys.
It is also a good metric for the hash function algorithmic complexity.
The text was updated successfully, but these errors were encountered: