Add encrypt function.