I'm trying to generate users and password dynamically using PHP
I've seen
creating encrypted passwords in openfire MySQL via PHP
But the post is 3 years old and doesn't give any indication of where to get the various variables
eg enckey, enciv and javastring
Please could someone help
Thanks James
The answer from the question you mentioned has everything you need.
The variables you don't know where to get from are just examples to show how the decryption works.
Use the class like this:
$a = new OpenFireBlowfish('YourPassword');
if you don't provide an IV, the class will generate one.
$encstring = bin2hex($a->encryptString('stackoverflow'));
It might be worth to extend the class by a getIv()
/ setIv()
method.
Note that you need mcrypt
PHP mod installed to use those functions.