[PHP-DEV] Randomize hash-function in php

2012-03-14 Thread Simon Schick
Hi, All I just came around that talk a couple of days ago .. http://www.youtube.com/watch?v=R2Cq3CLI6H8 I don't know much about hash-maps and internal php-stuff at all, but they say that the fix provided in 5.3.9 (and 5.4.0) is more a work-around than a fix ... Would it be an option to provide a

[PHP-DEV] Randomize hash-function in php

2012-03-17 Thread Simon Schick
Hi, All I just came around that talk a couple of days ago .. http://www.youtube.com/watch?v=R2Cq3CLI6H8 I don't know much about hash-maps and internal php-stuff at all, but they say that the fix provided in 5.3.9 (and 5.4.0) is more a work-around than a fix ... Would it be an option to provide a

Re: [PHP-DEV] Randomize hash-function in php

2012-03-17 Thread Stas Malyshev
Hi! I don't know much about hash-maps and internal php-stuff at all, but they say that the fix provided in 5.3.9 (and 5.4.0) is more a work-around than a fix ... This is true, it is a workaround in a meaning that the hash stays the same, but the fix prevents one from using excessive amounts o

Re: [PHP-DEV] Randomize hash-function in php

2012-03-17 Thread Sam
On 17/03/12 23:17, Simon Schick wrote: Hi, All I just came around that talk a couple of days ago .. http://www.youtube.com/watch?v=R2Cq3CLI6H8 I don't know much about hash-maps and internal php-stuff at all, but they say that the fix provided in 5.3.9 (and 5.4.0) is more a work-around than a fi

Re: [PHP-DEV] Randomize hash-function in php

2012-03-17 Thread Stas Malyshev
Hi! Anyway I was looking at the hash function in PHP the other week, and was playing around with some different implementations. DJBX33A is fast, which I guess is why PHP uses it as it is hit so many times in the execution. Some time ago we've checked various implementations of hash functions

Re: [PHP-DEV] Randomize hash-function in php

2012-03-17 Thread Tjerk Anne Meesters
On Sun, Mar 18, 2012 at 8:12 AM, Stas Malyshev wrote: > Obvious solution would be to use a salt for the hash, which prevents blind > pre-computing of hash collisions. However, due to the fact that PHP hash > values can be reused in different processes by bytecode caches, implementing > it properly

Re: [PHP-DEV] Randomize hash-function in php

2012-03-17 Thread Xinchen Hui
Sent from my iPhone 在 2012-3-18,13:57,Tjerk Anne Meesters 写道: > On Sun, Mar 18, 2012 at 8:12 AM, Stas Malyshev wrote: >> Obvious solution would be to use a salt for the hash, which prevents blind >> pre-computing of hash collisions. However, due to the fact that PHP hash >> values can be reused

Re: [PHP-DEV] Randomize hash-function in php

2012-03-18 Thread Tjerk Meesters
On 18 Mar, 2012, at 2:32 PM, Xinchen Hui wrote: >> What if php uses salts for specific hashes only, such as GPC (or all >> hashes whose lifetime is limited to the current reuqest), and use a >> zero-value salt for all others? > definitely no,thinking of pre-calculated hash. Pre-calculated hash o

Re: [PHP-DEV] Randomize hash-function in php

2012-03-18 Thread Xinchen Hui
Sent from my iPhone 在 2012-3-18,15:05,Tjerk Meesters 写道: > On 18 Mar, 2012, at 2:32 PM, Xinchen Hui wrote: > >>> What if php uses salts for specific hashes only, such as GPC (or all >>> hashes whose lifetime is limited to the current reuqest), and use a >>> zero-value salt for all others? >> de

Re: [PHP-DEV] Randomize hash-function in php

2012-03-18 Thread Ángel González
On 18/03/12 06:56, Tjerk Anne Meesters wrote: > On Sun, Mar 18, 2012 at 8:12 AM, Stas Malyshev wrote: >> Obvious solution would be to use a salt for the hash, which prevents blind >> pre-computing of hash collisions. However, due to the fact that PHP hash >> values can be reused in different proce