For teams past the prototype stage โ where security stops being a backlog item and becomes a release-blocker. This post covers four specific practices in production IoT security: cryptographic boot verification, signed OTA updates, encryption at rest and in transit, and per-device authentication. Informed by real embedded engineering work, not compliance checklists.


Before choosing security measures, it helps to be honest about what you are defending against. IoT attack vectors span a wider surface than traditional software systems:
No product needs to defend against every threat at maximum strength. The right security model depends on what the device handles, who has access to it, and what the impact of compromise looks like. For a broader introduction to IoT threat modelling, our understanding security in IoT devices post covers the foundational concepts. This post goes deeper on four specific practices: secure boot, OTA update security, encryption, and device authentication.
Secure boot is a chain-of-trust mechanism: on each power cycle, the bootloader cryptographically verifies the firmware image's signature before handing over execution. If the signature is invalid โ meaning the firmware has been tampered with or replaced โ the device refuses to boot. Only firmware signed with the corresponding private key (held securely off-device, typically in an HSM or equivalent) will run.
The chain-of-trust model anchors trust in an immutable root: a first-stage bootloader whose code cannot be overwritten (stored in ROM, or in write-protected flash with hardware enforcement). This root verifier checks the second-stage bootloader or application image. Tamper anywhere in that chain and the verification fails.
Secure boot is well-supported across common IoT SoC families, each with different implementations worth understanding:
| Platform | Secure Boot Mechanism | Notes |
|---|---|---|
| ESP32 | Secure Boot v2 (RSA-PSS 3072-bit or ECDSA) | eFuse-burned public key digest; v2 supports multiple signing keys; applies to bootloader and app partitions |
| nRF52 / nRF53 | MCUboot with signature verification (ECDSA P-256 or RSA) | nRF53 adds hardware CryptoCell-312 for accelerated crypto; immutable bootloader in write-protected flash |
| STM32 | RDP (Readout Protection) levels 0/1/2 + SBSFU / TFM | RDP2 is permanent โ no JTAG access, flash read-protected; STM32Cube Secure Boot & Secure Firmware Update (SBSFU) provides full signed-image verification |
| Raspberry Pi | Limited โ OTP-based boot verification on Pi 4/CM4 with signed bootloader | Not MCU-grade secure boot; Pi is a Linux SBC, and the secure boot story is materially weaker than dedicated MCUs. Worth being honest about if Pi is in your design. |
An unsigned OTA update pipeline is effectively a remote firmware installation backdoor. Anyone who can route a packet to your device โ on the same network, via a compromised cloud endpoint, or through a man-in-the-middle position โ can install arbitrary firmware. This is not a theoretical threat; it is one of the most frequently exploited attack surfaces in deployed consumer and industrial IoT.
Every firmware image is signed at build time with a private key held in offline key infrastructure. The device verifies the signature before accepting any image โ unsigned or incorrectly signed images are rejected, never flashed.
The device tracks a minimum acceptable version number. After successfully installing a new firmware version, the device will not accept any image with an older version counter. This prevents attackers who have obtained a valid signature for a previous (vulnerable) firmware version from downgrading the device.
If the firmware binary itself contains proprietary algorithms or sensitive logic, encrypting the OTA payload adds a layer of IP protection beyond the transport-layer encryption. Note: this is defence-in-depth for IP, not a substitute for signing โ encryption does not prove integrity; signing does.
The new firmware is written to a secondary slot and verified before the boot slot pointer is updated. If the new image fails verification, or if the device fails to boot the new image within a watchdog timeout, it rolls back to the previous known-good image. MCUboot implements this pattern well for nRF and STM32 targets.
For a full treatment of OTA architecture โ slot management, delta updates, cloud delivery pipelines, and bandwidth considerations โ see our OTA updates for IoT deep dive. This section covers the security dimension; the architecture details are there.
TLS is the correct default for IoT cloud communication. TLS 1.2 is the minimum acceptable โ TLS 1.3 is preferred for new designs, as it reduces handshake latency (one fewer round trip) and removes several cipher suites with known weaknesses. On extremely constrained devices (small MCUs with no TLS stack), DTLS over UDP is an option.
A critical and depressingly common mistake: shipping code with TLS certificate validation disabled. This is trivial to do during development (it eliminates cert management friction) and just as trivial to forget to re-enable at production. A TLS session without certificate validation provides encryption but not authentication โ the device will happily negotiate an encrypted session with an attacker's server. Certificate pinning or strict chain validation must be enforced in production firmware.
For BLE, use LE Secure Connections (LESC) โ which uses ECDH key exchange and provides forward secrecy โ rather than legacy BLE pairing. "Just Works" pairing (no numeric comparison, no out-of-band confirmation) is acceptable when the threat model genuinely permits passive eavesdropping risk; for devices with a display, Numeric Comparison or Passkey Entry provides meaningful protection against active MITM during pairing.
For products handling sensitive personal data โ for example, healthcare-adjacent devices we've built โ we apply TLS-secured cloud communication as a baseline. This is not optional in those contexts; it is the floor, not the ceiling.
Key material should not live in plaintext flash. The consequences of flash extraction (via JTAG with RDP not enabled, or direct SPI flash attachment) are severe when keys are readable in cleartext โ an attacker can clone the device identity, decrypt historical communications, or forge signed messages.
Hardware-backed key storage is the right answer when physical key extraction is a plausible threat:
| Platform | Hardware Key Storage Mechanism |
|---|---|
| ESP32 | eFuse key blocks โ 256-bit keys burned one-time, not readable via software after burning. Flash encryption uses these keys. |
| nRF53 / nRF52840 | Key Management Unit (KMU) โ cryptographic keys pushed to CryptoCell hardware without software visibility; ARM TrustZone on nRF5340 provides isolated execution for key operations. |
| STM32 (with TrustZone) | ARM TrustZone on STM32L5/U5 โ secure world / non-secure world isolation; secure storage APIs prevent non-secure application code from accessing key material. |
| Dedicated secure element | ATECC608, SE050, similar โ tamper-resistant ICs with hardened key storage; integrates over I2C/SPI; highest assurance option, adds BOM cost. |
There is an important distinction between a device authenticating to the cloud and a cloud API key being used by the device. API keys shared across a fleet mean that compromise of any single device โ or of the firmware itself โ exposes credentials that affect every device in the fleet. Per-device authentication means compromise of one device's credentials affects exactly one device.
Each device holds a unique client certificate and private key. The cloud authenticates the device via the certificate chain, and the device authenticates the cloud via the server certificate. Per-device certificates mean revocation of a compromised device does not affect the fleet. This is the architecture used by AWS IoT Core, Azure IoT Hub, and Google Cloud IoT (per-device cert provisioning). The overhead is certificate management infrastructure at manufacture; at scale this is solved with factory provisioning tooling.
Simpler to implement than mTLS; each device has a unique symmetric key provisioned during manufacturing and stored in protected flash or a secure element. Works well for MQTT with HMACs or for protocols that support PSK-based TLS cipher suites. Key rotation is harder than with certificate-based approaches.
Secure elements like the ATECC608 can generate and hold a device-unique key pair in hardware that never leaves the device. The public key is registered with the cloud at provisioning; thereafter, the device proves identity by signing challenges with its hardware-held private key. This provides the strongest per-device identity guarantee because the private key is physically non-extractable.
On crypto and blockchain-adjacent products we've built, we apply patterns such as on-device private-key isolation (transactions signed in hardware, keys never exposed to host software), smart-contract integration via APIs for on-chain state, and on-chain audit logging where tamper-evident records matter. The hardware-wallet pattern โ private keys living entirely in the device's secure storage, with all signing operations occurring on-device โ is directly applicable to high-assurance device identity scenarios beyond blockchain contexts.
Security in production IoT is an engineering discipline, not a checklist exercise. The following is how we approach it on real products.
Every production firmware release goes through a security checklist before sign-off โ covering credentials, debug interfaces, secret material, OTA signing, and known-issue review. This is a process gate, not a formality. The checklist exists because the most common production security mistakes are not architectural failures โ they are omission failures caught by systematic review.
For products handling sensitive personal data โ for example, healthcare-adjacent devices we've built โ we apply TLS-secured cloud communication as a baseline. This is the floor, not the entire security architecture; it is the first thing we confirm before considering other transport-layer decisions.
The most expensive security fix is the one discovered at release. We introduce threat modelling and security requirements at the product specification stage โ before hardware is locked and before firmware architecture is committed. Decisions about secure storage, OTA signing, and authentication model are architectural; they need to be made early.
For a broader view of our IoT engineering work โ firmware, hardware, cloud connectivity, and security โ see our IoT services page. Security is one dimension of production-grade embedded engineering; it does not stand alone from the firmware architecture, power management, and connectivity design decisions it sits alongside.
These are not theoretical vulnerabilities โ they are patterns we still see in IoT products at or near release. They are worth naming directly because most of them are fixable early and expensive late.
API keys, MQTT passwords, cloud endpoint credentials, and Wi-Fi PSKs committed to firmware binary or to version control. Any shipped device exposes these; any version-controlled codebase exposes them to anyone with repo access. Credentials should be provisioned at manufacture, not compiled in.
Already covered above โ but worth repeating because it is the most common single gap. An OTA pipeline without signature verification is a remote arbitrary code execution primitive. It should be treated as a blocker for production deployment.
Signed OTA without anti-rollback means an attacker in possession of a legitimately-signed older firmware image can downgrade the device to a version with known vulnerabilities. Monotonic version counters are the fix; they add trivial implementation overhead.
Devices that ship with manufacturer-default usernames and passwords, or with first-boot passwords identical to the device serial number (trivially predictable), remain permanently exposed. Per-device unique provisioned credentials, or forced first-boot credential change, are the correct patterns.
A frequently seen pattern: TLS is implemented and the connection is technically encrypted, but certificate validation is disabled or bypassed โ meaning the device will connect to any server, including an attacker's. The code typically contains something like verify_peer = false or equivalent. This is a non-trivial misconfiguration to catch at review without explicitly checking for it, which is why it appears on the sign-off checklist.
JTAG, SWD, and UART debug consoles are invaluable during development. In production hardware shipped to end users, they are physical attack surfaces. JTAG and SWD should be disabled via RDP, eFuse burning, or equivalent hardware protection. UART debug output should be gated or removed. Leaving them open in production is a common omission, not a deliberate choice โ which makes it a sign-off checklist item.
Signing keys, private certificates, cloud provisioning credentials, and factory-test keys committed to source control โ even internal repos โ represent a persistent exposure risk. Leaked repo access at any point in the product lifetime exposes the material. Secrets belong in secrets management systems (hardware HSMs, cloud KMS, CI/CD secret stores), not in version control.
Products that have no mechanism for rotating device credentials at scale have no recovery path for credential compromise. Discovering that 50,000 deployed devices share a compromised symmetric key, with no way to rotate it without physical access, is an unrecoverable situation. Design key rotation as a supported operation from the beginning, even if you use it rarely.
Security gaps in IoT are most expensive when found at release โ or after. Our embedded engineering team works through threat models, firmware architecture, OTA pipelines, and production sign-off with security as a first-class input, not a last-minute checklist.
Talk to our IoT engineering team โ