How to make excryptPassword and add a user to Openfire from external PHP program

I’m writing a PHP program with reference to the following site.

http://stackoverflow.com/questions/7705098/creating-encrypted-passwords-in-openf ire-mysql-via-php

User but is correctly added to the openfire, it is an error and that user I try to login.

‘User Service’ plugin is installed.

I know the Secret key.

What you want to question is as follows.

  1. What value set to $ enckey and $ enciv?

  2. Is the argument of encryptString () may be just the user name?

Please tell me. Thank you.

How To Find Secret Key??