Add optional integrity check when encrypting to ensure that ciphertext corruption is always detected.