improved u1encrypt and decrypt