今天安装Openfire但是设置完毕后忘记密码了,然后查看资料,找到了解决方法
Openfire的密码加密是由 org.jivesoftware.util.Blowfish 实现的,不过需要加密需要获取Openfire的 passwordKey ,在安装的目录下面的openfire\embedded-db\openfire.script里面查找
INSERT INTO OFPROPERTY VALUES('passwordKey','xxxxxxxxxxxx') //passwordKey
然后在相同的文件里面找到
INSERT INTO OFUSER VALUES('admin',NULL,'xxxxxxxxxxxxxxxxxxx','0') //encryptedPassword
然后用以下Java代码就可以解密:
package openfire;
import org.jivesoftware.util.Blowfish;
public class Openfire {
static Blowfish blowfish = new Blowfish("xxxxxx");//passwordKey
public static void main(String[] args) {
System.out.println(blowfish.decryptString("xxxxxxxxxxxxxxxxxxxx")); // encryptedPassword
}
}
依赖库:http://pan.baidu.com/share/link?shareid=423169&uk=638564236