class definition of encrypt()