Learn Cryptography technology in embedded through DIY projects using ElecronicsV3 Development Board

The more realistic you get, the more distinct you become in modern world Gettobyte What is SHE (Security Hardware Extension) Technology? Secure Hardware Extension, short form SHE: is a standard that specifies performing basic cryptography ciphers and managing cryptography keys via automotive Microcontrollers. SHE has been stated as standard in automotive microcontrollers to protect the cryptographic keys from software attacks by hardening them into the memory of the microcontroller and to perform basic symmetric cryptographic ciphers like AES & CMAC for encrypting and decrypting the data. SHE standard is implemented in microcontrollers by having an on-chip extension(peripheral) as a security subsystem which follows, the SHE standard. SHE standard is stated by hersteller-initiative-software (HIS) consortium in April 2009. This consortium was founded in 2004 and consists of members from Audi, BMW, Daimler, Porsche, and Volkswagen to address activities and develop common automotive manufacturing standards. SHE standard states that the peripheral in the Microcontroller should have the following 3 blocks, to implement SHE standard in MCU: Control Logic: Connecting the parts of the CPU to the microcontroller. Storage Area: To keep the cryptographic keys and additional corresponding information. Cryptographic cipher core: a hardware core or module to perform necessary calculations for performing cryptographic ciphers. Automotive Chips, which have SHE peripheral: MPC5646C Freescale MCU’s S32K144 NXP Semiconductor’s MCU Components of SHE Technology SHE Technology Why SHE Technology? Working principal of SHE Technology? USE cases of SHE Technology? How to use SHE Technology? Add Your Heading Text Here

In the new age of autonomous and connected vehicles, cyber-attacks in automotive are happening frequently. Discover in this blog, what technology is used to make our vehicles safe and secure.

Concept of: Cryptography Ciphers: –> Difference between asymmetric and symmetric ciphers. –> Hashing and MACs –> Concept of certificates, digital signatures, and signing 2) Keys in cryptography –> Key storage, Key generation, key derivation, key import, key export, key configuration, key slots shared secret key, master key and etc 3) Attacks in cryptography –> 4) Miscellaneous things: –> Random number generator, Cryptography Ciphers One-way compression functions One-way compression functions: In cryptography, a one-way compression function is a function that transforms two fixed-length inputs into a fixed-length output. One-way compression functions are built from block ciphers. Some methods to turn any normal block cipher into a one-way compression function are Davies–Meyer, Matyas–Meyer–Oseas, Miyaguchi–Preneel (single-block-length compression functions) and MDC-2/Meyer–Schilling, MDC-4, Hirose (double-block-length compression functions). These methods are described in detail further down. Miyaguchi-Preneel Compression function: is used inside SHE standard cryptography A common use of one-way compression functions is inside cryptographic hash functions. Most widely used hash functions, including MD5, SHA-1 (which is deprecated[2]) and SHA-2 use this construction. Using a block cipher to build the one-way compression function for a hash function is usually somewhat slower than using a specially designed one-way compression function in the hash function. This is because all known secure constructions do the key scheduling for each block of the message. Black, Cochran and Shrimpton have shown that it is impossible to construct a one-way compression function that makes only one call to a block cipher with a fixed key.[6] In practice reasonable speeds are achieved provided the key scheduling of the selected block cipher is not a too heavy operation. But, in some cases it is easier because a single implementation of a block cipher can be used for both a block cipher and a hash function. It can also save code space in very tiny embedded systems like for instance smart cards or nodes in cars or other machines A compression function mixes two fixed length inputs and produces a single fixed length output of the same size as one of the inputs. This can also be seen as that the compression function transforms one large fixed-length input into a shorter, fixed-length output. 2) Block Cipher: Block ciphers take (like one-way compression functions) two fixed size inputs (the key and the plaintext) and return one single output (the ciphertext) which is the same size as the input plaintext. modern block ciphers are only partially one-way. That is, given a plaintext and a ciphertext it is infeasible to find a key that encrypts the plaintext to the ciphertext. But, given a ciphertext and a key a matching plaintext can be found simply by using the block cipher’s decryption function. Thus, to turn a block cipher into a one-way compression function some extra operations have to be added. Some methods to turn any normal block cipher into a one-way compression function are Davies–Meyer, Matyas–Meyer–Oseas, Miyaguchi–Preneel (single-block-length compression functions) and MDC-2, MDC-4, Hirose (double-block-length compressions functions. Stream Cipher: AES: ECB mode: CBC mode: MAC generation/verification: Compression Function Cryptographic Keys Types of keys in cryptography: What Is Secret Key Cryptography? A Complete Guide – Helenix Secret Key: the key which is used in symmetric ciphers is a called as secret key. As this is single key which can be used for both encryption/decryptions, thus it is called as secret key. Private key: private key is used in asymmetric key cryptography, where there are 2 different keys for encryption and decryption. Key Usage flags: Different keys are used for different features and specs. So, there are concept of flags through which we can specify which key is to be used for what purpose and its usage limitation. Broadly there are x number of fields in Key usage: Key derivation: A Key derivation function (KDF) is a basic and essential component of cryptographic systems: Its goal is to take a source of initial keying material, usually containing some good amount of randomness, but not distributed uniformly or for which an attacker has some partial knowledge and derive from it one or more cryptographically strong secret keys. There are many forms of KDF’s, and not all functions used as KDF are explicitly named as KDF’s. For instance, the KDF of TLS is simply called “the PRF” for Pseudo-Random-Functions, which is a much more generic term Some KDF’s have input limitations, some have output limitations and not all KDF’s have the same configuration parameters. The base construction of a KDF is: input: a binary encoded secret or key other information to derive a specific key (optional) output size (if configurable) output: a derived key or derived keying material. Furthermore, there are many different parameters possible: a salt work factor (for PBKDF’s) memory usage (for PBKDF’s) parallelism (for PBKDF’s) Cryptography Miscellenous terms Pseudorandom Function Family(PRF):

Table of Contents What is Cryptography Cryptography is a branch of science used to secure communication between two electronic devices, such as cars sending data to one another or an ECU within a car sending data to another ECU. This technology is essential for ensuring the privacy and integrity of data transmission, allowing for secure communication between two parties. How does Cryptography secure the communication? When a sender transmits the original data, known as plaintext, cryptography algorithms are applied to the data to ensure secure transmission. These algorithms are designed to protect the data from unauthorized access, ensuring that only the intended recipient can access the information. By using cryptography algorithms, the data is transformed into an unreadable format, making it virtually impossible for anyone other than the intended recipient to access the data. So as to make that data into encrypted form i.e., in unreadable format. This process is called encryption and unreadable data is called ciphertext. The receiver now receives the ciphertext, which is different from its original message. If an intruder were to gain access to the data during its transmission from sender to receiver, they would not be able to comprehend the actual data as it is encrypted into an unreadable format. This means that the receiver would also be unable to understand the received data, so they must convert it back into its original form, known as plaintext, through decryption. The decryption is also performed using same crypto algorithm which is used at the time of encryption. So, this is how a secure communication is done b/w sender and receiver using cryptography. This is the concept of Encryption & Decrytion. What are Keys in Cryptography? Now one thing to point on this thing is that, if receiver can decrypt the data using crypto algorithm, then some hacker or 3rd person can also do the same. Well, that is not the case, because of concept of keys in cryptography. “Keys are the random string of bytes” which are used during the encryption-decryption by the crypto algorithms to transform the Original Data into Unreadable format & Vica versa. Only the sender and receiver have access to the keys, so only they can encrypt and decrypt the data. However, if someone else were to gain access to these keys, they would be able to access the original data. If the keys were to be exposed, anyone would be able to encrypt and decrypt the data, thus compromising the security of the system. Thus, in cryptography Key Managment, Key Storage, Key Derivation & whole concept of Keys are very important in cryptography. (Would be writing more about crypto keys.) What are Crypto Algorithms?? To give you an idea about crypto algorithms, these are complex & heavy mathematics calculations which uses mathematics concepts like algebraic theory, probability, statistics, discrete math, algebraic geometry, complex analysis, number theory, algorithms, binary numbers, prime factorization, to manipulate the original data. These Crypto Algorithms need mainly 2 inputs: Input data and the Keys. In the case of Encryption Input data would be Plaintext and in the case of decryption Input data would be Ciphertext. Keys would always be used, in either of the case and thus protecting the keys is very crucial part of cryptography. As losing the keys means exposing the original data to would. Crypto Algorithms are also called as ciphers. Some examples: RSA, AES, DES, ECDSA, hashing, CMAC and etc. These algorithms are being categorized in terms of number of bytes of input data and how the keys are used on the input data, as symmetric and asymmetric algorithms. (Would be writing more about and in-depth about crypto algorithms). Implementation of Crypto Algorithms To perform these mathematical concepts, Crypto Algorithms need a heavy amount of processing. We all know, in our web browsers, emails and WhatsApp chats our messages are encrypted and decrypted over the web servers to protect our data. But how does this thing happen in microcontroller level??? So, in MCU/MPU cryptography can be implemented by 2 ways: First by, implementing the crypto-algo through software, in which all mathematical calculations and processing is done on the main CPU only like in the case of Arduino which has dedicated libraries for many crypto Algorithms, for implementing cryptography in Arduino and low-end microcontrollers/applications. But this way the power and time of main CPU is taken very much. Crypto Algorithms takes a heavy amount of processing to perform calculations which takes up a good amount of CPU time & power. In the case of time-critical applications like that Automotive, performing calculations of crypto algorithms & running application code at the same time can be very time-consuming, even a delay of milliseconds(ms) and microseconds(us) can lead to life-threatening for automotive applications. Second, there has to be a certain hardware subsystem (dedicated CPU basically), specially for cryptographic algorithms to achieve the cryptography in fast and efficient way. To Conclude Automotive has revolutionized from traditional times, now there is so much of Automation and Autonomous features like Vehicle-to-Vehicle Connectivity, ADAS, Self-Driving cars and etc. Thus, concerns of safety and cryptography has risen up in automotive.