code: def enc_setup(self, enc_alg, msg, auth_data=b'', key=None, iv=""):
          
  
          iv = self._generate_iv(enc_alg, iv)
  
          if enc_alg in ["A192GCM", "A128GCM", "A256GCM"]:
              aes = AES_GCMEncrypter(key=key)
              ctx, tag = split_ctx_and_tag(aes.encrypt(msg, iv, auth_data))
          elif enc_alg in ["A128CBC-HS256", "A192CBC-HS384", "A256CBC-HS512"]:
              aes = AES_CBCEncrypter(key=key)
              ctx, tag = aes.encrypt(msg, iv, auth_data)
          else:
              raise NotSupportedAlgorithm(enc_alg)
  
          return ctx, tag, aes.key
docs: Encrypt JWE content.
  
          :param enc_alg: The JWE "enc" value specifying the encryption algorithm
          :param msg: The plain text message
          :param auth_data: Additional authenticated data
          :param key: Key (CEK)
          :return: Tuple (ciphertext, tag), both as bytes