ece454/599 computer and network security

44
ECE454/599 Computer and Network Security Dr. Jinyuan (Stella) Sun Dept. of Electrical Engineering and Computer Science University of Tennessee Fall 2012 1

Upload: darcie

Post on 23-Feb-2016

88 views

Category:

Documents


0 download

DESCRIPTION

ECE454/599 Computer and Network Security. Dr. Jinyuan (Stella) Sun Dept. of Electrical Engineering and Computer Science University of Tennessee Fall 2012. Secret Key Cryptography. Block cipher DES 3DES AES. Generic Block Encryption. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: ECE454/599  Computer and Network Security

1

ECE454/599 Computer and Network Security

Dr. Jinyuan (Stella) SunDept. of Electrical Engineering and Computer ScienceUniversity of Tennessee Fall 2012

Page 2: ECE454/599  Computer and Network Security

2

Secret Key Cryptography• Block cipher• DES• 3DES• AES

Page 3: ECE454/599  Computer and Network Security

3

Generic Block Encryption• Block cipher: encryption/decryption in which a fixed-length block of plaintext is mapped to a ciphertext block of equal length• Random mapping: when any one bit of plaintext changes, every bit in ciphertext has 50% chance to change• Substitution: space complexity O(k 2^k) for k-bit blocks• Permutation: space complexity O(k logk) for k-bit blocks• Fixed key length: can be the same length as the block or different

Page 4: ECE454/599  Computer and Network Security

4

Example of Block EncryptionFigure 3-1:

Page 5: ECE454/599  Computer and Network Security

5

Diffusion and Confusion• Shannon’s proposal in 1949: develop a product cipher that alternates confusion and diffusion functions• Diffusion: the statistical structure of the plaintext is dissipated into long-range statistics of the ciphertext by having each plaintext digit affect the value of many ciphertext digits• Confusion: make the relationship between the statistics of the ciphertext and the value of the encryption key as complex as possible to thwart attempts to discover the key• They capture the essence of the desired attributes of a block cipher

Page 6: ECE454/599  Computer and Network Security

6

Data Encryption Standard (DES)• Designed by IBM and published by

NIST in 1977• 64-bit input block 64-bit output

block with 56-bit key• Not secure anymore: key size must

be increased by 1 bit every 2 years• 3DES: 112-bit key

Page 7: ECE454/599  Computer and Network Security

7

DES OverviewFigure 3-2: Basic Structure of DES

Page 8: ECE454/599  Computer and Network Security

8

Permutations of The Data• Do not enhance security

Page 9: ECE454/599  Computer and Network Security

9

Initial and Final Permutations

• Reverse the arrows for final permutation

Page 10: ECE454/599  Computer and Network Security

10

Generating Per-Round Keys• Initial permutation of key

Page 11: ECE454/599  Computer and Network Security

11

Generating Per-Round Keys• 16 48-bit keys generated• A subset of 48-bit from the 56 bits

Figure 3-5: Round i for generating Ki

Page 12: ECE454/599  Computer and Network Security

12

Generating Per-Round Keys• Permutations for obtaining left and right halves of key

Page 13: ECE454/599  Computer and Network Security

13

DES OverviewFigure 3-2: Basic Structure of DES

Page 14: ECE454/599  Computer and Network Security

14

A DES RoundFigure 3-6: DES round

Page 15: ECE454/599  Computer and Network Security

15

Mangler Function

• R is expanded from 32-bit to 48-bit

Page 16: ECE454/599  Computer and Network Security

16

Mangler FunctionFigure 3-8: Chunk transformation

• Each S-box is a 6-bit to 4-bit decoder, or 4 4-bit to 4-bit

Page 17: ECE454/599  Computer and Network Security

17

S-Box• A substitution which produces a 4-bit output for each possible 6-bit input• The 4-bit output of each of the 8 S-boxes is combined into a 32-bit quantity whose bits are then permuted• The permutation ensures: bits of the output of an S-box on one round of DES affects the input of multiple S-boxes on the next round• Output bits of S-box should not be close to a linear function of input bits

Page 18: ECE454/599  Computer and Network Security

18

S-Boxes

• Each S-box is a 6-bit to 4-bit decoder, or 4 4-bit to 4-bit

• Showing 2 S-boxes… • There are 8 S-boxes producing 32-bit Mangle Function output

Page 19: ECE454/599  Computer and Network Security

19

Permutation of the 32-bit Output

• This permutation is random looking, may be of some security value

Page 20: ECE454/599  Computer and Network Security

20

Design Parameters• Block size: larger block sizes mean greater security but reduced encryption/decryption speed for a given algorithm• Key size: larger key size means greater security but may decrease encryption/decryption speed• Number of rounds: multiple rounds offer increasing security, more is not better, sufficient is good enough• Key generation algorithm: greater complexity in this algorithm should lead to greater difficulty of cryptanalysis• Round function: greater complexity generally means greater resistance to cryptanalysis

Page 21: ECE454/599  Computer and Network Security

21

The Avalanche Effect• Desired property of encryption: a change in one bit of the plaintext or one bit of the key should produce a change in many bits of the ciphertext

• Table (a): two plaintext with 1-bit difference and a single key are selected

• Table (b): two keys with 1- bit difference and a single plaintext are selected

Page 22: ECE454/599  Computer and Network Security

22

Attacks on DES• Brute-force attack: 56-bit key size not long enough• 4 weak and 12 semi-weak keys: when C0 and D0 are one of 4 values, 1111…, 0000…, 1010…, 0101…• Cryptanalysis by exploiting weakness in S-box design• Differential cryptanalysis: observe the behavior of pairs of text blocks evolving along each round of the cipher, can find a DES key given 247 chosen plaintexts• Linear cryptanalysis: finding linear approximations to describe the transformations performed in DES, can find a DES key given 243 known plaintexts• Timing attacks: information about the key or the plaintext is obtained by observing how long to decrypt various ciphertexts

Page 23: ECE454/599  Computer and Network Security

23

Multiple Encryption DES• Encrypting twice with the same key: Problem?

• Encrypting twice with two keys: Problem? (Read [Kaufman] 4.4.1.2 on page 111)

Page 24: ECE454/599  Computer and Network Security

24

Triple DES (3DES)3 DES encryptions with 2 keys: 64-bit block,

112-bit key

Why three encryptions, not less or more?Why two keys, not three?Why EDE, not EEE or EDD?

Encryption Decryption

Page 25: ECE454/599  Computer and Network Security

25

Other Block CiphersIDEA: International Data

Encryption Algorithm, 64-bit block, 128-bit key

AES: Advanced Encryption Standard, 128-bit block, 128/192/256-bit key

Page 26: ECE454/599  Computer and Network Security

26

AESRijndael: invented by Belgian

cryptographersAES parameters:

Page 27: ECE454/599  Computer and Network Security

27

AES Overview

Page 28: ECE454/599  Computer and Network Security

28

AES ExampleNb = 4Nk = 4Nr = 6+max(Nb,Nk) = 10

Page 29: ECE454/599  Computer and Network Security

29

Key Expansion128-bit or 4 cols. of 4-byte key is expanded to 44

cols. In general, needs (Nr+1)Nb columns of key

Page 30: ECE454/599  Computer and Network Security

30

An Encryption Round

Page 31: ECE454/599  Computer and Network Security

31

Substitute BytesSubBytes: table lookup with a 16x16 S-box of

bytesSubstitute byte transformation:

Page 32: ECE454/599  Computer and Network Security

32

AES S-Box

Hex: 95 2aS-Box

Page 33: ECE454/599  Computer and Network Security

33

Example of SubBytes

State Matrices

Page 34: ECE454/599  Computer and Network Security

34

An Encryption Round

Page 35: ECE454/599  Computer and Network Security

35

ShiftRowsShift row transformation:

Example:

Page 36: ECE454/599  Computer and Network Security

36

Mixcolumn Table

Page 37: ECE454/599  Computer and Network Security

37

Lookup Using MixColumn Table

The MixColumn operation is omitted in the last, i.e., Nrth round

Page 38: ECE454/599  Computer and Network Security

38

An Encryption Round

Page 39: ECE454/599  Computer and Network Security

39

AddRoundKeyColumnwise operation: the128-bit state is

bitwise XORed with the 128-bit round key

State Matrix Round Key Matrix

Page 40: ECE454/599  Computer and Network Security

40

Summary: Four StagesOne permutation and three

substitutionsSubstitute bytes: uses an S-box to perform a

byte-by-byte substitution of the blockShiftRows: a simple permutationMixColumns: a substitution that makes use

of arithmetic over GF(28) AddRoundKey: a simple bitwise XOR of the

current block with a portion of the expanded key

Each stage is easily reversible—decryption

Page 41: ECE454/599  Computer and Network Security

41

The DecryptionWe sure can run the encryption backwardsBut for AES we can keep the encryption process

except For SubBytes: use an inverse S-box that has a similar

lookup table to S-boxFor ShiftRows: shift the same amount but to the rightFor MixColumns: use an InvMixColumn table that is

similar to the MixColumn table, skip this step in the last round

For AddRoundKey: keep the same AddRoundKey as in encryption because XOR is its own inverse

The order of round keys is reversed, i.e., KNr is applied first and K0 last

Page 42: ECE454/599  Computer and Network Security

42

Now We Have Every Piece of The Puzzle

Let’s work through an AES encryption on board…

Then verify the result using an AES calculator…

Page 43: ECE454/599  Computer and Network Security

43

Strength of RijndaelResistant to brute-force attackResistant to differential and linear

cryptanalysis

Page 44: ECE454/599  Computer and Network Security

44

Reading Assignments

[Kaufman] Chapter 3, 4.4, 8.5