update encryption and decryption methods