_crypt(encrypt, cipherAlgorithm, cipherChaining, key, iv, input) {
        let algorithm = `${cipherAlgorithm.toLowerCase()}-${key.length * 8}`;
        if (cipherChaining === 'ChainingModeCBC') algorithm += '-cbc';
        else throw new Error(`Unknown cipher chaining: ${cipherChaining}`);

        const cipher = crypto[encrypt ? 'createCipheriv' : 'createDecipheriv'](algorithm, key, iv);
        cipher.setAutoPadding(false);
        let output = cipher.update(input);
        output = Buffer.concat([output, cipher.final()]);
        return output;
    }
Encrypt/decrypt input
@param {boolean} encrypt - True to encrypt, false to decrypt
@param {string} cipherAlgorithm - The cipher algorithm
@param {sring} cipherChaining - The cipher chaining mode
@param {Buffer} key - The encryption key
@param {Buffer} iv - The initialization vector
@param {Buffer} input - The input
@returns {Buffer} The output
@private