When it comes to updating a device's internal software, we can't afford to be naive. Imagine installing an update on your router or car and, without realizing it, you've installed a Trojan horse that holds the keys to your entire system—a real mess. To avoid these kinds of surprises, there are two essential tools that work together: the hash and the digital signature . These essentially tell us if a file is who it claims to be and if someone has tampered with it along the way.
Understanding these concepts isn't just for NASA engineers; it's vital for anyone managing embedded systems or IoT. In this article, we'll thoroughly explain how this process works, from generating an alphanumeric fingerprint to implementing post-quantum security standards , so you don't get misled and know exactly how to protect your supply chain.
What on earth is a hash and how does it protect us?
To start with the basics, a hash is like a digital fingerprint. It's obtained through a mathematical algorithm that takes a bunch of data (a firmware file, for example) and converts it into a fixed-length alphanumeric string . It doesn't matter if the firmware is a few kilobytes or several gigabytes in size; the result will always be the same.
These functions have properties that are incredibly useful for security. First, they are unidirectional , meaning you can extract the hash of the file, but it's impossible to reconstruct the file from the hash. Second, they are deterministic : if you process the same file a million times, the result will be identical. And most importantly, they are unique ; if you change a single comma or a single bit of the code, the resulting hash will be completely different, allowing us to detect any tampering instantly.
There are several types of hash algorithms, although not all are reliable today. The old MD5 hash was very popular, but now it's only used where high security isn't necessary because it's easy to cheat. In contrast, the SHA (Secure Hash Algorithm) family , especially SHA-256 and SHA-384, are currently the dominant algorithms due to their robustness and are the foundation of technologies like Bitcoin.

The digital signature process: much more than a hash
If the hash tells us that the file hasn't changed, the digital signature tells us who signed the package . This is where public-key (or asymmetric) cryptography comes in. The process is simple yet brilliant: the firmware developer doesn't encrypt the entire file (because that would be incredibly slow), but rather encrypts only the firmware's hash using their private key.
When the device receives the update, it performs the following technical process: first, it generates its own hash of the received file, and then it uses the manufacturer's public key (which is already stored in the hardware) to decrypt the signature. If the hash the device has calculated matches the one it decrypted from the signature, then it's a green light: the file is authentic and hasn't been modified.
This system provides us with three basic pillars: authentication , which confirms the origin; integrity , which ensures that the code is intact; and non-repudiation , which means that the manufacturer cannot claim they did not send the firmware if it was signed with their private key.
The critical importance of HSMs and safe startup
This is where things get serious. The private signing key is, quite literally, the crown jewel. If a hacker manages to steal it, they could sign malicious firmware that any device would accept as legitimate. Since these keys are usually tied to hardware that can't be easily replaced, a theft could be an irreparable disaster.
To prevent the key from ending up on a vulnerable build server or an unsuspecting developer's laptop, Hardware Security Modules (HSMs) are used . These physical devices protect the private key so that it never leaves their contents; signing operations are performed within the module, and everything is logged and audited. It's the only sensible way to manage security in a complex supply chain.
On the other hand, the signature should not be confused with Secure Boot . While the signature is the act of creating the authenticity mark, Secure Boot is the process that verifies it. The device checks each stage of the boot process, from the immutable ROM to the application firmware, ensuring that there are no unsigned vulnerabilities through which a rootkit could infiltrate.

The challenge of quantum computing and the future of firmware
It sounds like science fiction, but quantum computers are already on the radar. Algorithms like RSA or ECDSA, which we use today, could be vulnerable to Shor's algorithm, allowing an attacker to forge digital signatures in the blink of an eye. In devices with extremely long lifespans, such as cars or industrial machinery that will last until 2040, this is a real problem.
To avoid falling behind, post-quantum cryptography is being promoted . The NSA, through its CNSA 2.0 guide, recommends moving to hash-based signatures, which are much more robust. This is where options like LMS and XMSS (standardized in NIST SP 800-208) come into play. Although they require complex state management by the signer, they are ideal for firmware because they are updated infrequently.
There are also alternatives like SLH-DSA , which avoids the complexity of state management, or ML-DSA , which is the general approach based on lattices. The key now is to design hardware with cryptoagility , meaning hardware that allows for updating signature algorithms without having to discard the device if an algorithm becomes obsolete.
Real-world applications in IoT, Automotive and ROMs
In the world of the Internet of Things (IoT) , unsigned updates are an open door to creating massive botnets . Within the automotive sector, regulations such as UNECE R155 mandate mitigating any risk of firmware modification to prevent catastrophic accidents. In these cases, security is not just about protecting data, but about saving lives.
Interestingly, this concept is also seen in the world of retro gaming. To verify that a Game Boy or NES ROM is an exact copy and not a modified version, standard hashes like MD5 are used. Tools and scripts exist that compare the hashes of an entire library against official databases to ensure that the files are valid and not corrupted.
This entire security architecture, from the initial hash generation to post-quantum verification in the hardware, forms a robust shield. By combining keys protected by HSMs , modern SHA algorithms, and a secure boot process, it ensures that the technology around us is reliable and resilient against any attempt at digital sabotage.
Table of Contents


