Build More-Effective Smart Devices: Part 2 – Secure Design

Contributed By Digi-Key's North American Editors

Editor’s note: This three-part series looks at building more-effective smart devices. Part 1 discusses low-power design techniques for balancing power and performance. Part 2 (here) addresses meeting the challenges of user transparent security. Part 3 reviews the MCU specifications required to meet the design objectives.

Designers of IoT connected devices such as wearables increasingly recognize the need for security and authentication in the face of threats to data confidentiality, integrity, and authenticity. However, the challenge is to secure devices while consuming minimal power and without compromising the user experience.

The ability to conform to user expectations is particularly important in the design of battery-powered wearables or IoT devices intended to replace conventional products.

Location-tracking fitness wearables, electronic locks, and other devices have significant implications on the user's wellbeing and safety in the real world, and in a globally connected virtual community. Yet, an effective security solution not only needs to meet technical requirements, but also do so in a way that’s intuitive to the user. Complex sequences of taps or the need to attach a hardware dongle to manage security, compromise the user experience and ultimately the manufacturer's revenue stream.

However, using security features in MCUs and specialized ICs, developers can address increasing security concerns without compromising user expectations for smart products.

Invisible intelligence

In conforming to this broader set of user expectations, security shares many of the design challenges found in the design of low-power smart devices. Designers must find solutions to these challenges in a way that works seamlessly in the user's world by embedding a kind of invisible intelligence in the smart product design.

This requirement for invisible robust security is no longer an option. No company can afford the damage to revenue or reputation if security flaws in their products undermine user data integrity or damage the devices themselves. Users reasonably expect that their smart products will protect their data and their very operation from cyberattacks.

For designers, this expectation translates into a need to support the fundamental tenets of security:

  • Confidentiality to prevent unauthorized access to data
  • Integrity of data and operational instructions to prevent modification
  • Authenticity of messages or commands to ensure their validity

Failure to meet basic expectations for the security of connected products quickly finds its way into national headlines with disconcerting frequency.

At a fundamental level, these same concerns show up in product failures arising from the use of counterfeit parts and consumables in familiar products such as printers, or mission-critical products such as medical equipment. Although rarely gaining the same attention as hacked electronic systems, these counterfeits can severely impact users and companies, resulting in losses no less keenly felt.

Despite these consequences, development organizations sometimes shy away from employing robust security solutions for multiple reasons. For example, implementing security can add incremental cost to a design as it typically requires a deep background in security mechanisms and protocols.

More recently, however, the availability of security-capable ICs such as Maxim Integrated's Darwin MCUs and specialized security ICs enables developers to support the core security requirements of confidentiality, integrity, and authenticity.

MCU security

The Darwin MCU family is designed specifically to support IoT requirements for security and low power consumption. Along with their low-power features described in “Build More-Effective Smart Devices: Part 1 – Low-Power Design with MCUs and PMICs”, Darwin MCUs including the MAX32620, MAX32625, and MAX32630, feature dedicated Advanced Encryption Standard (AES) hardware that supports key sizes of 128-, 192-, and 256-bits, conforming to NIST FIPS 197. While the AES engine in these MCUs supports confidentiality, secure versions of Darwin MCUs such as the MAX32631 also includes a comprehensive trust protection unit (TPU) that extends support for integrity and authenticity (Figure 1).

Diagram of Maxim MAX32631 Darwin MCU

Figure 1: Secure Darwin MCUs such as the MAX32631 provide comprehensive support for confidentiality, integrity and authenticity mechanisms that form the foundation of secure systems. (Image source: Maxim Integrated)

To fully protect a typical transaction between a smart product and a host, multiple security mechanisms are required to ensure confidentiality, integrity, and authenticity. Data encryption using crypto standards such as AES helps ensure confidentiality. Generation of message signatures are needed to ensure integrity. Use of asymmetric authentication methods such as the elliptic curve digital signature algorithm (ECDSA) are fundamental in authentication protocols.

These same mechanisms provide the security foundation for any operation involving a smart product, whether it is commissioning a new smart product into a network, securing ongoing communications between the product and other resources, or reliably performing over-the-air updates of product firmware.

As such, the ability to support these algorithms in a smart product without complicating the design for developers or interfering with a users' product interaction, is critical.

The TPU built into the MAX32631 and other secure Darwin MCUs provides multiple hardware features needed to support these algorithms. At the heart of the TPU, the modular arithmetic accelerator (MAA) module executes these complex algorithms with the high performance necessary to ensure that security proceeds invisibly, exerting no impact or delay on the application for the user. As with the AES engine, the MAA performs its calculations without any CPU involvement, further speeding application performance. Developers need only load keys and input parameters into memory-mapped registers dedicated to each engine. On completion of the desired operation for each engine, the results are available in the respective mapped register set.

Although hardware-accelerated security algorithms are essential for performance, their effectiveness in turn depends on a true random number generator (TRNG) and secure key storage. Random numbers play an important role in security mechanisms used in authentication-based protocols, including generation of cryptographic keys. Yet, conventional random number generation algorithms inevitably produce a repeatable pattern or known distribution that hackers could exploit to reverse engineer the private key. For this reason, a TRNG is a fundamental building block of any secure system.

TRNGs typically combine conventional pseudo-random number generator (PRNG) algorithms with high entropy sources, such as thermal noise in a semiconductor, to blur any innate patterns in the generated sequence. (Note that Figure 1 refers to the MAX32631 TPU's random number generator as a PRNG, but the use of entropy sources in the device functionally delivers a TRNG.)

Protecting secrets

Although the nature of random number generation can weaken or tighten security, the disposition of private keys is a critical factor in security. Cryptographers have long understood the importance of key protection. In fact, a 19th century axiom, now called Kerckhoffs's Principle, states that even if everything is known about the cryptography system except for its key, the system will remain secure. The use of asymmetric authentication algorithms such as ECDSA indirectly help ensure key security. Unlike symmetric schemes which need to share private keys between communicating systems, asymmetric methods like ECDSA do not need to share this critical data. Even so, the MAX32631 and other secure Darwin MCUs provide more direct support for key security.

As part of the TPU, four 32-bit registers provide dedicated key storage. Consequently, developers can use the device to generate private and public key pairs used in authentication, storing the private key in the secure storage area. This secure key storage area resides in the "always-on" power domain in the Darwin power ecosystem. Consequently, the MAX32631 MCU can retain this secure data even in its lowest power mode. Still, this data would be lost if supply current falls below the nominal 600 nanoamp (nA) level required to maintain this power mode.

Besides their accelerators and support features, secure Darwin MCUs provide two additional security mechanisms. The first helps to obscure software and data. To do this, the MCU automatically scrambles all code and data, in terms of both content and location, before storing either in its internal flash. Then, as code or data are fetched from internal flash, the device automatically descrambles them. These scrambled writes and descrambled reads all happen transparently. This automated protection applies only to code and code stored in the MCU's internal flash.

Developers can nevertheless use the MCU's security mechanisms to implement similar mechanisms for data stored in external flash. At the same time, code stored in external flash must remain unencrypted to take advantage of Darwin's built-in execute-in-place (XIP) capability for running application code directly from external flash.

The second security feature operates at the level of the MCU architecture itself. As part of the TPU support circuitry, Maxim Integrated incorporates a dedicated clock source called the Crypto Oscillator (Figure 2). Running at 44 MHz, this oscillator provides a timing source for TPU functions including the AES and MAA engines as well as the TRNG module.

Diagram of Maxim MAX32631 secure Darwin MCU

Figure 2: Secure Darwin MCUs such as the MAX32631 include an isolated relaxation oscillator that clocks the trust protection unit (TPU), reducing the device's vulnerability to side-channel threats such as timing attacks. (Image source: Maxim Integrated)

The Crypto Oscillator does not use an external oscillator, but instead relies on an internal relaxation oscillator. As a result, TPU functions proceed in a consistent fashion regardless of the current system clock rate. Because the Crypto Oscillator's timing cannot be observed from outside of the chip, this approach helps reduce threats from timing or power analysis attacks often used by determined hackers.

Implementing authentication

With their extensive capabilities, secure Darwin MCUs such the MAX32631 can provide a robust platform for smart products. Using the Maxim Integrated MAX32631-EVKIT development kit, developers can rapidly gain experience with the comprehensive security features built into this MCU.

Yet, not every application that requires some form of security necessarily requires a comprehensive MCU-based design. For example, ensuring use of authorized consumables or other peripherals typically requires only an authentication mechanism built into the peripheral. For these applications, developers can quickly create a secure, cost-effective solution using dedicated authentication ICs such as the Maxim Integrated DS28E15, the DS28C36, or the 1-Wire capable variant, the DS28E36.

In the past, peripheral validation relied largely on unique serial numbers built into the peripheral. Using algorithmic methods or lookup tables, host devices would use those IDs to confirm the peripheral. Counterfeiters easily spoofed these methods by burning valid IDs into unauthorized products. With the availability of the DS28E15, DS28C36, and other authentication ICs, developers can protect a peripheral with a single chip (Figure 3).

Diagram of Maxim DS28E15 single-chip authenticator

Figure 3: Single-chip authenticators such as the DS28E15 enable developers to easily add authentication features to peripherals and consumables such as battery packs. (Image source: Maxim Integrated)

The DS28E15 and DS28C36, respectively, support symmetric and asymmetric authentication, providing developers with a drop-in solution for the authentication method best suited to their application. Developers can quickly explore these authentication methods and other device features using Maxim Integrated's DS28E15EVKIT development kit for the DS28E15, and the MAXAUTHDEMO1 development kit for the DS28C36.

As found with these kits, hardware implementation with these devices is straightforward because each chip provides a complete authentication solution. Each device integrates a hardware authentication engine and EEPROM. For symmetric authentication, the DS28E15 supports FIPS 180-3 Secure Hash Algorithm (SHA-256) authentication using a private key stored in its protected memory, with an additional 512-bit EEPROM for protected application data. For asymmetric authentication, the DS28C36 supports ECDSA authentication using an integrated 256-bit elliptic-curve cryptography (ECC) engine, SHA-256 engine, TRNG, and 8 kbits of secure EEPROM.

When using authentication in this type of application, the nature of the authentication protocol is critical for robust security. A significant security vulnerability lies in applications that only authenticate the client to the host, or only authenticate the host to the client (as in most Web browsers).

Instead, two-way authentication is critical to ensure that only an authorized peripheral is connected to the host and that only an authorized host sends commands to the peripheral. Both the DS28E15 and DS28C36 support this two-way authentication protocol.


An expanding array of cyberthreats drives a critical need to build security into any connected device. For users, however, security features need to remain in the background, protecting the device and user data without intruding on the overall product design, or on the user's interaction. Using secure MCUs and authentication ICs from Maxim Integrated, developers can overcome traditional barriers to security implementation, creating designs that add invisible intelligence to smart products.


Disclaimer: The opinions, beliefs, and viewpoints expressed by the various authors and/or forum participants on this website do not necessarily reflect the opinions, beliefs, and viewpoints of Digi-Key Electronics or official policies of Digi-Key Electronics.

About this publisher

Digi-Key's North American Editors