decrypt and encrypt functions work