The encrypt() method encrypts some data.
|AesCtrParams, AesCbcParams, or AesGcmParams object
|Defines the algorithm to use and any extra-parameters.
|The key to use for encryption.
|ArrayBuffer, TypedArray, or DataView
|The data to be encrypted (also known as "plaintext").
A Promise that resolves to a new ArrayBuffer containing the encrypted data.
|Raised when the requested operation is not valid with the provided key. For instance when an invalid encryption algorithm is used, or a key not matching the selected algorithm is provided.
|Raised when the operation failed for an operation-specific reason. For instance, if the algorithm size is invalid, or errors occurred during the process of decrypting the ciphertext.