### What is Cryptography

#### 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, t****o** 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.

##### Author: Kunal Gupta

Author