Create user encryptedPassword in PHP

Hi,

I want to integrate openfire with a intranet in PHP.

For that I need to be able to create the password hash that is in the table openfire.ofuser in PHP, so I can syncronize users. I´ve tried blowfish with the passwordKey but the result is not the same. Can anybody help in creating that hash in php ?

Thanks