@Override
    public String decrypt(String value, byte[] iv) {
        if (value == null) { return null; }

        // OF-2883: In Openfire 4.9.0, the base64 encoder was changed. This causes a compatibility issue with security.xml files that
        // were generated by older values, that use the 'MIME' type of decoding (with linebreaks) that's not used in later versions.
        // While persisting data in 'security.xml', linebreaks are replaced by white space.
        final Base64.Decoder decoder;
        if (value.length() > 76 && Character.isWhitespace(value.charAt(76))) {
            decoder = Base64.getMimeDecoder(); // Value saved by older version of Openfire.
        } else {
            decoder = Base64.getDecoder();
        }
        byte [] bytes = cipher(decoder.decode(value), getKey(), iv == null ? INIT_PARM : iv, Cipher.DECRYPT_MODE);
        if (bytes == null) { return null; }
        return new String(bytes, StandardCharsets.UTF_8);
    }
Custom key constructor

@param key the custom key
xmppserver/src/main/java/org/jivesoftware/util/AesEncryptor.java