Course contentsShow
← Embedded Systems & Computer Architecture
Lesson 906 of 93612. IoT Connectivity and SecurityFree lesson

Lifecycle Management of Cryptographic Keys

Learners will design secure processes for key rotation, revocation, and secure decommissioning to maintain long-term security in deployed IoT systems.

In this lesson, you will learn how to design automated processes for the rotation, revocation, and secure decommissioning of cryptographic keys to ensure your IoT devices remain resilient against long-term compromise.

The Cryptographic Lifecycle

In an IoT deployment, a key is not a static object; it is a sensitive asset that ages. If a device uses the same symmetric key or long-term private key for years, the probability of successful side-channel analysis or cryptanalysis increases, and the impact of a single leaked key becomes catastrophic. Lifecycle management involves three distinct phases:

1. Key Rotation

Rotation limits the "blast radius" of a potential compromise. For symmetric keys used in MQTT payloads, you should implement a re-keying mechanism. Periodically, the device and the cloud backend derive a new session key using a Key Derivation Function (KDF) combined with a high-entropy salt or a nonce:

// Concept: Deriving a new key for the next rotation interval
uint8_t new_session_key[32];
derive_key(current_master_key, "rotation_nonce_123", new_session_key);
update_hardware_storage(new_session_key);

2. Revocation

If a device is physically tampered with or its unique private key is suspected to be extracted, you must invalidate it. Since IoT devices often have limited connectivity, revocation usually relies on a Certificate Revocation List (CRL) or an Online Certificate Status Protocol (OCSP) stapling process. In a constrained environment, the device periodically checks a signed "revocation manifest" from the backend to see if its own ID or a specific intermediate CA has been blacklisted.

3. Secure Decommissioning

When a device reaches its end-of-life or is decommissioned, simply deleting the application code is insufficient. You must perform a "cryptographic wipe." This involves triggering a command to the Hardware Root of Trust (RoT) to zeroize the memory cells holding the device's unique private identity keys. If the keys reside in an encrypted flash partition, wiping the Key Encryption Key (KEK) effectively renders all stored secrets cryptographically inaccessible, ensuring that decommissioned hardware cannot be repurposed to spoof the network.

Key Takeaway: Effective lifecycle management transforms static secrets into dynamic assets, ensuring that rotated keys minimize exposure and decommissioned keys are rendered permanently inaccessible.