@Override
    public String encrypt(String value, byte[] iv) {
        if (value == null) { return null; }
        byte [] bytes = value.getBytes(StandardCharsets.UTF_8);
        return java.util.Base64.getEncoder().encodeToString(cipher(bytes, getKey(), iv == null ? INIT_PARM : iv, Cipher.ENCRYPT_MODE));
    }
Custom key constructor

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