KeyGenerator is a project mainly written in PHP, it's free.
profiling the best random generator techniques
Profiling various techniques for generating random (short) keys in php.