_encrypt function works