Add encryption/decryption function