private static synchronized Blowfish getCipher() {
        if (cipher != null) {
            return cipher;
        }
        // Get the password key, stored as a database property. Obviously,
        // protecting your database is critical for making the
        // encryption fully secure.
        String keyString;
        try {
            keyString = PASSWORD_KEY.getValue();
            if (keyString == null) {
                keyString = StringUtils.randomString(15);
                PASSWORD_KEY.setValue(keyString);
                // Check to make sure that setting the property worked. It won't work,
                // for example, when in setup mode.
                if (!keyString.equals(PASSWORD_KEY.getValue())) {
                    return null;
                }
            }
            cipher = new Blowfish(keyString);
        }
        catch (Exception e) {
            Log.error(e.getMessage(), e);
        }
        return cipher;
    }
Returns a Blowfish cipher that can be used for encrypting and decrypting passwords.
The encryption key is stored as the Jive property "passwordKey". If it's not present,
it will be automatically generated.

@return the Blowfish cipher, or {@code null} if Openfire is not able to create a Cipher;
     for example, during setup mode.
xmppserver/src/main/java/org/jivesoftware/openfire/auth/AuthFactory.java