improved encrypt