Implement packet encryption/decryption