View All Articles
November 26, 2026
Articles

Building Secure IoT Products: Encryption from Chip to Cloud

Written by
Sean Lanigan Embedded Software Engineer
Sean Lanigan
Embedded Software Engineer
A close up image of a PCB
Share this story

In an increasingly connected world, cybersecurity has never been more critical. Hacked devices are valuable for criminals: perhaps there’s sensitive data that could be stolen, or a fleet of devices could be held ransom and the operator extorted for money, or it could just result in a botnet being formed as a launching pad for further attacks. It feels like every week there’s a new horror story of an AI agent that’s hacked into something, which means that bad actors have ever more tools at their disposal to do more damage for less effort. It’s never been more important to ensure your Internet of Things (IoT) device is hardened against as many attack vectors as possible. Investing in security early can help avoid substantial costs later.

Reliable security is not just expected by end users, it’s also increasingly required by regulation, for example, any new Internet-connected device sold in Europe must comply with the Radio Equipment Directive cybersecurity requirements, and soon the Cyber Resilience Act will bring in even more stringent requirements.

Irrespective of any regulatory requirements, security is HARD! It just takes one small error to introduce a flaw that could be exploited. Unless you have an in-house team of genuine cryptography experts with thousands of hours to sink into development, it’s essential to follow the best practices of thoroughly tested and verified third-party projects.

One project designed to address this challenge is Trusted Firmware-M (TF-M), which provides a Secure Processing Environment (SPE) for compatible Arm Cortex-M MCUs, and can leverage Arm TrustZone hardware security features. In this article, we’ll investigate how the popular Zephyr RTOS can be configured to support TF-M, and how the two can be used together to strengthen end-to-end security in embedded devices. By using a reliable and trusted existing system, your IoT device can benefit from industry-leading encryption for minimal cost.

‍

Side quest: threat modelling

Keeping an IoT device secure is an ongoing process, not a one-time task. A common idiom in software development is that “software is never finished”, and this is especially true for an IoT device. Even if the required features have been implemented, it’s almost inevitable that eventually there’s going to be some sort of security vulnerability. To fix the vulnerability, there needs to be an update to the software.

However, updating software introduces a potential new threat: a device could be tricked into updating itself with malicious software.

More broadly, this and other threats should be considered in a threat model, a kind of risk assessment for security threats. Having a threat model helps to make informed decisions around security trade-offs.

For example: a critical piece of industrial plant might warrant a firmware update process that can only be performed locally - on the grounds that if it ever were to be compromised through an over-the-air update then the potential impact could be enormous. However, a remote weather monitoring station might have less impact if it were compromised, so the risk of over-the-air updates is outweighed by the inconvenience and cost of performing local-only updates. Though, that’s not to say that all weather data is low risk! Imagine the emergency response that could be falsely triggered if a flood monitoring station was hacked to maliciously indicate a flash flood event. Your threat model should consider the full end-to-end use of your device.

Threat modelling helps to tease out the various scenarios that should be considered in your product’s design, and guides the development to areas that will have the most impact.

‍

Building trust

For secure communications, digital systems rely on carefully designed cryptography – a specialist branch of complex mathematics combined with careful software engineering. Cryptography is used everywhere. For example, your web browser is using several different kinds of cryptography to deliver this article to you right now.

But how does the browser know that you’ve connected to the real Ingenuity website, and not some impostor trying to trick you? It all comes down to trust, implemented via cryptography. In the case of web browsers, there is a small set of tightly controlled cryptographic certificates which the browser software has been preconfigured to trust. These are “root certificate authorities”, which in turn have been used to sign various intermediate certificates, one of which has been used to sign the certificate used for ingenuitydesigngroup.com. Our website admins have sufficiently proved to one of these authorities that we are the owners of our domain name, and so that authority has signed our certificate. Your web browser checks the signature from our web server when it initiates the connection, sees that our certificate is trusted and confirms that the signature matches the known root certificate authorities that the browser has been preconfigured with. In this way, so long as you can trust your web browser and the various root certificate authorities, then you can trust that your connection to our website is secure.

Trust is incredibly important for all sorts of systems, not just web browsers. Once your device is out in the field, especially if it’s connecting over the Internet, it’s vital that you can trust it hasn’t been tampered with and is sending and receiving truthful and legitimate information. Even if it’s not sensitive personal information, there’s still likely to be large impacts to business based on what might seem like low-risk sensor data. Ultimately, trust has to be built into the device itself. Verifying that the device, its software, and the data it exchanges are legitimate is fundamental to building secure and reliable IoT systems.

‍

Root of trust: starts at boot

In the browser example above, we’ve seen how web browsers ensure the trustworthiness of an outgoing HTTPS connection by using a chain of digital signatures all the way through to a trusted root certificate. An IoT device out in the field can use a very similar layered approach for ensuring the veracity of the software that it runs and any connections that it makes – the main difference is that you as the owner of the device are responsible for the whole chain of trust, instead of a browser vendor.

The concept of a “root of trust” is a powerful mechanism for secure communications, but it also creates a chicken-and-egg sort of scenario: you need to trust something (i.e. the root of trust) in order to be able to trust something else. But how do you ensure that this root certificate can be trusted? For an embedded device, this problem can be solved through a secure boot system.

As a concept, secure boot means that a system can only run code which has been marked as trusted by the builder of the system. Since this is the “root” of the trust, this part needs the most hardening and protection. In the case of TF-M, this protection can be achieved using Arm TrustZone hardware support. The exact details are quite complex, but this is a brief overview:

This first stage of the booting process uses special read-only keys that are programmed into the hardware during manufacturing. The hardware is designed to prevent these keys from being altered.

Once this first stage is complete, the system verifies the next piece of software in the boot chain. For TF-M this is the MCUboot bootloader. This software has more capabilities, and can do things like checking multiple different stored applications to see which is the latest version, and will verify the application is trusted before running it.

If all checks pass, the application can now be trusted because its signatures have been verified all the way back to the immutable keys baked into the hardware. If something is wrong, then the bootloader will refuse to continue. Depending on the configuration the system may have an automatic recovery mechanism: for example, if the bootloader cannot verify a newly updated firmware image it may instead roll back to an older image which is still trusted.

‍

Secure from chip to cloud

Once a trusted foundation has been established, your IoT device and any supporting back-end server applications can now communicate more securely, exchanging data and control commands with greater confidence. Your Zephyr application can use the cryptographic functions of TF-M to implement security features like unique device certificates, authenticated server connections, or signed firmware updates – all of which can help to mitigate the risks identified in your threat model.

A unique device certificate can be used by the back-end server to verify the identity of each device, and the authenticity of the data it is uploading. This ensures that the device connecting to the system is genuinely the device it claims to be.

Authenticated server connections are a simpler version of the web browser example detailed earlier in this article, third-party root of trust. Instead, the system uses its own trusted certificates, giving you complete control.

Signed firmware updates provide a robust mechanism to distribute new firmware, even when the update is delivered over an inherently untrusted channel such as the Internet. The firmware update has a signature which is verified against the root of trust to confirm that it has not been modified in transit.

‍

Embedded cryptography is complicated

As we’ve discussed, secure boot and hardware security is incredibly useful, but it’s also very complex! A vulnerability at any part of the process could compromise the whole thing, which is why using carefully audited and verified software is essential. The Trusted Firmware-M project, for example, has been around since 2020 and is actively maintained by developers at Arm as well as vendors like ST, Nordic, and NXP.

However, using TF-M with Zephyr for your IoT device is just the start, not the end. To run a secure system you are responsible for your own chains of trust, the complexity of which depends on the use cases and threat model of your system. You also need to consider the limited resources available on embedded devices, in particular the flash and RAM size, and possibly also battery life.

‍

Conclusion

There's lots to consider when implementing a secure IoT system, from hardware and firmware through to communications and back-end infrastructure. The right approach will vary depending on the use case and threat model, but security needs to be designed into the system from the beginning - hardware choices have just as much impact as firmware development, and even the industrial design of an IoT device can impact the threats it faces.

Multidisciplinary expertise is invaluable, and this is where Ingenuity can help: our team has experts across embedded firmware, server software, electrical design, and industrial design.

The cost of a security breach can be enormous. You don't want to be in tomorrow's headlines for the wrong reasons. Don't leave it to chance, ensure your next IoT project considers security from the start.

Recent insights

View most recent insights
An image of a Flex PCB
October 26, 2026
Articles

Beyond the Circuit Board: New Possibilities in Flexible and Embedded Electronics

September 25, 2026
Articles

A Guide To Design for Intrinsic Safety

July 1, 2026
Articles

GaN Thermal Design: Beyond the Heatsink

View most recent insights