def keyczar_symmetric_encrypt(encrypt_key, plaintext):
    """
    Encrypt the given message using the encrypt_key. Returns a UTF-8 str
    ready to be stored in database. Note that we convert the hex notation
    to a ASCII notation to produce a UTF-8 friendly string.

    Also, this method will not return the same output on multiple invocations
    of same method. The reason is that the Encrypt method uses a different
    'Initialization Vector' per run and the IV is part of the output.

    :param encrypt_key: Symmetric AES key to use for encryption.
    :type encrypt_key: :class:`AESKey`

    :param plaintext: Plaintext / message to be encrypted.
    :type plaintext: ``str``

    :rtype: ``str``
    """
    from keyczar.keys import AesKey as KeyczarAesKey  # pylint: disable=import-error
    from keyczar.keys import HmacKey as KeyczarHmacKey  # pylint: disable=import-error
    from keyczar.keyinfo import GetMode  # pylint: disable=import-error

    encrypt_key = KeyczarAesKey(
        encrypt_key.aes_key_string,
        KeyczarHmacKey(encrypt_key.hmac_key_string, encrypt_key.hmac_key_size),
        encrypt_key.size,
        GetMode(encrypt_key.mode),
    )

    return binascii.hexlify(encrypt_key.Encrypt(plaintext)).upper()

    Encrypt the given message using the encrypt_key. Returns a UTF-8 str
    ready to be stored in database. Note that we convert the hex notation
    to a ASCII notation to produce a UTF-8 friendly string.

    Also, this method will not return the same output on multiple invocations
    of same method. The reason is that the Encrypt method uses a different
    'Initialization Vector' per run and the IV is part of the output.

    :param encrypt_key: Symmetric AES key to use for encryption.
    :type encrypt_key: :class:`AESKey`

    :param plaintext: Plaintext / message to be encrypted.
    :type plaintext: ``str``

    :rtype: ``str``
    
st2common/st2common/util/crypto.py