Download as pdf or txt
Download as pdf or txt
You are on page 1of 32

King Fahd University of Petroleum & Minerals

College of Computer Science & Engineering

Information & Computer Science Department

SEC 521
Network Security

Cryptography

These slides are based on:


Chapter 5, 6 Cryptography and Network Security, Forouzan
Modern Ciphers

• Traditional ciphers are character oriented.


• Computing systems use bit-oriented ciphers.
• Characters are replaced by 8 bit (or 16) bits
• The data are not only characters but can be -
• Numbers
• Graphics
• Audio
• Video

2
Modern Ciphers

• Block Ciphers
• If the message is more than n-bits, it is divided into n-bit blocks
• Encrypts n-bit block of plaintext
• Decrypts n-bit ciphertext to plaintext
• If the message is fewer than n-bits padding is added to make n-bit
block
• Substitution ciphers
• A 1-bit or 0-bit in the plaintext is replaced by either a 0 or a 1
• Transposition ciphers
• The bits are only reordered
• The same number of 1’s in plaintext and ciphertext
• Modern block ciphers are designed in combination of
transposition and substitution units 3
Modern Ciphers

• P-Box (Permutation box)


• Transposes bits like transposition ciphers for characters
• Three types of P-box
• Straight P-box (5x5)
• Compressed P-box (5x3)
• Expansion P-box (3x5)
• Straight P-boxes (n x n) can create n! mappings
• Compressed P-boxes are used when the number of bits
need to be decreased
• Expansion P-boxes (m x n) are used when (m-n) entries
are mapped to more than one output

4
Modern Ciphers

• S-Box (Substitution box)


• S-box is m x n substitution unit, where m and n are not
necessarily the same
• With n inputs and m outputs, the inputs x0 , x1 , … , xn and
the outputs y1 , … , ym can be represented as –
• y1 = f1(x1,x2,x3, …., xn)
• y2 = f2(x1,x2,x3, …., xn)
• ------------
• ym = fm(x1,x2,x3, …., xn)

5
Modern Ciphers

• Mixer (Feistel Design)


• C = P XOR f(K)
• P = C XOR f(K) = P XOR f(K) XOR f(K)= P XOR (00..0) = P
• The mixer is self-invertible
• For Example – P = 0111 and K = f(101) = 1001
• C = 0111 XOR 1001 = 1110
• P = 1110 XOR 1001 = 0111

6
DES (Data Encryption Standard)

7
DES Overview

8
DES Overview

9
DES Permutations

10
DES Permutation Tables

11
DES Permutation Example

12
DES Overview

13
DES Round

14
DES Function

15
DES Expansion

16
DES Expansion p-box table

17
DES XOR

18
DES S-Boxes

19
DES S-Boxes

20
DES S-Box1

21
DES S-Box1 Example

22
DES Straight Permutation

23
DES Encryption and Decryption

24
DES Key Generation

25
DES Key Generation

26
DES Key Generation

27
DES Analysis

28
DES Analysis

29
DES Analysis

30
DES Analysis

Completeness effect means that each bit of the


ciphertext needs to depend on many bits on
the plaintext

31
The end

Important to do at home :
- Read Chapter 5,6 of Forouzan book

You might also like