improved u1encrypt and u1decrypt