updated encryption and decryption