Implement encryption and decryption