Docsity

Data Encryption Standard and its Extensions - Computer Networks | ECE 646, Study notes of Cryptography and System Security

Toggle sidebar
bg1
1
Data Encryption Standard
and its extensions
ECE 646 - Lecture 7
2
Review of Lecture 6
•Historical Ciphers
•Substitution Cipher
–Monoalphabetic
–Polyalphabetic
•Letter Frequency Ana lysis
•One Time Pad
3
Levels of Security
Definition: Uncondition al Security
A cryptosystem is uncon ditionally secure if it
cannot be broken eve n with infinite
computational resource s.
Q: Which ac tual cryptosystems are
unconditionally secu re?
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17

Partial preview of the text

Download Data Encryption Standard and its Extensions - Computer Networks | ECE 646 and more Study notes Cryptography and System Security in PDF only on Docsity!

1

Data Encryption Standard

and its extensions

ECE 646 - Lecture 7

2

Review of Lecture 6

- Historical Ciphers - Substitution Cipher - Monoalphabetic - Polyalphabetic - Letter Frequency Analysis - One Time Pad

3

Levels of Security

Definition: Unconditional Security

A cryptosystem is unconditionally secure if it

cannot be broken even with infinite

computational resources.

Q: Which actual cryptosystems are

unconditionally secure?

4

Levels of Security

Definition: Computational Security

A cryptosystem is “computational secure” if

best possible algorithm for breaking requires

N operations, where N is very large and

known.

Q: Which actual cryptosystems are

“computational secure”?

5

Levels of Security

Definition: Relative Security

A cryptosystem is “relative secure” if its

security relies on a well studied, very hard

problem.

Q: Which actual cryptosystems are “relative

secure”?

6

Data Encryption Standard

10

Life of DES

DES developed by IBM and NSA In common use for over 20 years

(^1970 1980 1990 2000) Time

Federal and banking standard

transision to a new standard

Over 300 validated implementations

De facto world-wide standard

11

Most popular secret-key ciphers

1980 1990 2000 2010 2020 2030

DES^ Triple DES American AES - Rijndael standards

Other popular algorithms

IDEA

AES contest

1977 1999

2001

Blowfish

RC

CAST

Twofish RC Mars

Serpent

128, 192, and 256 bit keys

56 bit key

112, 168 bit keys

12

DES - external look

DES

64 bits

plaintext block

64 bits

ciphertext block

key

56 bits

13

Recall: S-P Networks

S

S

S

S

....

P

S

S

S

S

....

P

S

S

S

S

.... .............

14

Confusion / Diffusion

- Confusion - relationship between cleartext and ciphertext is obscured - e.g. substitution (Shift Cipher, Enigma) - Diffusion - spreading influence of one cleartext letter to many ciphertext letters - e.g. permutations

15

Recall: Avalanche effect

S

S

S

S

....

P

S

S

S

S

....

P

S

S

S

S

.... ............. m 1 m 2 m 3 m 4 m 5 m 6 m 7 m 8 m 9 m 10 m 11 m 12

m 61 m 62 m 63 m 64

m 1 → c 1 → c 1 c 2 → c 2 c 3 c 4 c 5 → c 5 c 6 c 7 → c 7 c 8 → c 8 c 9 c1 0 c1 1 → c 11 c1 2

c6 1 → c 61 c6 2 c6 3 c6 4 → c 64

19

Ln+1=Rn Rn+1=Ln⊕ f(Rn, Kn+1)

L 0 R 0 f K 1

L 1 f K 2

L 2 R 2

L 15 R 15 f K 16

R 16 L 16

IP-

IP

R 1

DES Main Loop

Feistel Structure

20

Ln Rn f

Ln+1 Rn+

Kn+

Ln Rn f

Ln+1 Rn+

Kn+

f Kn+

Feistel Structure

Encryption Decryption

??

??

Ln+1, Rn+

Ln, Rn

21

L 0 R 0 f K 1

L 1 f K 2

L 2 R 2

L 15 R 15 f K 16

R 16 L 16

IP

IP-

R 1

R 16 L 16 f K 16

R 15 f K 15

R 14 L 14

R 1 L 1 f K 1

L 0 R 0

IP-

IP

L 15

Decryption

22

Mangler Function of DES, F

23

24

Notation for Permutations

i 1 i 2 i 3 i 4 i 5 i 6 i 7 i 8 i 9 i 10 … i 56 i 57 i 58 i 59 i 60 i 61 i 62 i 63 i 64

i 58 i 50 i 42 i 34 i 26 i 18 i 10 i 2 … i 5 i 63 i 55 i 47 i 39 i 31 i 23 i 15 i 7

Input

Output

28

29

General design criteria of DES

**1. Randomness

  1. Avalanche property** changing a single bit at the input changes on average half of the bits at the output 3. Completeness property every output bit is a complex function of all input bits (and not just a subset of input bits) 4. Nonlinearity encryption function is non-affine for any value of the key 5. Correlation immunity output bits are statistically independent of any subset of input bits

30

Completeness property

Every output bit is a complex function of all input bits (and not just a subset of input bits)

Formal requirement:

For all values of i and j, i=1..64, j=1.. there exist inputs X 1 and X 2 , such that

X 1 x 1 x 2 x 3... xi-1 0 xi+1... x 63 x 64 X 2 x 1 x 2 x 3... xi-1 1 xi+1... x 63 x 64

Y 1 = DES(X 1 ) y 1 y 2 y 3... yj-1 yj yj+1... y 63 y 64 Y 2 = DES(X 2 ) y 1 ’ y 2 ’ y 3 ’... yj-1’ yj yj+1’... y 63 ’ y 64 ’

31

Linear Transformations

Transformations that fulfill the condition:

T(X[m x 1]) = Y[n x 1] = A[n x m] ⋅ X[m x 1]

or T(X 1 ⊕ X 2 ) = T(X 1 ) ⊕ T(X 2 )

Affine Transformations

Transformations that fulfill the condition:

T(X[m x 1]) = Y[n x 1] = A[n x m] ⋅ X[m x 1] ⊕ B[n x 1]

32

Linear Transformations of DES

IP, IP-1, E, PC1, PC2, SHIFT

e.g., IP(X 1 ⊕ X 2 ) = IP(X 1 ) ⊕ IP( X 2 )

Non-Linear and non-affine transformations of DES

S There are no such matrices A[4x6] and B[4x1] that

S(X[6x1]) = A[4x6] ⋅ X[6x1] ⊕ B[4x1]

33

Design of S-boxes

S

S[0..15]

in out = S[in]

- 16! ≈ 2 ⋅ 1013 possibilities - precisely defined initially unpublished criteria - resistant against differential cryptanalysis (attack known to the designers and rediscovered in the open research in 1990 by E. Biham and A. Shamir)

37

Modes of operation of

secret-key block ciphers

38

Block vs. stream ciphers

Stream cipher

memory Block cipher

K K

M 1 , M 2 , …, MN m 1 , m 2 , …, mN

C 1 , C 2 , …, CN c 1 , c 2 , …, cN Ci=fK(Mi) ci = fK(mi, mi-1, …, m 2 , m 1 ) Every block of ciphertext is a function of only one corresponding block of plaintext

Every block of ciphertext is a function of the current and all preceding blocks of plaintext

IS 1 = IV

ci = O(ISi, mi) ISi+1 = NS(ISi, mi)

39

Typical stream cipher

Sender Receiver

P seudorandom K ey G enerator

mi plaintext

ci ciphertext

ki keystream

key initialization vector

P seudorandom K ey G enerator

mi plaintext

ci ciphertext

ki keystream

key initialization vector

40

Standard modes of operation of block ciphers

Block ciphers Stream ciphers

ECB mode Counter mode OFB mode CFB mode CBC mode

41

ECB (Electronic CodeBook) mode

42

Electronic CodeBook Mode - ECB

M 1 M 2 M 3

E

Ci = EK(Mi) for i=1..N

MN-1 MN

E E E E

C 1 C 2 C 3 CN-1 CN

K K K K^ K

46

Counter Mode - CTR

K E

IN

OUT

counter

IV

(^1) L ci

mi

K E

IN

OUT

counter

IV

(^1) L ci

mi

(^1) L 1 L

IS 1 = IV

ci = EK(ISi) ⊕ mi ISi+1 = ISi+

47

J-bit Counter Mode - CTR

m 1 m 2 m 3

E

ci = mi ⊕ ki

ki = E(IV+i-1)[1..j] for i=1..N

mN-1 mN

E E E E

c 1 c 2 c 3 cN-1 cN

IV IV+1 IV+2 IV+N-2 IV+N-

k 1 k 2 k 3 kN-1 kN

K K K^ K^ K

j j j^ j^ j

j (^) j j j j

j j j j j

48

J-bit Counter Mode - CTR

j bits L-j bits

K^ E

IN

OUT

counter

IV

1 j (^) L ci

mi

j bits L-j bits

K^ E

IN

OUT

counter

IV

1 j (^) L ci

mi

(^1) L 1 L

49

OFB (Output FeedBack) Mode

50

Output Feedback Mode - OFB

Encryption

m 1 m 2 m 3

E

ci = mi ⊕ ki

ki =EK(ki-1) for i=1..N, and k 0 = IV

mN-1 mN

E E E E

c 1 c 2 c 3 cN-1 cN

IV

k 1 k 2 k 3 kN-1 kN

51

Output Feedback Mode - OFB

Decryption

c 1 c 2 c 3

E

mi = ci ⊕ ki

ki =EK(ki-1) for i=1..N, and k 0 = IV

cN-1 cN

E E E E

m 1 m 2 m 3 mN-1 mN

IV

k 1 k 2 k 3 kN-1 kN

55

Cipher Feedback Mode - CFB

Encryption

m 1 m 2 m 3

E

mN-1 mN

E E E E

c 1 c 2 c 3 cN-1 cN

IV

ci = mi ⊕ ki

ki =EK(ci-1) for i=1..N, and c 0 = IV

56

Cipher Feedback Mode - CFB

Decryption

m 1 m 2 m 3

E

mN-1 mN

E E E E

c 1 c 2 c 3 cN-1 cN

IV

ci = mi ⊕ ki

ki =EK(ci-1) for i=1..N, and c 0 = IV

57

Cipher Feedback Mode - CFB

K E

IN

OUT (^1) L

ci

mi

K E

IN

OUT (^1) L

ci

mi

1 L (^1) L

IV^ IV

IS 1 = IV

ci = EK(ISi) ⊕ mi ISi+1 = ci

58

J-bit Cipher Feedback Mode - CFB

j bits L-j bits

K^ E

IN

OUT 1 j (^) L

ci

mi

j bits L-j bits

K^ E

IN

OUT 1 j (^) L

ci

mi

L-j bits j bits L-j bits j bits

shift shift

1 L-j L (^1) L-j L

IV^ IV

59

CBC (Cipher Block Chaining) Mode

60

Cipher Block Chaining Mode - CBC

Encryption

m 1 m 2 m 3

E

IV

ci = EK(mi ⊕ ci-1) for i=1..N c 0 =IV

mN-1 mN

...

E E E E

c 1 c 2 c 3 cN-1 cN