Lec 5
Lec 5
Block Stream
cipher cipher
DES RC4
Blowfish A5
Stream Cipher
6
Stream Cipher
Convert the plaintext to cipher text one bit at a time.
XOR a stream of plaintext with key stream from a pseudo-
random sequence generator.
At decryption, the same key stream is XOR with the
cipher steam bits to extract plaintext.
6
Block Cipher Principles
most symmetric block ciphers are based on a
Feistel Cipher Structure
needed since must be able to decrypt ciphertext to
recover messages efficiently
block ciphers look like an extremely large
substitution
would need table of 264 entries for a 64-bit block
instead create from smaller building blocks
using idea of a product cipher
7
Block Cipher
Divide input bit stream into n –bit sections.
No dependency/history between sections.
In a secure block cipher, each output bit is a function of all n
input bits and all K key bits.
8
Block Ciphers vs. Stream Ciphers.
11
Data Encryption Standard (DES)
12
Initial Permutation IP
first step of the data computation
IP re-orders the input data bits
even bits to LH half, odd bits to RH half
quite regular in structure (easy in h/w)
example:
13
Initial Permutation IP
14
Initial Permutation IP
15
Feistel Cipher Structure
16
Feistel Cipher Structure
17
Feistel Cipher Structure One round
18
Feistel Cipher Structure One round
19
Details of the F-function
20
Substitution Boxes S
have eight S-boxes which map 6 to 4 bits
each S-box is actually 4 little 4 bit boxes
outer bits 1 and 6 (row bits) select one rows
inner bits 2-5 (column bits) are substituted
result is 8 lots of 4 bits, or 32 bits
row selection depends on both data and key
feature known as autoclaving (auto-keying)
example:
S(18 09 12 3d 11 17 38 39) = 5fd25e03
21
22
Example:
The input to S-box I 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, (S-box 1). The result is 12 in decimal, which in binary is 1100.
So the input 100011 yields the output 1100.
23
24
25
DES Key agenda
Forms sub-keys used in each round
consists of:
initial permutation of the key (PC1) which selects 56-bits in two 28-bit halves
26
Key generation
29
Reversed Key Secheduler for encryption of DES
30
Decryption of DES
31
Reversed Key Secheduler for decryption of
DES
32
Block ciphers modes of operation
Modes of
Operation
Deterministic Probabilistic
enc
enc
book
• ECB • OFB
• CFB
(cipher feed
33
51 back)
Multiple Encryption
1.Double Encryption
Note:
The keyspace of this encryption is |k| = 2k . 2k =22k
However, using the meet-in-the-middle attack, the key
search is reduced significantly.
52
Multiple Encryption
2.Triple Encryption
53