Topic hub

Device security

Secure boot, flash encryption, unique credentials and TLS on connected devices, mapped to the baselines that now apply to them (ETSI EN 303 645, EN 18031, Regulation (EU) 2024/2847).

Updated 28 November 2026 · secure boot, flash encryption, eFuse, unique passwords, TLS 1.3, PSA Certified, ETSI EN 303 645, EN 18031, SBOM, support period

Overview

This hub covers how a connected device protects its firmware, secrets and traffic, and how those mechanisms map to the security baselines that now apply in Europe and the UK. It is for makers who want a sensor that is hard to misuse and for product teams who must show evidence to a test lab. The scope is defensive: what each mechanism protects, what it does not, and where the requirement comes from.

The EU radio rules on network protection, privacy and fraud have applied since 1 August 2025, the UK rules since 29 April 2024, and Regulation (EU) 2024/2847 (the CRA) adds vulnerability reporting from 11 September 2026. The legal side is on Certification and regulation.

Key ideas

Start from a baseline, not a feature list

ETSI EN 303 645 V3.1.3 (2024-09) is the baseline most consumer IoT requirements point to. Its provisions sit in 13 clauses, from 5.1 (no universal default passwords) to 5.13 (validate input data), and the document history records the expansion to 68 provisions when it became a European Standard. EN 18031-1, -2 and -3:2024 do the same job for EU radio equipment until Delegated Regulation (EU) 2022/30 is repealed on 11 December 2027. The CRA’s Annex I lists the properties a product must have: no known exploitable vulnerabilities when placed on the market, a secure by default configuration, a way to receive security updates, protection of stored and transmitted data, and a limited attack surface. Part II of the same annex asks for a software bill of materials (SBOM) covering at least the top-level dependencies.

Unique credentials and no secrets in source code

EN 303 645 provision 5.1-1 requires every password to be unique per device or set by the user once the device leaves its factory default state. The UK regulations (SI 2023/1007, Schedule 1) say the same and add that unique passwords must not come from incremental counters, public information or serial numbers (unless derived with an accepted keyed hash or encryption method). EN 303 645 provision 5.4-3 forbids hard-coded critical security parameters in device source code. The EU went one step further when it listed EN 18031: Implementing Decision (EU) 2025/138 says the standards give no presumption of conformity if the product lets the user skip setting a password under clauses 6.2.5.1 and 6.2.5.2.

A chain of trust from ROM to application

Secure boot means each stage checks the signature of the next before running it, starting from code that cannot change. On the ESP32-C5 (ESP-IDF v6.1.1 documentation), the ROM bootloader verifies the second-stage bootloader, which verifies each application image. The chip stores up to three public key digests in eFuse (one-time programmable fuse bits), and each key can be revoked permanently. Espressif’s page advises RSA-3072 on this chip because its ECDSA scheme is not functional for certain input vectors. Nordic’s nRF Connect SDK builds the same chain from its immutable first-stage bootloader (NSIB), with MCUboot as an upgradable second stage. On the RP2350, Raspberry Pi lists optional boot signing enforced by mask ROM, with the key fingerprint held in OTP (one-time programmable) memory.

Boot (inside the chip and its flash)ROM loaderimmutablebootloadersigned imageapplicationsigned imageverifyverifyeFuse / OTPkey digestsflash encryption (XTS-AES)confidentiality at rest, not integrityNetworkTLS 1.3per-device certbrokeror serviceOTA imagesame signing key
A device chain of trust: each boot stage verifies the next against a key fixed in fuses or ROM, flash encryption protects the image at rest, and TLS with a per-device credential protects it in transit. Drawn from the ESP-IDF v6.1.1 Secure Boot v2 and Flash Encryption pages and the nRF Connect SDK secure bootloader chain page.

Flash encryption hides, secure boot protects

Flash encryption on the ESP32-C5 uses XTS-AES-128 or XTS-AES-256 with the key in eFuse, so a physical readout of the flash chip does not reveal most of its contents. It does not stop someone altering the image, and Espressif recommends using it together with secure boot. Flash encryption also has two modes. Development mode still accepts plaintext images over the serial port. Release mode blocks plaintext flashing over UART, so new firmware arrives only by over-the-air update.

Transport security and the library underneath it

TLS 1.3 was published as RFC 8446 in August 2018. In TLS 1.3 every public-key key exchange provides forward secrecy, so a key stolen later cannot decrypt recorded sessions. In July 2026 the IETF published RFC 9846, which obsoletes RFC 8446 and RFC 5246 (TLS 1.2). It keeps the version number and is backward compatible, so devices need no protocol change. The TLS library is a dependency with its own lifecycle. According to the Mbed TLS release notes, 4.3.0 is the current release, the 4.1 long-term support (LTS) branch is supported until at least March 2029, and support for the 3.6 LTS branch ends on 28 March 2027.

Updates and vulnerability handling are security features

EN 303 645 asks for a public vulnerability disclosure policy (5.2-1) and a published support period (5.3-13). The UK regulations require a published point of contact for security reports and the defined support period. The CRA sets a support period of at least five years unless the product is expected to be in use for less (Article 13(8)). From 11 September 2026 its Article 14 requires manufacturers to report actively exploited vulnerabilities: an early warning within 24 hours, a notification within 72 hours and a final report within 14 days of a fix being available. Article 69(3) applies this to products already on the market.

Where to start

Begin with /learn/beginner/06-wifi-and-your-first-request/, which keeps credentials out of source code from the first program, then /learn/beginner/07-mqtt-basics/ for the broker your device will authenticate to. Choosing a microcontroller covers which chips have secure boot and key storage. Read OTA and fleet management before enabling secure boot: every future update needs the signing key you choose.

For makers

Keep Wi-Fi and broker credentials in a gitignored secrets.h or .env file and commit only a *.example copy. Give every device its own broker password. Connect over TLS and check the server certificate. Try secure boot and flash encryption on a spare board first: key revocation is permanent, and flash encryption in release mode stops plaintext flashing over the serial port.

For product teams

Decide which baseline you will claim (EN 303 645, EN 18031 for EU radio equipment, CRA Annex I from December 2027) and map each provision to a mechanism and a test. Provision per-device keys and certificates in manufacturing, and plan key custody for the signing keys. Publish the support period and a vulnerability contact. Set up the 24-hour and 72-hour reporting path required from 11 September 2026. Ask chip vendors for PSA Certified evidence and track the end-of-support date of every security library you ship.

Tools and platforms

Job Option What the source says
Signed boot on an ESP32-C5 ESP-IDF Secure Boot v2 RSA-3072 advised on this chip, up to three revocable key digests (ESP-IDF v6.1.1 docs)
Signed boot on an nRF device NSIB with MCUboot (nRF Connect SDK) Immutable first stage verifies the next image’s signature and metadata
Signed boot on an RP2350 Mask ROM boot signing Key fingerprint stored in OTP, plus Arm TrustZone for Cortex-M
Keep flash contents confidential ESP-IDF flash encryption XTS-AES-128 or -256, release mode for production
TLS on a microcontroller Mbed TLS 4.3.0 current, 4.1 LTS to at least March 2029, 3.6 LTS ends 28 March 2027
Third-party evidence for a chip or device PSA Certified Level 1 questionnaire reviewed by a lab, Levels 2 to 4 lab evaluation
Consumer product baseline ETSI EN 303 645 V3.1.3 13 clauses, 68 provisions
EU radio market access EN 18031-1/-2/-3:2024 Listed with restrictions by Implementing Decision (EU) 2025/138

Common mistakes

  • One default password for the whole product line, printed in the manual. Every baseline above rules it out.
  • API keys or private keys in the firmware repository, where provision 5.4-3 forbids them and where they end up in every binary.
  • Flash encryption without secure boot, which hides the image but lets an attacker modify it.
  • Shipping with flash encryption in development mode.
  • Leaving unused key digest slots unrevoked. Espressif notes that an unrevoked slot could let an attacker add a trusted key later.
  • Turning off server certificate checks “for testing” and shipping the build.

Going deeper