improve encryption script