Security first!

04/25/2019 Know-How

The more powerful and all-embracing the Internet becomes, and the more advanced the components that make connected devices “smart” become, the more areas of application are being opened up. In combination with software, microcontrollers form the heart and soul of sensor technology within Industry 4.0 and IoT technologies. While the connectivity of smart factories and smart homes offers immense potential for growth and innovation – it also makes them vulnerable to attack.

Focus on microcontrollers

Microcontrollers are increasingly becoming the shield against manipulation and cyber attacks in the context of the IoT, Industry 4.0, and robotics. Some microcontroller families already incorporate an array of security features. Microcontrollers are the key control components in connected systems. Suppliers are already employing development processes certified in line with the relevant security standards. Through their secured manufacturing chains, semiconductor suppliers also assure that they can offer their customers a secure end-to-end solution.

Microcontrollers can be categorized in terms of security according to their target applications:

  • Authentication solutions and TPMs (trusted platform modules), such as for brand protection and IoT networks
  • Banking and identification solutions for classic smartcard companies in the payment processing, personal ID, transport, and pay-TV sectors
  • Mobile security solutions for SIM-based solutions in mobile products and machine-to-machine (M2M) applications
  • Automotive solutions for near-field communication (NFC, eSE) and secure driving

Integrated data security features

The IoT, Industry 4.0, and robotics mostly use standard microcontrollers for industrial and consumer applications (general purpose microcontrollers). Models with integrated security features are also already available. The STM32 family, for example, has many features offering protection against:

  • Identity theft (protection against manipulation, integrity protection, traceability)
  • Denial of data service (throttling)
  • Data and code spying and manipulation (memory protection, rights management, debug level, protection against manipulation, integrity protection, secure firmware updates)
  • Physical/mechanical attack (on-chip manipulation protection)

These features are primarily implemented by on-chip integration. They ensure robust authentication, platform integrity, and through-going data security, including the resultant protection of end users' privacy as well as comprehensive data, IP, and branding protection - and as such meet the highest data security demands for standard products. Typical target applications include, e.g., printers, computers, gateways, IoT end points, and sensors.

Hardware-based functions

Integrity and operational safety: The cyclic redundancy check calculates a checksum which identifies errors in data transfer or storage. This not only provides an integrity check, but also means a signature of the software can be calculated during its runtime. Power monitoring is a high-security method (POR (power on RESET)/PDR (power down RESET)/BOR (brown out RESET)/PVD (programmable voltage detector) flag status) for determining the reason for a reset and thus ensuring that the reset is carried out by authenticated access. It is complemented by the "Read while Write" function for efficient detection of manipulation and logging.

The functionality of the Clock Security System (CSS) is based on the fact that both the clock and the system to restore it, as well as the internal and external clocks, each work independently of each other. The Watchdog and the Window Watchdog likewise monitor the time windows independently of each other.

The integrity and trustworthiness of the memory contents is assured by the Error Correction Code (ECC) and the parity check. They also provide added protection against attack aimed at infecting systems with bugs. A temperature sensor continuously measures the ambient temperature of the IC to ensure it remains within the specified range, thereby avoiding the risk of lasting damage by targeted heating.

Encryption - but done correctly

Encryption techniques protect a source text against unauthorized access by encoding the original plain text. Anyone who cracks the code can thus also decipher the encrypted text. More advanced encryption techniques employ symmetrical or asymmetrical encryption. In the symmetrical method, there is only one key for both encryption and decryption, meaning the sender and recipient use the same key. In the asymmetrical method, each of the communicating parties uses their own key, with which a key pair is created. This consists of a public key with which data is encrypted and a private key to decrypt it.

In some STM32 series, a genuine random number generator is fully integrated into the chip for encryption purposes. The encryption is based on the symmetrical Advanced Encryption Standard (AES). The STM32 F2, F4, F7, L4 series feature keys optionally of 128/256bit in length, employing various methods (ECB, CBC, CTR, GCM, GMAC, CMAC), while 128bit AES is implemented in the STM32 L0 / L1 series.

Advantage of the symmetrical method: As there is only one key, key management is simpler than with the asymmetrical method. Also, the encryption and decryption is executed much faster. Some STM32 models additionally feature a fully integrated hash function. In this, data is chopped up and scattered, and the function maps a large input volume to a smaller target volume. There is also the Keyed-Hash Message Authentication Code (HMAC). The structuring of this <link de.wikipedia.org/wiki/Message_Authentication_Code - - "Message Authentication Code">Message Authentication Code</link> (MAC) is based on a <link de.wikipedia.org/wiki/Kryptologische_Hash-Funktion - - "Cryptographic hash function">cryptographic hash function</link>. The HMACs are specified in <link de.wikipedia.org/wiki/Request_for_Comments - - "Request for Comments">RFC</link> (Request for Comments) 2104 and in <link de.wikipedia.org/wiki/NIST - - NIST>NIST</link> (National Institute of Standards and Technology) standard FIPS 198.

Preventing manipulation

Protection against manipulation involves defense mechanisms to prevent intentionally or unintentionally launched physical attacks on the hardware system outside the microcontroller. The Backup Domain, linked to various wake-up sources, ensures that protection is also maintained in Low Power mode. The Real Time Clock (RTC) assigns a time stamp to each manipulation event. Some STM32 series also have an RTC register protection function. It blocks illicit writing and works independently of the system reset. This does not, however, include protection when typing a key sequence. When a manipulation has been detected, the protection register ensures that the content written in the course of it is automatically deleted. Additionally, specific communication channels can be closed by a GPIO configuration lock. It blocks selected general-purpose inputs/outputs (GPIOs). The lock can be canceled on the next reset.

Other weapons defending against attack

The debug lock prevents unauthorized access to the microcontroller via a debug interface. The security level is selectable depending on the application and the requirements, though it cannot be scaled back again afterwards.

Access rights authorize users or groups of users to carry out specific actions. To that end, the integrated Memory Protection Unit (MPU) divides the memory into regions with differing rights and access rules.

When a data transfer is carried out, the firewall protects the code or data part of the flash memory, or SRAM, against the code (fragments) running outside the protected sector. The firewall is more restrictive than the MPU; it is only integrated in the STM32L0 and L4.

A read protection function is used to manage memory access control. It might be that this prevents memory dumps, such as backups of user IPs. Write protection protects each sector against unwanted write operations. Proprietary code protection allows each memory sector to be configured as "execute only", meaning code can only be run in it, not written.

The mass erase and secure erase functions enable IPs and confidential data to be deleted safely; the action resets the memory completely to its factory defaults.

To ensure traceability of an end product, many STM32 series feature a 96bit unique ID. This can also be used to diversify security keys.

Many series additionally incorporate secure firmware update functions. The hardware security functions can be expanded further by software-based measures.

The security of an end product against manipulation by third parties is based on the software solutions implemented and the electronic hardware components used. Microcontrollers and memory chips - where appropriate in combination with sensors and application-specific ICs - are key to IoT applications and Industry 4.0 alike. In connection with the EU General Data Protection Regulation (GDPR) which came into force on May 25, 2018, Rutronik has compiled a set of integrated security features for microcontroller families: It includes tables listing systems for protection against manipulation, encryption modules, permission management, debug lock level, memory protection, as well as integrity and functional safety.

Evaluation of the security-relevant features listed in a table with regard to integrated data security within the Rutronik microcontroller portfolio provides informative insights: Like various STM32 microcontroller families, selected microcontrollers of the introduced Renesas Rx family and the Synergy S1/S3 family also offer an above-average degree of coverage with regard to security features.

Selected microcontrollers in the Synergy S5/S7 category (Renesas) even meet this requirement fully. In addition, fully integrated support for both symmetrical and asymmetrical encryption methods, including integrated key generation based on AES (128/192/256), 3DES/ARC4 or RSA/DAS or DLP, should be emphasized here. The Rx family can be seen as a pioneer in terms of full coverage of various security features as well as support for integrated mechanisms for symmetric and asymmetric encryption.

Infineon's XMC-1xxx and XMC-4xxx series also offer extensive integrated security data protection, as can be seen in the table on pages 74/75 of the Security Aspects brochure. Within the context of special requirements for symmetrical or asymmetrical encryption, the supplier refers to the Crypto software package. Based on their own assessment of security risks for the end product and its component parts, developers can see at a glance which microcontrollers can potentially be used to ensure compliance with the GDPR in a board design.

If the developer defines security requirements for the end product, the Rutronik product portfolio offers a wide variety of microcontroller families from semiconductor suppliers that meet the challenges of GDPR legislation by integrating security-relevant features.

In summary, the key finding in relation to Industry 4.0 remains that data and services are not a product but a platform business. In the future, it will be less about selling machinery to generate high revenues. Rather, a wide variety of different data-generating machines will be installed on-site, and the platform operator will primarily earn money from the customer through the related data services. This will mark a revolutionary change to business models in the traditional plant and machinery manufacturing industry and its component suppliers.

Find components at <link www.rutronik24.com _blank external-link-new-window "open internal link">www.rutronik24.com</link>.

Subscribe to our <link www.rutronik.com/newsletter _blank external-link-new-window "open internal link">newsletter</link> and stay updated.