Perspective Chapter: Cryptography – Recent Advances and Research Perspectives

*Monther Tarawneh*

## **Abstract**

Cryptography is considered as a branch of both mathematics and computer science, and it is related closely to information security. This chapter explores the earliest known cryptographic methods, including the scytale, Caesar cipher, substitution ciphers, and transposition ciphers. Also, explains the evolution of these methods over time. The development of symmetric and asymmetric key cryptography, hash functions, and digital signatures is also discussed. The chapter highlights major historical events and technological advancements that have driven the need for stronger and more efficient encryption methods. In addition, the chapter explores the potential for integrating artificial intelligence tools with cryptographic algorithms and the future of encryption technology.

**Keywords:** cryptography, mathematics, computer science, information security, scytale, Caesar cipher, substitution ciphers, transposition ciphers, symmetric key cryptography, asymmetric key cryptography, hash functions, digital signatures, evolution, historical events, technological advancements, artificial intelligence, future

## **1. Introduction**

Cryptography is the science converting information into an unreadable format as a practice of protecting confidential messages from unauthorized access [1]. Cryptographic algorithms have come a long way since the early days of cryptography and have evolved to keep up with the changing technological landscape. In this chapter, we will explore the history of cryptographic algorithms and their evolution over time.

The earliest known cryptographic methods date back to ancient civilizations, where methods, such as simple substitution and transposition ciphers, were used to conceal messages and prevent non-authorized people from understanding messages. These methods evolved over time to include more complex ciphers, such as the Caesar cipher and the Vigenère cipher, which were used during the Middle Ages. The development of the printing press and the subsequent increase in literacy rates led to the need for more secure methods of encryption, which led to the development of more complex ciphers such as the Playfair cipher and the Enigma machine.

Symmetric key cryptography is one of the oldest and most widely used types of encryption. It is based on the concept of using the same key to encrypt and decrypt a message. The history of symmetric key algorithms dates back to ancient times, where

#### *Biometrics and Cryptography*

simple substitution ciphers were used to encrypt messages. Over time, more complex algorithms were developed such as the Hill cipher and the data encryption standard (DES). The development of the advanced encryption standard (AES) in the late twentieth century marked a significant improvement in symmetric key cryptography as it provided stronger encryption and faster processing times.

Asymmetric key cryptography, also known as public-key cryptography, is a more recent development in the field of cryptography. It is based on the use of two different keys—a public key and a private key—to encrypt and decrypt messages. The concept of asymmetric key cryptography was first introduced by Whitfield Diffie and Martin Hellman in 1976 [2]. This led to the development of various algorithms such as the Rivest-Shamir-Adleman (RSA) algorithm [3] and the Diffie-Hellman key exchange [4].

Hash functions are another important component of modern-day encryption. A hash function is a mathematical function that takes an input (or message) and produces a fixed-length output (or hash) [5]. Hash functions are used to ensure the integrity of data as any change to the original input will result in a different hash. The history of hash functions dates back to the 1950s, where the concept of message digests was introduced. Over time, more complex algorithms were developed such as the secure hash algorithm (SHA) and the message digest (MD) [5, 6].

Digital signatures are used to provide authentication and non-repudiation in digital communications. A digital signature is a mathematical scheme for demonstrating the authenticity of a digital message or document. The history of digital signature algorithms dates back to the early 1980s, where the concept of public-key cryptography was first introduced. Over time, various algorithms were developed such as the digital signature algorithm (DSA) and the elliptic curve digital signature algorithm (ECDSA) [7].

The evolution of cryptographic algorithms has been driven by major historical events and technological advancements. With the advent of the internet and the increase in digital communication, the need for stronger and more efficient encryption methods became more pressing. As computing power continues to increase, the potential for cracking encryption algorithms also increases. This has led to the need for stronger and more advanced cryptographic algorithms, such as post-quantum cryptography, which can withstand attacks from quantum computers.

In addition to the potential threats to encryption technology, there is also the potential for integrating artificial intelligence tools with cryptographic algorithms. For example, machine learning algorithms could be used to identify potential vulnerabilities in encryption systems and improve their security.

As the digital landscape continues to evolve, the importance of staying ahead of the curve in encryption technology cannot be overstated. This chapter provides an overview of the history and evolution of cryptographic algorithms, highlighting the need for ongoing innovation and development in this field. By continuing to push the boundaries of encryption technology, we can help to safeguard the privacy and security of sensitive data in the digital age.

Encryption is a critical component of modern communication and information security [8]. By converting data into a secure format that can only be accessed with the correct key or password, encryption ensures that sensitive information is protected from unauthorized access. Throughout history, cryptography has played a significant role in the security of sensitive information from the early substitution ciphers used by ancient civilizations to the modern public-key encryption algorithms.

#### *Perspective Chapter: Cryptography – Recent Advances and Research Perspectives DOI: http://dx.doi.org/10.5772/intechopen.111847*

Recent developments in technology have led to new challenges and opportunities in the field of cryptography. The rise of quantum computing [9], blockchain technology [10], and the need for secure communication in an increasingly connected world have all driven new research and innovation in the field of cryptography [11].

This chapter provides an overview of various cryptographic techniques, including symmetric and asymmetric encryption, hashing, digital signatures, homomorphic encryption, multiparty computation, and lightweight cryptography. Each of these techniques has its own strengths and weaknesses and is suited to different use cases and scenarios. The chapter also explores the future of cryptography, including developments in post-quantum cryptography, blockchain-based cryptography, and other emerging technologies. By understanding the principles and applications of modern cryptography, we can better protect our digital assets and maintain the privacy and security of our communication.

## **2. Ancient cryptography methods**

The history of cryptography dates back to ancient civilizations, where people used various methods to protect their messages from unauthorized access. The earliest examples of cryptography being used to protect information were found in an inscription carved around 1900 BC, in the main chamber of the tomb of the nobleman Khnumhotep II, in Egypt [12, 13]. The inscription, known as the "Cryptography Inscription," described a method for hiding the meaning of hieroglyphic inscriptions by using symbols to represent individual letters. The symbols were then scrambled in a specific way to make the text difficult to read. The main purpose of the "Cryptography Inscription" was not to hide the message but rather to change its form in a way that would make it appear dignified. While the symbols used in the inscription were scrambled, they were still readable by those who were familiar with the method of substitution used. It means that the inscription was intended for a specific audience who were already familiar with the method rather than as a means of keeping the message secret from all who might view it.

#### **2.1 Substitution cipher**

One of the earliest known methods is the simple substitution cipher, which involves replacing each letter of the alphabet with another letter according to a predetermined pattern. There are two types of substitution cipher:

1.Monoalphabetic substitution: a basic cryptography method where each character of the plaintext is replaced with a corresponding character of cipher text. The same substitute symbol or letter is used every time a particular plaintext letter appears. For example, if "A" is substituted with "D," every "A" in the plaintext will be replaced with "D" in the cipher text as shown in **Figure 1**. This makes it vulnerable to frequency analysis attacks as the frequency of each letter in the cipher text will correspond to the frequency of the original letters in the plaintext. Therefore, it is considered a weak encryption method and is no longer used for serious cryptographic applications. However, it can still be used as a simple way to obscure text such as in puzzles or games.



## **Figure 1.**

*Monoalphabetic substitution cryptography.*


#### **Figure 2.**

*Caesar cipher with 1, 2, 3, and 4 shit to the left.*

One of the earliest examples of a monoalphabetic substitution cipher is the Caesar cipher, which was used by Julius Caesar to communicate secretly with his generals. In this cipher, each letter in the plaintext is shifted a certain number of places down the alphabet. For example, if the shift value is three, then the letter A is replaced by D, B is replaced by E, and so on shown in **Figure 2**. The recipient of the message would need to know the shift value to decrypt the message.

Another example of a monoalphabetic substitution cipher is the simple substitution cipher in which each plaintext letter is replaced by a corresponding symbol or letter from a fixed substitution pattern. Unlike the Caesar cipher, the substitution pattern for the simple substitution cipher is not based on a fixed shift value. Instead, the substitution pattern is usually chosen randomly or based on a key provided to the recipient.

Despite being simple to implement, monoalphabetic substitution ciphers are not secure by today's standards as it makes it easier for an attacker to crack the code.

2.Polyalphabetic substitution: It is made up of multiple monoalphabetic substitutions. In this method, a series of monoalphabetic substitutions are performed on the plaintext, using different substitution alphabets for each letter of the plaintext. This helps to make the ciphertext more difficult to crack as the same plaintext letter can be encrypted in different ways depending on its position in the message.

Vigenère cipher is the most known polyalphabetic substitution, which was invented in the sixteenth century and used by the French military for several centuries [14]. The Vigenère cipher uses a series of different alphabets, each generated by shifting the previous alphabet by one letter. The cipher is implemented using the Vigenère square (or table), which is made up of twentysix distinct cipher alphabets as shown in **Figure 3**. In the header row, the alphabet is written in its normal order. In each subsequent row, the alphabet is shifted one letter to the right until a 26 26 block of letters is formed.

*Perspective Chapter: Cryptography – Recent Advances and Research Perspectives DOI: http://dx.doi.org/10.5772/intechopen.111847*


#### **Figure 3.** *Vigenère square.*

Vigenère cipher can be done using the simplest way, which is similar to Caeser cipher or sophisticated way, where keyword is used for the encryption to specify the letter, the keyword is repeated over the length of the plaintext, and each letter of the keyword is used to shift the corresponding letter of the plaintext by a certain number of positions in the alphabet. For example, if you encrypt "security" using the simple way, it will be "TGFYWOAG." But when using the sophisticated way with "IBRI" as a keyword, the cipher text will be "AFTCZJKG." To make the cipher more secure, Vigenère suggested using a different keyword for each message rather than reusing the same keyword over and over again. He also suggested using longer keywords to make the cipher even harder to crack. However, if the length of the keyword is known, it can be easily broken using frequency analysis [15]. **Figure 4** shows an example of onetime pad encryption/decryption.

The onetime pad cipher is not a type of Vigenère cipher. It is a completely different encryption method that is based on using a long, randomly generated key that is at least as long as the plaintext. The key is made up of a series of random symbols, and each symbol is used only once to encrypt one character of the plaintext. Because the key is truly random and used only once, the onetime pad cipher is considered unbreakable, provided that the key is kept secret and destroyed after use by both the sender and the receiver.

The key must be as long as the plaintext for the onetime pad to be unbreakable. Because onetime pad is based on perfect secrecy, which means that the ciphertext provides no information about the plaintext, even if the attacker has unlimited computational power.


#### **Figure 4.**

*onetime-pad encryption/decryption example.*

Generating truly random keys that are as long as the plaintext is a challenging task, and transmitting them securely to the recipient is also a difficult problem. This is why the onetime pad is mostly used in special cases such as diplomatic and intelligence traffic. Also, onetime pad only guarantees confidentiality and not integrity. This means that an attacker who intercepts the ciphertext can not recover the plaintext, but they can easily modify the ciphertext to change the meaning of the message. Onetime pad requires a unique key for every message, and the keys should be securely destroyed after use to prevent reuse.

The Playfair cipher is a polygraphic substitution cipher invented in 1854 by Sir Charles Wheatstone [16]. It was the first cipher that allowed for the encryption of pairs of letters instead of single letters. The Playfair cipher uses a 5 5 grid of letters, with each letter of the alphabet appearing once. The letters in the grid are usually chosen using a keyword. The keyword is then written into the grid, and the remaining spaces are filled with the letters of the alphabet in order.

To encrypt plaintext using the Playfair cipher, the plaintext is divided into pairs of letters. If there is an odd number of letters, a dummy letter such as "X" is added at the end. Each pair of letters is then encrypted using the following steps and demonstrated in **Figure 5**:

**Step 1**: Construct the MATRIX

• Simple way (without keyword)

◦ <sup>5</sup> 5 table

	- Keyword has no repeating letter

*Perspective Chapter: Cryptography – Recent Advances and Research Perspectives DOI: http://dx.doi.org/10.5772/intechopen.111847*

**Figure 5.**

*Playfair cipher steps (A: simple and B: Sophisticated).*

◦ <sup>5</sup> 5 table

◦ fill in the remaining letters in alphabetic order (skip letter J)

**Step 2**: Preparing your message


**Step 3**: Encoding Rules:

	- Move each letter down one position
	- Upon reaching end of table, wrap around
	- Move each letter right one position
	- Upon reaching end of table, wrap around
	- Swap the letters with the ones on the end of the rectangle

An electromechanical machine developed in 2017 [17] that used a rotating disc with an embedded key to encode a substitution table that changed with every new character typed. This device was the first example of a rotor machine. The following year, a German engineer, invented the Enigma machine [18], which used multiple rotors instead of one. Initially designed for commercial use, the German military soon recognized the potential of the Enigma machine and began using it to send coded transmissions.

### **2.2 Transposition cipher**

Transposition cipher is an earlier method, where the letters of the message are rearranged according to a certain pattern, but the letters themselves are not changed as shown in **Figure 6**. Unlike substitution ciphers, which replace plaintext characters with different symbols or letters, transposition ciphers do not change the characters themselves. Instead, they simply reorder the characters to create a new message. The security of a transposition cipher is based on the difficulty of reconstructing the original message from the reordered characters without knowledge of the used transposition algorithm.

The Rail Fence cipher is a type of transposition cipher that was first used during the American Civil War. The technique involves writing the plaintext diagonally on a grid, then reading the letters in a zigzag pattern along the rows of the grid to produce the ciphertext. The number of rows in the grid can be adjusted to increase the complexity of the cipher.


**Figure 6.** *Transposition cipher example.* *Perspective Chapter: Cryptography – Recent Advances and Research Perspectives DOI: http://dx.doi.org/10.5772/intechopen.111847*

**Figure 7.** *Rail Fence encryption example.*

For example, suppose we want to encrypt the message "HELLO WORLD" using a Rail Fence cipher with three rows. Write the letters on a grid as shown in **Figure 7**.

To decrypt the message, we would write the ciphertext diagonally on a grid, then read the letters in the same zigzag pattern along the rows of the grid to recover the plaintext.

While these ancient methods of cryptography may seem primitive by today's standards, they laid the foundation for the development of more complex encryption techniques in the future. The principles of substitution and transposition ciphers are still used in modern cryptography, and the need for secure communication continues to drive the evolution of cryptographic algorithms.

## **3. Symmetric key cryptography**

Symmetric key cryptography schemes are categorized as stream ciphers or block ciphers. Stream ciphers work on a single bit at a time and execute some form of feedback structure so that the key is repeatedly changing. A block cipher encrypts one block at a time utilizing the same key on each block. In general, the same plaintext block will continually encrypt to the same ciphertext when using the similar key in a block cipher, whereas the same plaintext will encrypt to different ciphertext.

The history of symmetric key cryptography can be traced back to the days of Julius Caesar, who used a simple substitution cipher to protect his military communications. Over time, various types of symmetric key encryption algorithms were developed, such as the Vigenère cipher, which used a polyalphabetic substitution method, and the Enigma machine, which used a combination of substitution and transposition methods.

#### **3.1 Data encryption standard (DES)**

One of the most widely used symmetric key encryption algorithms is the data encryption standard (DES), which was developed by IBM in the 1970s and adopted in 1977 by the National Bureau of Standards, now the National Institute of Standards and Technology (NIST), as Federal Information Processing Standard. U.S. Data are encrypted in DES using a block cipher method to encrypt data in 64-bit blocks, with a 56-bit key. The algorithm transforms 64-bit input (plaintext) in a series of steps into a 64-bit output (ciphertext). The same steps, with the same key, are used to reverse the encryption. The encryption process in DES involves three phases:

1. Initial permutation (IP): The 64-bit input plaintext is shuffled (rearranged) according to a fixed permutation table to produce the permuted input. The initial


#### **Figure 8.**

*The initial permutation and its inverse.*

permutation and its inverse are defined by tables that indicate the position of each bit in the input to the output as shown in **Figure 8**. The permutation tables are used in the encryption and decryption processes to rearrange the bits of the input according to the specified permutation.

2.16 rounds of a complex key-dependent round function: Each round involves a substitution and a permutation. The 56-bit key is used to generate 16 round subkeys, each consisting of 48 bits, which are used in the round function. The output of the 16th round consists of 64 bits that are a function of the input plaintext and the key. The left and right halves of the output are swapped to produce the pre-output. **Figure 9** shows the internal structure of a single round, focusing on the left-hand side of the diagram. The main steps are:

**Figure 9.** *Internal structure of single round.*

*Perspective Chapter: Cryptography – Recent Advances and Research Perspectives DOI: http://dx.doi.org/10.5772/intechopen.111847*


#### **Figure 10.** *Expansion permutation table.*

	- The 64-bit key is permuted using a fixed permutation called the permutation choice 1 (PC-1) as shown in **Figure 11**. The output of this step is a 56-bit key, where eight of the bits are parity bits and are not used in the encryption process.



**Figure 11.** *Tables used in subkeys generation.*



**Figure 12.** *S-boxes used in the substitution step in DES.*

on the remaining 2 bits of the input. This allows for a total of 16 x 4 = 64 possible substitutions in each S-box.


The main steps summarized in **Figure 13**. The DES key generates 48 bits long 16 round keys from the initial 56 bit key. These keys are used in each round of the encryption process to modify the plaintext. The key involves applying a series of operations, including a permutation, a compression function, and left shifts, to the 56-bit key. The resulting subkeys are used one at a time in each round of the encryption process.

However, due to its small key size, DES is now considered insecure [19] and has been replaced by the advanced encryption s (AES).

**Figure 13.** *DES Algorithm steps.*

To be more precise, 3DES (also known as Triple DES or TDEA) is a symmetric key cipher that uses the DES algorithm three times in succession to increase its security [1, 20]. The standard 3DES encryption process can be described as follows:


Thus, 3DES involves encrypting the plaintext with K1, decrypting the result with K2, and encrypting again with K3. The three keys K1, K2, and K3 are usually independent keys generated randomly, although some variants of 3DES use a "keying option" that allows for fewer keys to be used while still maintaining a higher level of security.

While 3DES is slower than DES due to its triple encryption process, it is still considered a relatively fast algorithm and can be implemented in hardware, as well as software. Also, due to its small key size, DES is now considered insecure [19] and has been replaced by the advanced encryption standard (AES).

## **3.2 Advanced encryption standard (AES)**

The AES (Advanced Encryption Standard) is a symmetric block cipher that operates on fixed-size 128-bit blocks and supports key sizes of 128, 192, and 256 bits. It was standardized by NIST (National Institute of Standards and Technology) in 2001 as a replacement for the aging DES (Data Encryption Standard) cipher.

The AES was selected from a pool of 15 candidate algorithms that were submitted in response to a call for proposals issued by NIST in 1997 [21]. The selection process involved several rounds of analysis and testing, culminating in the selection of Rijndael [22], a cipher developed by Belgian cryptographers Joan Daemen and Vincent Rijmen, as the winner.

The AES encryption and decryption algorithms use a series of rounds, where all operations are performed on 8-bit bytes (one Word) (**Figure 14**). Each round of processing works on the input state array and produces an output state array. The output state array produced by the last round is rearranged into a 128-bit output block. The state array is a 4 4 matrix of bytes that represents the input block. Each round, the state array is modified by a series of operations that include byte substitution, permutation, and arithmetic operations over a finite field as shown in the figure below. After the final round, the state array contains the encrypted or decrypted data, which are then copied to an output matrix to produce the final ciphertext or plaintext block.

Each round can be described in four functions as shown in **Figure 14**. These four functions are combined in a specific order to form a round, and multiple rounds are performed on the input block to produce the final ciphertext block. The number of rounds depends on the key size and block size, with 10, 12, or 14 rounds used for 128 bit, 192-bit, and 256-bit keys, respectively. The functions are:

1.**SubBytes**: The substitute bytes stage of AES uses a fixed S-box, which is a 256 byte lookup table, to perform a byte-by-byte substitution of the input block. The *Perspective Chapter: Cryptography – Recent Advances and Research Perspectives DOI: http://dx.doi.org/10.5772/intechopen.111847*

#### **Figure 14.**

*The structure of AES algorithm.*

S-box is designed so that each input byte is replaced by a unique output byte. The inverse S-box is used in the decryption process, which maps each output byte back to its original input byte. The S-box is a nonlinear component of the AES algorithm, which helps to increase the resistance of the cipher to various attacks. For example, 19 will be mapped to the value crossed between row 1 and column 9, which is equal to D4 in the S-Box as shown in **Figure 15**.


**Figure 15.** *S-Box used in AES.*

## **Figure 16.**

*ShiftRows operation and its output (with example).*

2.**ShiftRows**: The shiftRows stage is a permutation step that cyclically shifts the bytes in each row of the state array by a certain number of bytes. This operation is applied to each row independently, with no mixing of the bytes between the rows. The number of bytes shifted is determined by the row number: the first row is not shifted at all, the second row is shifted by one byte to the left, the third row is shifted by two bytes to the left, and the fourth row is shifted by three bytes to the left as shown in **Figure 16**.

This operation provides diffusion of the input data, which increases the security of the cipher. The inverse operation, used for decryption, is a cyclic shift to the right instead of the left so that the original byte positions are restored.

3.**MixColumns**: each column of the state array is treated as a polynomial over the finite field GF(2^8), where each byte is a coefficient of the polynomial. The bytes are then multiplied by a fixed polynomial, and the result is reduced modulo another fixed polynomial. This transformation ensures that each byte in a column is dependent on all four bytes in the same column as demonstrated in **Figure 17**.

The multiplication and reduction are done using a pre-computed table of values. The table is constructed in such a way that multiplication is reduced to a simple table lookup and XOR operation.

During decryption, the inverse operation of MixColumns is performed. This involves multiplying each column by a different fixed polynomial and reducing the result modulo another fixed polynomial.

**Figure 17.** *Mix column function.*

*Perspective Chapter: Cryptography – Recent Advances and Research Perspectives DOI: http://dx.doi.org/10.5772/intechopen.111847*


**Figure 18.** *Description of the AddRoundkey in AES.*

4.**AddRoundkey**: Each byte of the current block is XORed with the corresponding byte of the round key. The round key is derived from the main encryption key using a key schedule algorithm, which generates a set of round keys for each round of encryption. This stage serves to add a layer of confusion to the encryption process, making it more difficult to analyze and break the cipher. **Figure 18** describe the AddRoundkey process in AES.

The AES key expansion algorithm takes as input a 128-bit (16-byte) key and generates a sequence of round keys, one for each round of the AES encryption process. The key expansion algorithm uses a key schedule to generate these round keys, which involves performing a series of operations on the input key to generate an expanded key.

The key schedule begins by copying the input key into the first four words of the key schedule. Then, the key expansion algorithm applies a series of operations to the last four words of the current key schedule to generate the next four words. This process is repeated until the key schedule contains the necessary number of round keys for the specified key size. For example, for a 128-bit key, the key schedule will generate 11 round keys, one for each of the 10 rounds of AES encryption plus an initial round key. For a 192-bit key, the key schedule will generate 13 round keys, and for a 256-bit key, the key schedule will generate 15 round keys.

In the key expansion algorithm, the first word in each group of four undergoes a series of operations before being XORed with the word from fourth positions back. These operations include a one-byte circular left shift (RotWord), byte substitution using the S-box (SubWord), and XORing with a round constant (Rcon[j]), the values of Rcon[j] shown in **Figure 19**. In the 256-bit key/14-round version, an additional step is performed on the middle word. The steps are:


The AES cipher is widely used in various applications, including secure communications, data storage, and authentication. Its security has been extensively analyzed, and it is considered to be highly secure against various types of attacks.


**Figure 19.** *The values of Rcon[j] in hexadecimal.*

## **3.3 More symmetric algorithms**


## **3.4 Mode of operation**

Since block ciphers operate on fixed-size blocks of data, they cannot be directly used to encrypt or decrypt messages that are larger than the block size. A mode of operation is a technique used to apply a block cipher to encrypt or decrypt data that is larger than the block size of the cipher.

Modes of operation are used to overcome this limitation by allowing the encryption or decryption of data that is larger than the block size of the cipher. These modes provide methods to break up the input message into blocks, and then apply the block cipher to each block. This process is typically performed using feedback mechanisms that generate input for each subsequent block, based on the output of the previous block.

There are several modes of operation defined by NIST, each with its own strengths and weaknesses and suitable for different types of applications. For example, some modes are designed to provide confidentiality, while others also provide message integrity and authentication. The five modes of operation defined by NIST are:

1.Electronic codebook (ECB): This is the simplest mode of operation, where each block of plaintext is encrypted independently with the same key as shown in **Figure 20**. However, it is not suitable for encrypting large amounts of data or data with a predictable structure. It suffers from the lack of diffusion, which means that identical plaintext blocks will result in identical ciphertext blocks.

**Figure 20.** *ECB mode encryption.*

*Perspective Chapter: Cryptography – Recent Advances and Research Perspectives DOI: http://dx.doi.org/10.5772/intechopen.111847*

**Figure 21.** *CBC mode encryption.*

This makes it vulnerable to attacks as patterns in the plaintext can be easily observed in the ciphertext. For example, an image encrypted with ECB mode will have visible patterns and blocks, making it easy for an attacker to identify certain parts of the image even without decrypting it. Therefore, it is not recommended to use ECB mode for encrypting lengthy messages or sensitive data.

2.Cipher block chaining (CBC): The cipher block chaining (CBC) mode of operation addresses the issue of repetitive plaintext blocks in ECB mode. This mode XORs each plaintext block with the previous ciphertext block before encryption as shown in **Figure 21**. This helps to provide diffusion and makes the encryption process more secure than ECB. Itis worth noting that the sequential nature of CBC encryption can also be an advantage in some cases as it provides a natural form of authentication. If a ciphertext block is corrupted or modified during transmission, the corresponding plaintext block will be affected, and the error will propagate through the rest of the decryption process, making it easier to detect tampering.

However, one-bit change in a plaintext or IV affects all following ciphertext blocks can also be a weakness. This can make it difficult to implement certain types of secure communications protocols such as those that require random access to encrypted data. Additionally, CBC requires a secure and unpredictable initialization vector (IV) for each message, which can be challenging to generate and transmit securely in some scenarios. Finally, as with any mode of operation that relies on a shared secret key, CBC is vulnerable to attacks that exploit weaknesses in the underlying block cipher or key management protocols.

3.Cipher feedback (CFB): In this mode, the block cipher is used as a feedback mechanism to create a stream cipher. The plaintext is XORed with the output of the block cipher, and the result is encrypted to produce the ciphertext as shown in **Figure 22**. This mode allows for variable-length plaintext and provides a selfsynchronizing stream cipher. The initial value is called the initialization vector (IV), and it is used to seed the process. The size of the shift registers determines the amount of feedback. For example, if s = 8, the encryption process operates on an 8 bit subset of the plaintext block at a time. If s = n, then the entire plaintext block is used at once.

One advantage of CFB mode is that it allows for error propagation to be contained. If a bit error occurs during transmission, only the block that contains the error is affected. The other blocks remain unchanged. However, one disadvantage of CFB mode is that it is sequential, which means that it cannot be parallelized.

**Figure 22.** *CFB mode encryption.*


One potential drawback of CTR mode is the need to ensure that the counter values are never repeated as this could compromise the security of the encryption. This can be achieved by using a unique counter value for each block of plaintext, for example by using a nonce (a number used only once) as part of the counter value.

**Figure 23.** *OFB mode encryption.*

*Perspective Chapter: Cryptography – Recent Advances and Research Perspectives DOI: http://dx.doi.org/10.5772/intechopen.111847*

**Figure 24.** *Counter mode encryption.*

## **4. Asymmetric key cryptography**

Asymmetric key cryptography, also known as public-key cryptography, is a cryptographic system that uses a pair of keys to encrypt and decrypt data. The pair of keys consists of a public key, which is known to everyone, and a private key, which is kept secret by its owner. The public key is used for encrypting the data, while the private key is used for decrypting the data. Unlike symmetric key cryptography, where the same key is used for both encryption and decryption, in asymmetric key cryptography, the two keys are mathematically related, but it is computationally infeasible to derive the private key from the public key.

The main advantage of asymmetric key cryptography is that it provides a secure method of communication between two parties without the need for a pre-shared secret key. Asymmetric key cryptography is used in many applications, including digital signatures, key exchange, and encryption of sensitive data.

Some examples of asymmetric key cryptographic algorithms include RSA [26], Diffie-Hellman [27], and elliptic curve cryptography (ECC) [28]. These algorithms are widely used in various applications, including secure communication, digital signatures, and online transactions [29].

#### **4.1 RSA**

RSA is a widely used public-key cryptosystem. It is been named after its inventors Ron Rivest, Adi Shamir, and Leonard Adleman. Its security is based on the difficulty of factoring large integers, which serves as the foundation for its mathematical operation. RSA has been used for over four decades and is still considered a secure and practical public-key cryptosystem. RSA involves the generation of a public and a private key pair. The public key is distributed to others, while the private key is kept secret. The public key can be used to encrypt messages that only the owner of the private key can decrypt.

The security of RSA is based on the fact that factoring large integers is a difficult problem, and the larger the key size, the more difficult it becomes. RSA keys typically range in size from 1024 to 4096 bits. We can say that RSA is widely accepted and implemented in various applications such as secure communication, digital signatures, and key exchange [30]. RSA encryption and decryption are performed as follows:

## • **Key generation**:


1.Represent the plaintext M as a positive integer less than n.


The security of RSA is based on the difficulty of factoring large composite numbers into their prime factors. Breaking RSA encryption requires factoring the modulus n into its two prime factors p and q, which is a computationally intensive task for large values of n. Therefore, the security of RSA increases as the size of the keys and the modulus increase.

## **4.2 Diffie-Hellman**

Diffie-Hellman (DH) is a key exchange algorithm that allows two parties to establish a shared secret key over an insecure channel. It was developed by Whitfield Diffie and Martin Hellman in 1976 and is based on the discrete logarithm problem in modular arithmetic.

In DH, each party generates a public-private key pair. The public keys are exchanged and used to derive a shared secret key. The derivation of the key involves modular exponentiation and is based on the fact that the discrete logarithm problem is believed to be hard. The DH protocol works as follows:


*Perspective Chapter: Cryptography – Recent Advances and Research Perspectives DOI: http://dx.doi.org/10.5772/intechopen.111847*

6.Alice and Bob now have a shared secret key that can be used for symmetric encryption.

The security here relies on the fact that computing the discrete logarithm of g mod p is computationally infeasible. This means that an attacker who intercepts A and B cannot calculate a or b, and therefore cannot compute the shared secret key K.

The DH algorithm can be used for secure communication by combining it with a symmetric encryption algorithm. The shared secret key derived using DH is used as the key for the symmetric encryption algorithm, providing confidentiality for communication. Widely used in many cryptographic protocolssuch as Secure Socket Layer (SSL)/Transport Layer Security (TLS), Secure Shell Protocol (SSH), and Virtual private networks (VPNs) [31, 32]. However, it does not provide authentication [32], and therefore a man-in-themiddle attack is possible if the channel is not authenticated. To address this issue, DH is often used in combination with digital signatures or other authentication mechanisms [33].

## **5. Hash functions**

A hash function is a one-way function that takes an input (also known as the message or data) of arbitrary length and produces a fixed-size output, typically represented as a sequence of bytes. The output is often referred to as the hash or message digest. A good hash function should have the following properties:


Hash functions are commonly used in various security applications such as password storage, digital signatures, and message authentication codes.

## **6. Digital signatures**

Digital signatures are used to ensure the authenticity, integrity, and nonrepudiation of a digital document or message. The process of creating a digital signature involves applying a mathematical algorithm to the message or document using the signer's private key. The resulting value, known as the signature, is unique to both the message and the signer's private key.

The receiver of the message or document can verify the signature using the signer's public key, which confirms that the message was indeed sent by the signer and that it has not been altered since it was signed.

Digital signatures can be used in a variety of applications, including software updates, online transactions, and legal documents. They provide a means of verifying the identity of the sender, ensuring the integrity of the message or document, and preventing the sender from denying that they sent the message or document**.**

## **7. Future of cryptography**

Cryptography has come a long way since its early beginnings, and it continues to play a critical role in securing our digital world today. The advancement of technology has led to more complex and sophisticated encryption methods, which have become essential for protecting sensitive information such as financial transactions, personal data, and confidential communication. With the rise of the internet and mobile technology, cryptography has become more important than ever. It is used in everything from e-commerce to social media to secure online communication [34]. As technology continues to evolve, so will the field of cryptography, and new techniques and algorithms will be developed to stay ahead of emerging threats. The future of cryptography holds great promise as researchers work to develop quantum-resistant encryption and new methods for securing blockchain technology. As we rely more and more on digital communication and storage, the role of cryptography in securing our data will only become more critical.

#### **7.1 Quantum cryptography**

Quantum computers have the potential to break many of the current cryptographic schemes that rely on the difficulty of certain mathematical problems [35]. Quantum cryptography aims to develop new cryptographic schemes that are resistant to attacks by quantum computers [36]. It makes use of the principles of quantum mechanics to provide a high level of security. Also, uses quantum mechanical properties to protect information in transit.

In traditional cryptography, the security of the system relies on the complexity of mathematical algorithms, while in quantum cryptography, the security relies on the laws of physics. Specifically, quantum cryptography uses the principle of quantum entanglement, which involves the correlation of quantum states between two particles.

The most widely known application of quantum cryptography is quantum key distribution (QKD) [37]. QKD is a protocol that enables two parties to establish a shared secret key that is completely secure against eavesdropping, even by an attacker with unlimited computing power. QKD works by transmitting a series of quantum states, or qubits, between two parties, typically named Alice and Bob. The qubits are generated using a laser and a polarizer. Alice sends a random sequence of polarizations to Bob, who measures the polarizations using his own set of polarizers. By comparing the polarizations, Alice and Bob can detect the presence of an eavesdropper.

There are many challenges to overcome before quantum cryptography can be widely adopted. One of the main challenges is the difficulty of building practical quantum cryptography systems, which require precise control of the quantum states involved. Additionally, there is a need for more research in quantum computing, as well as a need for new protocols that can be used to secure communications in different contexts.

#### **7.2 Homomorphic encryption**

Homomorphic encryption is another type of encryption that allows computation to be performed on ciphertext [38], which means that data can be encrypted and manipulated without the need to decrypt it first. In other words, it enables

*Perspective Chapter: Cryptography – Recent Advances and Research Perspectives DOI: http://dx.doi.org/10.5772/intechopen.111847*

computations to be performed on data without revealing the data itself. This is a significant breakthrough in the field of cryptography as it allows for secure computation and data analysis without compromising privacy [39]. Homomorphic encryption has numerous applications in various fields such as finance, healthcare, and cloud computing [40]. For instance, it can be used to perform secure data analysis on sensitive data [41], such as medical records, without the need to reveal the data to unauthorized parties. It can also be used in cloud computing to protect data privacy while still allowing for secure computation in the cloud.

#### **7.3 Block chain cryptography**

Blockchain-based cryptography is a critical component of blockchain technology, which is widely used in various fields such as finance, healthcare, and supply chain management [42]. it is a distributed ledger that records transactions in a secure and transparent manner. Cryptography is used in blockchain to ensure the confidentiality, integrity, and authenticity of data stored in the blockchain network.

One of the essential cryptographic techniques used in blockchain is the digital signature. A digital signature is a mathematical scheme that validates the authenticity and integrity of a message or data. Digital signatures are used to verify transactions in the blockchain network, ensuring that the sender is the actual owner of the assets and preventing any tampering of the data [42].

Another critical cryptographic technique used in the blockchain is hash functions. Hash functions are used to create a unique digital fingerprint of data stored in the blockchain network. This unique digital fingerprint, also known as a hash value, ensures that the data is tamper-proof and cannot be altered without being detected.

Blockchain technology also employs public-key cryptography, which is a cryptographic technique that uses a pair of keys, one public and one private. Public keys are used to encrypt data, while private keys are used to decrypt data. This technique ensures the confidentiality and security of data stored in the blockchain network.

Blockchain-based cryptography plays a vital role in ensuring the security and transparency of data stored in the blockchain network. As blockchain technology continues to evolve, we can expect to see new cryptographic techniques and algorithms that will further enhance the security and efficiency of blockchain-based applications.

#### **7.4 Multiparty computation**

Multiparty computation (MPC) is a cryptographic technique that enables a group of parties to jointly compute a function on their private inputs, without revealing those inputs to each other or to any third party. This technique allows parties to collaborate and compute a result without sharing their individual data, which can be particularly useful in scenarios where data privacy is critical, such as in financial transactions or medical research [43].

Each party inputs its private data into the system, which then generates a shared output based on the combined inputs of all parties. The protocol ensures that no individual party can learn anything about the private inputs of any other party, and the final output is only known to those parties who have contributed inputs.

MPC has many practical applications, including secure auctions, electronic voting systems, and privacy-preserving data analysis. However, it can be computationally

expensive, especially when the number of parties and the complexity of the function being computed increase. Despite these challenges, MPC is a powerful tool for achieving secure collaboration and computation among multiple parties [44].

## **7.5 Lightweight cryptography**

Lightweight cryptography refers to a subset of cryptographic algorithms that are specifically designed to operate efficiently on low-resource devices such as smart cards, RFID tags, and wireless sensor nodes. These devices often have limited processing power, memory, and energy resources, making it challenging to implement traditional cryptographic algorithms on them. Lightweight cryptography aims to address these challenges by developing cryptographic algorithms that have low computational and memory requirements, while still providing a reasonable level of security.

The development of lightweight cryptography has become increasingly important with the proliferation of the Internet of Things (IoT) and other low-power, low-cost devices. These devices are becoming more prevalent in our daily lives, and many of them require secure communication and authentication. Lightweight cryptography can provide a practical and efficient solution for securing these devices, without sacrificing security. Some examples of lightweight cryptography algorithms include SIMON and SPECK block ciphers, which were designed by the National Security Agency (NSA) for use in constrained environments. Another example is the lightweight version of the advanced encryption standard (AES), known as AES-Lite. These algorithms have been adopted by various standardization bodies and are widely used in industry for securing low-resource devices.

## **8. Conclusions**

Cryptography is a critical aspect of modern information security. It has evolved significantly over time, from basic substitution ciphers to sophisticated algorithms that provide secure communication and transactions. Today, we have various types of cryptographic schemes, including symmetric and asymmetric encryption, hash functions, digital signatures, homomorphic encryption, and multiparty computation. The development of lightweight cryptography has also enabled secure communication and transactions on low-power devices such as IoT devices. As technology continues to advance, the field of cryptography will play an increasingly vital role in ensuring secure communication and transactions in an interconnected world. The future of cryptography is exciting and promising, and we can expect to see more innovations that will enhance the security and privacy of our digital world.

.

*Perspective Chapter: Cryptography – Recent Advances and Research Perspectives DOI: http://dx.doi.org/10.5772/intechopen.111847*

## **Author details**

Monther Tarawneh Computer Science Department, Isra University, Amman, Jordan

\*Address all correspondence to: mtarawneh@iu.edu.jo

© 2023 The Author(s). Licensee IntechOpen. This chapter is distributed under the terms of the Creative Commons Attribution License (http://creativecommons.org/licenses/by/3.0), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

## **References**

[1] Bruce S. Applied cryptography: protocols, algorithms, and source code in C. 2nd ed. Hoboken, New Jersey: John Wiley & Sons; 1996

[2] Diffie W, Hellman ME. Multiuser cryptographic techniques. In: Proceedings of the June 7-10, 1976, national computer conference and exposition. ACM Digital Library; 1976. pp. 109-112

[3] Blakley GR, Borosh I. Rivest-Shamir-Adleman public key cryptosystems do not always conceal messages. Computers & Mathematics with Applications. 1979; **5**:169-178

[4] Rescorla E. Diffie-Hellman Key Agreement Method. 2070-1721, 1999

[5] Sobti R, Geetha G. Cryptographic hash functions: A review. International Journal of Computer Science Issues (IJCSI). 2012;**9**:461

[6] Rogaway P, Shrimpton T. Cryptographic hash-function basics: Definitions, implications, and separations for preimage resistance, second-preimage resistance, and collision resistance. In: FSE, 2004, Lecture Notes in Computer Science. Vol. 3017. Springer Verlag; 2004. pp. 371-388

[7] Menezes AJ, van Oorschot PC, Vanstone SA. Handbook of applied cryptography (202101 ed.). 2021;**1**:1-810

[8] Wong D. Real-world cryptography. Shelter Island, NY: Manning Publications; 2021

[9] Chaubey NK, Prajapati BB. Quantum cryptography and the future of cyber security. Hershey, PA: IGI Global; 2020. DOI: 10.4018/978-1-7998-2253-0

[10] Poongothai T, Jayarajan K, Rajeshkumar G, Patra P. Blockchain technology in healthcare applications. Journal of Critical Reviews. 2020;**7**: 8701-8707

[11] Bertaccini M. Cryptography algorithms: A guide to algorithms in blockchain, quantum cryptography, zero - knowledge protocols, and omomorphic encryption. Birmingham, UK: Packt Publishing, Limited; 2022. DOI: 10.1007/978-183882-844-4

[12] Singh S. The Code Book. Vol. 7. New York: Doubleday; 1999

[13] Davies D. A brief history of cryptography. Information Security Technical Report. 1997;**2**:14-17

[14] Mendelsohn CJ. Blaise de Vigenère and the "Chiffre Carré". In: Proceedings of the American Philosophical Society. 1940;**83**(4):103-129

[15] Schrödel T. Breaking short Vigenère ciphers. Cryptologia. 2008;**32**:334-347

[16] Wade NJ. Charles Wheatstone (1802–1875). ed: SAGE Publications ed. Vol. 31. London, England: Sage UK; 2002. pp. 265-272

[17] Kruh L. Cipher equipment. Cryptologia. 1977;**1**:143-149

[18] Smart NP, Smart NP. The enigma machine. Cryptography Made Simple. 2016;**64**(2):133-161

[19] Sidhu A. Analyzing modern cryptography techniques and reviewing their timeline. Security and Communication Networks. 2023;**10**:1-18

[20] Stamp M. Information security: principles and practice. Hoboken, NJ: John Wiley & Sons; 2011

*Perspective Chapter: Cryptography – Recent Advances and Research Perspectives DOI: http://dx.doi.org/10.5772/intechopen.111847*

[21] Smid ME. Development of the advanced encryption standard. Journal of Research of the National Institute of Standards and Technology. 2021;**126**:1-18

[22] Daemen J, Rijmen V. AES proposal: Rijndael. National Institute of Standards and Technology; 1999

[23] Schneier B. Description of a new variable-length key, 64 bit block cipher (Blowfish). In: Fast Software Encryption: Cambridge Security Workshop Cambridge, UK, December 9 11, 1993 Proceedings. Berlin, Heidelberg: Springer; 2005. pp. 191-204

[24] Schneier B. The twofish encryption algorithm. Dr Dobb's Journal: Software Tools for the Professional Programmer. 1998;**23**:30-34

[25] Rivest RL. The RC4 encryption algorithm, 1992. Vol. 25. RSA Data Security Inc.; 2016. pp. 1-23.

[26] Rivest RL, Shamir A, Adleman L. A method for obtaining digital signatures and public-key cryptosystems. Communications of the ACM. 1978;**21**:120-126

[27] Hellman M. New directions in cryptography. IEEE Transactions on Information Theory. 1976;**22**:644-654

[28] Lenstra HW. Factoring integers with elliptic curves. Annals of Mathematics. 1987;**126**(3):649-673

[29] Pachghare V. Cryptography and information security. Noida, Uttar Pradesh, India: PHI Learning Pvt. Ltd.; 2019

[30] Katz J, Lindell Y. Introduction to modern cryptography. Boca Raton, FL: CRC Press; 2020

[31] Li Y. Design and analysis of cryptographic protocols [Dissertation], 2015. Bochum: Ruhr-Universität Bochum; 2016

[32] Carts DA. A review of the Diffie-Hellman algorithm and its use in secure internet protocols. SANS Institute; 2001; **751**:1-7

[33] Medina R III. Systems and Methods for Digital Signature Detection. ed: Google Patents ed. 2015

[34] Tarawneh M, AlZyoud F, Sharrab Y, Kanaker H. Secure E-health framework in cloud-based environment. In: 2022 International Arab Conference on Information Technology (ACIT). IEEE; 2022. pp. 1-5

[35] Subramani S, Svn SK. Review of security methods based on classical cryptography and quantum cryptography. Cybernetics and Systems. 2023;**54**(1):1-19

[36] Mavroeidis V, Vishi K, Zych MD, Jøsang A. The impact of quantum computing on present cryptography. arXiv Preprint arXiv:1804.00200. 2018

[37] Renner R. Security of quantum key distribution. International Journal of Quantum Information. 2008;**6**:1-127

[38] Lauter KE, Dai W, Laine K. Protecting privacy through homomorphic encryption. Cham, Switzerland: Springer; 2022

[39] Doan TVT, Messai M-L, Gavin G, Darmont J. A survey on implementations of homomorphic encryption schemes. The Journal of Supercomputing. 2023;**79**: 15098-15139

[40] Chatterjee A, Aung KMM. Fully homomorphic encryption in real world applications. Singapore: Springer; 2019

[41] Viand A, Knabenhans C, Hithnawi A. Verifiable fully homomorphic encryption. arXiv Preprint arXiv:2301.07041. 2023

[42] Bolfing A. Cryptographic Primitives in Blockchain Technology: A Mathematical Introduction. New York, USA: Oxford University Press; 2020

[43] Goldreich O. Secure multi-party computation. Manuscript. Preliminary version. 1998;**78**:1-78

[44] Darby ML, Nikolaou M. MPC: Current practice and challenges. Control Engineering Practice. 2012;**20**:328-342

**Chapter 3**
