• Take data in string format, and encrypt it with the given symmetric key.

    Parameters

    • key: CryptoKey

      The symmetric key used to encrypt/decrypt

    • data: string | Uint8Array<ArrayBufferLike>

      The text to encrypt

    Returns Promise<string>

    Encrypted data encoded as base64pad string.