The basics of cryptography beyond encryption.
In the previous blog post, “Securing Offload Engines for a Robust Secure SoC System,” we briefly looked at some of the methods employed for achieving embedded security, i.e., cryptography, hardware partitioning and isolation, and hardware root of trust. In this blog, and subsequent blogs, we will explore more about each of these approaches in detail.
Cryptography is not a new concept. It’s been around for ages. Cryptography can be employed for securing firmware, proprietary IP and sensitive data. Proper implementation of cryptography ensures confidentiality, integrity, and authenticity, or in short, “CIA.”
Fig. 1: Depiction of cryptography.
Encryption is converting information that is in a readable plaintext format into an unreadable ciphertext format by use of mathematical algorithms or ciphers and unique keys. The ciphertext can only be read by those who have knowledge of the algorithm and the keys used for encryption. There are essentially two ways to implement encryption:
Fig. 2: Symmetric cryptography.
Fig. 3: Asymmetric cryptography.
When we mention cryptography, often only encryption that comes to mind. However, the other important aspect of cryptography is hashing, which addresses authentication and integrity in CIA. A hash is fixed-length random-looking code that serves as a thumbprint for data of arbitrary length. The most important property of a hash is that it is unique. No two different data sets can have the same hash. Because of this property, hash functions are used as an integrity check of data, ensuring it has not been modified.
In addition to an integrity check, hashing in combination with symmetric key or public key cryptography can be used to create a unique digital signature for authentication. The hash of the resource is first computed using a hash function such as SHA-1, SHA-256 or SHA-3. This computed hash value is then encrypted using the crypto key. This serves as the digital signature, also known as message authentication code or MAC, which is appended to the resource.
Fig. 5: Digital signing process, public key cryptography.
Now, whenever, the resource needs to be used, it must go through a three-step process. The first step is to decrypt the signature using the crypto keys to extract the original hash value. The second step is to compute another hash value of the resource and, finally, compare the resulting hash value with the extracted hash value to confirm the integrity of the resource, i.e., to show that it has not been tampered with and that the source of the resource is authentic.
Fig. 6: Authentication process, public key cryptography.
Now that we have covered the basics on cryptography, we will look at how cryptography can be implemented with Cadence’s Tensilica processors in the next blog post.
References
Leave a Reply