def encrypt(self,<EOL>encryption_algorithm,<EOL>encryption_key,<EOL>plain_text,<EOL>cipher_mode=None,<EOL>padding_method=None,<EOL>iv_nonce=None,<EOL>hashing_algorithm=None):
if encryption_algorithm is None:<EOL><INDENT>raise exceptions.InvalidField("<STR_LIT>")<EOL><DEDENT>if encryption_algorithm == enums.CryptographicAlgorithm.RSA:<EOL><INDENT>return self._encrypt_asymmetric(<EOL>encryption_algorithm,<EOL>encryption_key,<EOL>plain_text,<EOL>padding_method,<EOL>hashing_algorithm=hashing_algorithm<EOL>)<EOL><DEDENT>else:<EOL><INDENT>return self._encrypt_symmetric(<EOL>encryption_algorithm,<EOL>encryption_key,<EOL>plain_text,<EOL>cipher_mode=cipher_mode,<EOL>padding_method=padding_method,<EOL>iv_nonce=iv_nonce<EOL>)<EOL><DEDENT>
Encrypt data using symmetric or asymmetric encryption.

Args:
    encryption_algorithm (CryptographicAlgorithm): An enumeration
        specifying the encryption algorithm to use for encryption.
    encryption_key (bytes): The bytes of the encryption key to use for
        encryption.
    plain_text (bytes): The bytes to be encrypted.
    cipher_mode (BlockCipherMode): An enumeration specifying the
        block cipher mode to use with the encryption algorithm.
        Required in the general case. Optional if the encryption
        algorithm is RC4 (aka ARC4). If optional, defaults to None.
    padding_method (PaddingMethod): An enumeration specifying the
        padding method to use on the data before encryption. Required
        if the cipher mode is for block ciphers (e.g., CBC, ECB).
        Optional otherwise, defaults to None.
    iv_nonce (bytes): The IV/nonce value to use to initialize the mode
        of the encryption algorithm. Optional, defaults to None. If
        required and not provided, it will be autogenerated and
        returned with the cipher text.
    hashing_algorithm (HashingAlgorithm): An enumeration specifying
        the hashing algorithm to use with the encryption algorithm,
        if needed. Required for OAEP-based asymmetric encryption.
        Optional, defaults to None.

Returns:
    dict: A dictionary containing the encrypted data, with at least
        the following key/value fields:
        * cipher_text - the bytes of the encrypted data
        * iv_nonce - the bytes of the IV/counter/nonce used if it
            was needed by the encryption scheme and if it was
            automatically generated for the encryption

Raises:
    InvalidField: Raised when the algorithm is unsupported or the
        length is incompatible with the algorithm.
    CryptographicFailure: Raised when the key generation process
        fails.

Example:
    >>> engine = CryptographyEngine()
    >>> result = engine.encrypt(
    ...     encryption_algorithm=CryptographicAlgorithm.AES,
    ...     encryption_key=(
    ...         b'\xF3\x96\xE7\x1C\xCF\xCD\xEC\x1F'
    ...         b'\xFC\xE2\x8E\xA6\xF8\x74\x28\xB0'
    ...     ),
    ...     plain_text=(
    ...         b'\x00\x01\x02\x03\x04\x05\x06\x07'
    ...         b'\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F'
    ...     ),
    ...     cipher_mode=BlockCipherMode.CBC,
    ...     padding_method=PaddingMethod.ANSI_X923,
    ... )
    >>> result.get('cipher_text')
    b'\x18[\xb9y\x1bL\xd1\x8f\x9a\xa0e\x02b\xa3=c'
    >>> result.iv_counter_nonce
    b'8qA\x05\xc4\x86\x03\xd9=\xef\xdf\xb8ke\x9a\xa2'