def encrypt(self, data, pad=None, padmode=None):
data = self._guardAgainstUnicode(data)<EOL>if pad is not None:<EOL><INDENT>pad = self._guardAgainstUnicode(pad)<EOL><DEDENT>data = self._padData(data, pad, padmode)<EOL>return self.crypt(data, des.ENCRYPT)<EOL>
encrypt(data, [pad], [padmode]) -> bytes

        data : Bytes to be encrypted
        pad  : Optional argument for encryption padding. Must only be one byte
        padmode : Optional argument for overriding the padding mode.

        The data must be a multiple of 8 bytes and will be encrypted
        with the already specified key. Data does not have to be a
        multiple of 8 bytes if the padding character is supplied, or
        the padmode is set to PAD_PKCS5, as bytes will then added to
        ensure the be padded data is a multiple of 8 bytes.