With security becoming a growing concern in the Internet of Things (IoT) industry, increased focus has been placed on hardware security, as it shows real promise in helping to secure devices from cyberattacks. In this article, we will look at examples of existing hardware security solutions and how they are used to secure IoT devices.
The Rise of Hardware Security
The proliferation of IoT devices and solutions has opened up many opportunities to technological development, including data for training artificial intelligence and the ability to remotely monitor and control processes. However, IoT technologies are a double-edged sword, as they also provide opportunities for cybercriminals in the form of mass distributed-denial-of-service (DDoS) attacks, data theft, network hacking, and privacy invasion. While some of these attacks can be prevented with the use of software-based security, they cannot defend from all attacks.
For example, an IoT device could be used for secure data transmissions, but if the device’s hardware is physically attacked, then no amount of software routine can provide protection. This is where hardware security comes in and why it is becoming increasingly popular with SoCs, microcontrollers and microprocessors. Traditionally, hardware security would consist of hardware that can speed up software security such as encryption engines, but designers are taking this further and beginning to create systems that protect the very metal itself.
Types of Hardware Security Attacks
Hardware attacks do not appear in the news often — this may be because getting physical access to a device can be a difficult task to achieve. For example, hacking into an email account may be done in a wide variety of ways over an internet connection, but the theft of a laptop to access emails stored on the system is a whole other task. But even when a device can be obtained physically, it usually doesn’t require much skill to gain access to all the data on that device.
Side-Channel Attack
A side-channel attack is one type, in which a very secure system is indirectly attacked through insecure subsystems that are outside the secure system. For example, a password-protected user account on Windows can have its files easily accessed if the hard drive is removed and plugged into another computer. The attacker simply needs to “take ownership” of the folder, and suddenly, all files are made accessible. The password to the user’s account, which is secure, is not required, and the secure system is easily bypassed.
Rowhammer Attack
The rowhammer attack is a particular exploit that applies to high-density DRAM. Thanks to the increasing transistor count and feature reduction size on silicon wafers, memory cells in a modern DRAM chip are incredibly close together. In fact, DRAM cells are now so close together that cells have a small chance of changing the value of neighbor cells.
A rowhammer attack exploits this issue and can be used to change the value of “protected” rows of memory by altering the value of memory contents in neighboring rows. The ability for an attacker to inject values into protected spaces, which they do not have access to, can in theory be used to bypass security systems and inject malicious code into applications that may have kernel-level privileges.
Examples of Hardware Security Devices
To protect devices against hardware attacks, designers can deploy hardware security measures into the silicon itself that run outside of the software realm. So what examples currently exist in the hardware realm for security?
Crypto Acceleration
As discussed before, this is one of the earliest forms of hardware security and is more of a peripheral than a hardware defense. Crypto acceleration is hardware that performs cryptographic functions in hardware instead of software, which not only speeds up applications but also provides hardware with systems that cannot be exploited in software.
For example, a software version of AES may be subjected to code injection whereby the encrypted result is easily reversible by the attacker, but a hardware version of AES is immutable and cannot be attacked.
True Random-Number Generators
While a random-number generator can be thought of as cryptographic acceleration, it is important enough to have its own category. Almost all forms of encryption rely on random numbers, and the more random a number is, the better the encryption using that number will be. Random-number generators that are written in software almost always use time as their seed and therefore can be easy for an attacker to attack.
One example of a situation in which random numbers were incorrectly used was when two security experts were able to remotely hack a Jeep and take full control of the vehicle. The attack was achieved by connecting to the car’s multimedia system and using that connection to send messages over the car’s CAN bus. This resulted in the hackers having control over the car’s steering, brakes, and accelerator.
This attack was only possible thanks to the method in which the cars Wi-Fi password was generated, which was supposed to be “random.” The Wi-Fi password was generated based on the date and time that the multimedia system was first turned on in the car. Normally, this would be secure, but because the manufactured date and time of a car can easily be determined by year and month, an attacker has to address only 15 million combinations. If the time of day can be guessed correctly, there are only 7 million possibilities, and 7 million Wi-Fi passwords can be brute-force attacked in an hour. Had true random numbers been used, this Wi-Fi password would be very hard to crack. But because it was based on non-random elements, it was easily bypassed.
Memory Encryption
Encryption of data goes back thousands of years, with cyphers being used to obscure information from prying eyes. The same goes for computer information with transmitted data often being encrypted before being sent. However, this method of encryption is starting to move toward data storage in memory, with both ROM and RAM now having encryption options. Taking this approach allows for designers to ensure that if an attacker obtains the contents of either RAM or ROM, the information itself is unreadable without access to the correct hardware.
Memory protection itself is not new, with many microcontrollers including read-protect bits that prevent others from cloning firmware. The encryption of flash is also not new, with many FPGAs supporting encryption of configuration flash memory. However, this new wave of memory encryption is on-the-fly and allows for almost identical access speeds.
Secure Boot
One major problem faced with nearly all processors: How can a processor be sure that the code it has booted is authentic and non-malicious? While the core boot code of any system can never be checked for authenticity, further boot stages can be, and most attackers will attempt to inject code into either the core boot code or the application that gets loaded afterwards.
To prevent this, designers have introduced secure boot methods in processors that start by running boot code that is immutable and therefore immune to code-injection attacks. This boot code then looks at the application that is about to be loaded and checks the code’s integrity. If injected code is detected, the system can either run in a limited state or provide warnings to an operating system that code integrity issues have been detected.
Trust Zones
Trust zones are somewhat new to microcontrollers, though they are a very old technique in processors. Trust zones help to solve the problem with processors in that they are unaware of the code that they run if that code is malicious.
Now, it is worth noting that not all CPU instructions are inherently dangerous. But some can be, and these may include access to hardware, the stack pointer, or critical systems. Therefore, modern processors have levels of privilege whereby the OS runs on the highest privilege and has access to all instructions, while processes that the OS executes are put into a lower privilege. These processes cannot access sensitive instructions and are therefore less able to cause damage or attack critical systems on a processor.
Today, many SoCs and microcontrollers are introducing these zones into their cores whereby an OS will run on one core while processes will either run on the same core with fewer privileges or on a secondary core with some features removed.
Tamper Pins
Tamper pins are a highly useful hardware feature, as they are hard to detect and prevent. Some hardware attacks require the attacker to physically remove parts for gaining access to I/O such as debug ports and memory channels. Depending on the device, a tamper pin is one that can detect when an external mechanical event has occurred, such as the opening of an enclosure. Once detected, the tamper pin can instruct the processor to perform a special routine, whether it be a simple reboot to prevent sensitive data from being read to a more drastic action such as a complete memory wipe. Tamper pins can also be used on obscure pins that may appear to do nothing to the attacker and therefore go unnoticed.
Advanced Hardware Security Solutions: Bus Monitors
All of the examples of hardware security we have seen thus far are often combined into a single package and provide users with a range of security options. However, there is a new type of hardware security slowly being introduced that brings security into a whole new paradigm: bus monitors.
Bus monitors are highly advanced security systems that are integrated directly into the SoC of a microcontroller and operate independently of the system. Bus monitors are connected to multiple internal buses and connections, including I/O pins, registers, internal data buses, and programming ports. Under nominal operation, the internal connections of the die create a steady state that the bus monitor learns from. When malicious code is injected, or when there is a hardware attack on a pin, the steady state of the bus monitor is disturbed. This causes the bus monitor to take action against the anomaly. Depending on the bus monitor, some can raise exceptions with the OS, while others can cause the system to reset. Some bus monitors can even divert potentially malicious register requests away from the processor and return null values while logging the attempted attack.
Conclusion
While the implementation of hardware security solutions and devices will make silicon more expensive, the benefits of having hardware-based security will see designs become more secure. Software security can only do so much, and a system that is entirely based on software security will be an easy target for an attacker, while those that integrate hardware security will be significantly stronger.
Indeed, the ability to encrypt memory on the fly helps to secure devices in the long term and gives comfort to those who want to dispose of electronics without leaking information. Technologies such as bus monitors will give rise to more intelligent security systems that can learn about attacks and be able to pre-emptively prevent future attacks by recognizing pattern signals.
Overall, hardware security will become the standard in security practices, and devices that don’t integrate such features will be restricted to basic operation and tasks.
