Password encryption using blowfish for openfire

I am trying to insert few users into openfire using SQL query. I need to insert ENCRYPTEDPASSWORD password for these users. Since openfire uses blowfish algorithm to encrypt password. I need to generate openfire compatible (blowfish encrypted) encrypted string. I need to know, is there any open source library which will enable me to do this?

Thanks in advance…