in reply to Re: selecting random key from hash
in thread selecting random key from hash
In latest perls, the hashing seed used is randomised to avoid certain types of DOS attacks. However, it is not randomised at each use - instead, each time a new key is added to the hash perl checks whether the hash is becoming heavily unbalanced (either due to an injection attack or due to simple bad luck), and re-hashes only if it is.
In normal use, the rehashing should rarely happen. And that's just as well because it is relatively expensive.
(Before you ask, I'd add that this is not vulnerable to a higher level DOS attack that forces constant rehashing unless the attacker can predict the new random hash seed that will be selected.)
Hugo
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: selecting random key from hash
by BrowserUk (Patriarch) on Jul 13, 2004 at 09:37 UTC |