Chapter 3 Data Encryption Standard DES Chapter 3

  • Slides: 42
Download presentation
Chapter 3 Data Encryption Standard (DES)

Chapter 3 Data Encryption Standard (DES)

Chapter 3 Objectives ❏ To review a short history of DES ❏ To define

Chapter 3 Objectives ❏ To review a short history of DES ❏ To define the basic structure of DES ❏ To describe the details of building elements of DES ❏ To describe the round keys generation process

3 -1 INTRODUCTION The Data Encryption Standard (DES) is a symmetrickey block cipher published

3 -1 INTRODUCTION The Data Encryption Standard (DES) is a symmetrickey block cipher published by the National Institute of Standards and Technology (NIST). DES uses the two basic techniques of cryptography : • Confusion • Diffusion Shanan introduced the principal of confusion & diffusion. Idea: Break dependencies and introduces much randomness in the cipher text.

3 -1 INTRODUCTION Diffusion Achieved by having each plain text digit affect the value

3 -1 INTRODUCTION Diffusion Achieved by having each plain text digit affect the value of many cipher digits. Diffusion is achieved through permutation. P-Box Confusion Achieved by using a complex substation algorithm. Confusion is achieved through the XOR operation & the S-Box

3 -1 INTRODUCTION Confusion Attempt to make the relationship between the cipher text and

3 -1 INTRODUCTION Confusion Attempt to make the relationship between the cipher text and the encryption key as complex as possible. This is also called as S-P Network.

3. 1. 2 Overview DES is a block cipher, as shown in Figure 6.

3. 1. 2 Overview DES is a block cipher, as shown in Figure 6. 1. Figure 3. 1 Encryption and decryption with DES

3 -2 DES STRUCTURE The encryption process is made of two permutations (P -boxes),

3 -2 DES STRUCTURE The encryption process is made of two permutations (P -boxes), which we call initial and final permutations, and sixteen Feistel rounds.

3 -2 Continue Figure 3. 2 General structure of DES

3 -2 Continue Figure 3. 2 General structure of DES

3. 2. 1 Initial and Final Permutations Figure 3. 3 Initial and final permutation

3. 2. 1 Initial and Final Permutations Figure 3. 3 Initial and final permutation steps in DES

3. 2. 1 Continue Table 3. 1 Initial and final permutation tables

3. 2. 1 Continue Table 3. 1 Initial and final permutation tables

3. 2. 2 Rounds DES uses 16 rounds. Each round of DES is a

3. 2. 2 Rounds DES uses 16 rounds. Each round of DES is a Feistel cipher. Figure 6. 4 A round in DES (encryption site)

3. 2. 2 Continued DES Function The heart of DES is the DES function.

3. 2. 2 Continued DES Function The heart of DES is the DES function. The DES function applies a 48 -bit key to the rightmost 32 bits to produce a 32 -bit output. Figure 6. 5 DES function

3. 2. 2 Continue Expansion P-box Since RI− 1 is a 32 -bit input

3. 2. 2 Continue Expansion P-box Since RI− 1 is a 32 -bit input and KI is a 48 -bit key, we first need to expand RI− 1 to 48 bits. Figure 3. 6 Expansion permutation

3. 2. 2 Continue Although the relationship between the input and output can be

3. 2. 2 Continue Although the relationship between the input and output can be defined mathematically, DES uses Table 6. 2 to define this P-box. Table 3. 6 Expansion P-box table

3. 2. 2 Continue (XOR) After the expansion permutation, DES uses the XOR operation

3. 2. 2 Continue (XOR) After the expansion permutation, DES uses the XOR operation on the expanded right section and the round key. Note that both the right section and the key are 48 bits in length. Also note that the round key is used only in this operation.

3. 2. 2 Continue S-Boxes The S-boxes do the real mixing (confusion). DES uses

3. 2. 2 Continue S-Boxes The S-boxes do the real mixing (confusion). DES uses 8 S -boxes, each with a 6 -bit input and a 4 -bit output. See Figure 6. 7. Figure 3. 7 S-boxes

3. 2. 2 Continue Figure 3. 8 S-box rule

3. 2. 2 Continue Figure 3. 8 S-box rule

6. 2. 2 Continue Table 6. 3 shows the permutation for S-box 1. For

6. 2. 2 Continue Table 6. 3 shows the permutation for S-box 1. For the rest of the boxes see the textbook. Table 3. 3 S-box 1

6. 2. 2 Continued Example 6. 3 The input to S-box 1 is 100011.

6. 2. 2 Continued Example 6. 3 The input to S-box 1 is 100011. What is the output? Solution If we write the first and the sixth bits together, we get 11 in binary, which is 3 in decimal. The remaining bits are 0001 in binary, which is 1 in decimal. We look for the value in row 3, column 1, in Table 6. 3 (S-box 1). The result is 12 in decimal, which in binary is 1100. So the input 100011 yields the output 1100.

6. 2. 2 Continued Example 6. 4 The input to S-box 8 is 000000.

6. 2. 2 Continued Example 6. 4 The input to S-box 8 is 000000. What is the output? Solution If we write the first and the sixth bits together, we get 00 in binary, which is 0 in decimal. The remaining bits are 0000 in binary, which is 0 in decimal. We look for the value in row 0, column 0, in Table 6. 10 (S-box 8). The result is 13 in decimal, which is 1101 in binary. So the input 000000 yields the output 1101.

3. 2. 2 Continue Straight Permutation Table 3. 11 Straight permutation table

3. 2. 2 Continue Straight Permutation Table 3. 11 Straight permutation table

6. 2. 3 Continued Table 3. 12 Parity-bit drop table Table 3. 13 Number

6. 2. 3 Continued Table 3. 12 Parity-bit drop table Table 3. 13 Number of bits shifts

3. 2. 3 Continued Table 6. 14 Key-compression table

3. 2. 3 Continued Table 6. 14 Key-compression table

6. 2. 4 Examples Example 3. 5 We choose a random plaintext block and

6. 2. 4 Examples Example 3. 5 We choose a random plaintext block and a random key, and determine what the ciphertext block would be (all in hexadecimal): Table 3. 15 Trace of data for Example 3. 5

3. 2. 4 Continued Example 3. 5 Continued Table 3. 15 Trace of data

3. 2. 4 Continued Example 3. 5 Continued Table 3. 15 Trace of data for Example 6. 5 (Conintued

6. 2. 4 Continued Example 3. 6 Let us see how Bob, at the

6. 2. 4 Continued Example 3. 6 Let us see how Bob, at the destination, can decipher the ciphertext received from Alice using the same key. Table 6. 16 shows some interesting points.

3. 3. 1 Properties Two desired properties of a block cipher are the avalanche

3. 3. 1 Properties Two desired properties of a block cipher are the avalanche effect and the completeness. Example 6. 7 To check the avalanche effect in DES, let us encrypt two plaintext blocks (with the same key) that differ only in one bit and observe the differences in the number of bits in each round.

6. 3. 1 Continued Example 3. 7 Continued Although the two plaintext blocks differ

6. 3. 1 Continued Example 3. 7 Continued Although the two plaintext blocks differ only in the rightmost bit, the ciphertext blocks differ in 29 bits. This means that changing approximately 1. 5 percent of the plaintext creates a change of approximately 45 percent in the ciphertext. Table 3. 17 Number of bit differences for Example 3. 7

3. 3. 1 Continued Completeness effect means that each bit of the cipher text

3. 3. 1 Continued Completeness effect means that each bit of the cipher text needs to depend on many bits on the plaintext. Avalanche effect A small change in either the plaintext or the key should produce a significant change in the cipher text. In particular, a change in one bit of the plain text or one bit of the key should produce a change in many bits of the cipher text.

3. 3. 2 Design Criteria S-Boxe The design provides confusion and diffusion of bits

3. 3. 2 Design Criteria S-Boxe The design provides confusion and diffusion of bits from each round to the next. P-Boxes They provide diffusion of bits. Number of Rounds DES uses sixteen rounds of Feistel ciphers. the ciphertext is thoroughly a random function of plaintext and ciphertext.

Double DES n n n Double uses two keys, K 1 and K 2

Double DES n n n Double uses two keys, K 1 and K 2 Perform DES on the plaintext using K 1 to get encrypt text. Again perform DES on the encrypt text using K 2. The final output is the encryption of the encrypted text. Double DES has a 112 -bit key and enciphers blocks of 64 bits.

Double DES

Double DES

Triple DES n n n 3 DES was developed in 1999 by IBM –

Triple DES n n n 3 DES was developed in 1999 by IBM – by a team led by Walter Tuchman. 3 DES prevents a meet-in-the-middle attack. 3 DES has a 168 -bit key and enciphers blocks of 64 bits Triple DES uses three 64 -bit keys, so in total it uses an overall key length of 192 bits. The plain text block is first encrypted with k 1, then encrypted with k 2 and finally with the k 3 Its three times slower than DES Triple DES with three keys used in many products including PGP and S/MIME

Triple DES

Triple DES

INTERNATIONAL DATA ENCRYPTION ALGORITHM (IDEA) n n n The International Data Encryption Algorithm (IDEA)

INTERNATIONAL DATA ENCRYPTION ALGORITHM (IDEA) n n n The International Data Encryption Algorithm (IDEA) is a symmetric block cipher. It uses a 128 -bit key to encrypt data in blocks of 64 bits. IDEA uses both diffusion & confusion for encryption. The 64 bits input is divided into 4 portions(p 1 to p 4) There are eight rounds

RC 5 (Ron’s Code 5) n n RC 5 is another block cipher designed

RC 5 (Ron’s Code 5) n n RC 5 is another block cipher designed by Ron Rivest for RSA Security in 1994. Along with a variable key size, and a variable number of rounds, the size of RC 5 data blocks is variable. The block size can range from 32 bits, 64 bits, to 128 bits. Similarly, the number of rounds can range from 0 to 255, while the key can range from 0 bits to 2040 bits in size.

PROBLEMS IN SYMMETRIC CRYPTOGRAPHY n n The major problem with symmetric cryptography is that

PROBLEMS IN SYMMETRIC CRYPTOGRAPHY n n The major problem with symmetric cryptography is that the process of transferring keys to the recipient is prone to security risks. Transferring the secret key over the Internet either in an e-mail message or through simple IRC services is insecure.

Asymmetric Cryptography n n n The security risks that are involved in secret key

Asymmetric Cryptography n n n The security risks that are involved in secret key cryptography have been overcome to a large extent in another method of cryptography called public key cryptography. Public key cryptography uses a key pair instead of just one secret key. Of this key pair, one key, known as the private key, is always kept secret by the key holder. This private key is not transferred to anyone

3 -5 Security of DES, as the first important block cipher, has gone through

3 -5 Security of DES, as the first important block cipher, has gone through much scrutiny. Among the attempted attacks, three are of interest: brute-force, differential cryptanalysis, and linear cryptanalysis.

BRUTE FORCE ATTACK n n n The brute force attack on the DES algorithm

BRUTE FORCE ATTACK n n n The brute force attack on the DES algorithm is feasible because of the relatively small key length (56 bit) and ever-increasing computational power of the computers. You can break through any cipher by trying all keys that possibly exist. However, in brute force attacks, the time taken to break a cipher is directly proportional to the length of the key. In a brute force attack, keys are randomly generated and applied to the ciphertext until the legitimate key is generated. This key decrypts the data into its original form

DIFFERENTIAL CRYPTANALYSIS ATTACK n n n The differential cryptanalysis attack looks specifically at pairs

DIFFERENTIAL CRYPTANALYSIS ATTACK n n n The differential cryptanalysis attack looks specifically at pairs of ciphertexts whose plaintext have some specific differences. It analyzes these differences as the plaintext propagates through the various rounds of DES when they are encrypted with the same key. This technique chooses pairs of plaintext with a fixed difference. Two plaintexts can be chosen at random, as long as they satisfy specific difference conditions. Then, using the differences in the resulting ciphertexts, different probabilities can be assigned to different keys. As more and more ciphertext pairs are analyzed, one key emerges, as the most probable candidate key.

LINEAR CRYPTANALYSIS ATTACK n n Linear Cryptanalysis attack was invented by Mitsuru Matsui in

LINEAR CRYPTANALYSIS ATTACK n n Linear Cryptanalysis attack was invented by Mitsuru Matsui in 1993. This method is based on the concept that if you XOR some of the plaintext bits together, XOR some ciphertext bits together, and then XOR the results, you will get a single bit that is the XOR of some of the key bits. A large number of such plaintexts/ciphertexts pairs are then used to guess the values of the key bits. The greater the volume of the base data, the more reliable is the guess.