def Encrypt(self, data):
    """A convenience method which pads and encrypts at once."""
    encryptor = self.GetEncryptor()
    padded_data = self.Pad(data)

    try:
      return encryptor.update(padded_data) + encryptor.finalize()
    except ValueError as e:
      raise CipherError(e)
def Encrypt ( self , data ) : encryptor = self . GetEncryptor ( ) padded_data = self . Pad ( data ) try : return encryptor . update ( padded_data ) + encryptor . finalize ( ) except ValueError as e : raise CipherError ( e )
A convenience method which pads and encrypts at once.