Encrypts the provided data using an encryption algorithm.
The encrypted data.
The data to be encrypted.
If an error occurs during encryption.