Symmetric Cryptography: Block Ciphers Lecture 4 (May 7, 2012)
Symmetric Cryptography: Block Ciphers Lecture 4 (May 7, 2012)
Symmetric Cryptography: Block Ciphers Lecture 4 (May 7, 2012)
AOT
Agententechnologien in betrieblichen Anwendungen und der Telekommunikation
Acknowledgements
This presentation is in part based on:
Cryptography and Network Security by W. Stallings Cryptography: Theory and Practice by D.R. Stinson Lecture slides prepared under my TA-ship for the Network Security Lecture of Prof. B. Yener at RPI, New York.
AOT
Product Cryptosystem
Product of non-idenpotent cryptosystems increase security (e.g., product of substitution with permutation ciphers) Modern Block Ciphers
AOT
AOT
AOT
AOT
Function F:
Provides confusion, is nonlinear, avalanche
Key Schedule
Complex subkey creation, key avalanche
AOT
DES History
IBM developed Lucifer cipher
a team led by Feistel 64-bit data blocks with 128-bit key
Redeveloped as a commercial cipher with input from NSA and others IBM revised Lucifer which was eventually accepted as the national cipher standard
AOT
DES Encryption
AOT
Example:
IP(675a6967 5e5a6b5a) = (ffb2194d 004df6fb)
AOT
AOT
F(R, K)
Takes 32-bit Right half and 48-bit Subkey Expands Right half to 48-bits using Perm E XORs with Subkey Passes through 8 S-boxes to get 32-bit result Finally permutes this using 32-bit Perm P
AOT
AOT
AOT
AOT
Example:
S(18 09 12 3d 11 17 38 39) = 5fd25e03
AOT
Column Address
Row Address
AOT
AOT
AOT
AOT
DES Decryption
Encryption steps using subkeys in reverse order (SK16 SK1) IP undoes final FP step of encryption 1st round with SK16 undoes 16th encrypt round 16th round with SK1 undoes 1st encrypt round Final FP undoes initial encryption IP Recovers original data value
AOT
AOT
AOT
Simplified DES
Educational purpose Works on 8-bit blocks and uses 10-bit key for rounds Consider that plaintext and ciphertext are known:
Plaintext : p1, p2, , p8 Ciphertext: c1, c2, , c8 Key: k1, k2, , k10
Simplified encryption algorithm will produce 8 non-linear equations (combination of linear and non-linear equations) with 10 unknowns. Note that:
Permutations (P10, P8, P4) are linear xor additions are linear Substitution boxes (S0 and S1) are non-linear!
AOT
2
8-bit plain text
P10
8-bit K1
+ F
5-bit
8-bit K2 + F P8 K1
Left Shift Left Shift Inverse Initial Perm. 8-bit cipher text
P8 K2
AOT
4-bit
F function
1 2 3 4 4-bit
S0 2-bit P4 4-bit
S1
0 0 1 2 3
0 2 3 2
1
1 0 0 1
2
2 1 1 0
3
3 3 0 3
2-bit
2 3
S0 Substitution Matrix
S1 Substitution Matrix
AOT
P4 2 4 3 1
Initial Key: 10 bits P10 8-bit plain text Initial Permutation 4-bit 4-bit 5-bit 5-bit 8-bit cipher text Initial Permutation 4-bit 4-bit
8-bit K1 + F
P8 8-bit K1
Left Shift Left Shift
8-bit K2 + F
8-bit K2 +
P8 8-bit K2
8-bit K1 +
AOT
AOT
Needs to be Non-idenpotent
No K3 such that C = EK2(EK1(P)) = EK3(P)
AOT
Modes of Operation
Block ciphers encrypt fixed size blocks
DES encrypts 64-bit blocks, with 56-bit key What if arbitrary amount of information needs to encrypted
AOT
AOT
Usage: secure transmission of single block of info needs to be sent (e.g., a session key) Repetitions in message may show in ciphertext
E.g., graphics or messages that change very little
AOT
AOT
AOT
AOT
AOT
AOT
AOT
Uses: stream encryption over noisy channels, bursty traffic Must never reuse the same sequence (Key+IV)
AOT
AOT
Similar to OFB but encrypts counter value rather than any feedback value
Can do parallel encryptions Random access to encrypted data blocks Ci = Pi XOR Oi Oi = DESK1(i)
Block Ciphers
Data Encryption Standard (DES) Triple-DES (3-DES) Modes of Operation
AOT
AOT
Triple-DES slow with small blocks US NIST issued call for ciphers in 1997
15 candidates accepted in June 1998 5 were short-listed in August 1999 Rijndael was selected as the AES in October 2000 Issued as FIPS PUB 197 standard in November 2001
AOT
Simplified AES
16-bit Plaintext 16-bit key 3 round with initial add key
AOT
Simplified AES
Nibble Representation
AOT
AOT
AOT
Operations in GF(24)
AOT
AOT
Round Constant RC[i]=xi+2 RC[1]=x3 mod (x4+x+1) =1000 RC[2] = x4 mod (x4+x+1)= RC[2] = x+1 = 0011
0000
AOT
Example Z8
a b mod 8 1, 3, 5, 7 has inverses Unbalanced occurances in multiplication table
Therefore we need GF(23)
6 7 8 4
AOT
Galois Fields
Finite fields play a key role in cryptography Number of elements in a finite field must be a power of a prime pn Denoted GF(pn)
GF(p) is the set of integers {0,1, , p-1} with arithmetic operations modulo prime p
Form a finite field, since have multiplicative inverses
Hence arithmetic is well-behaved and can do addition, subtraction, multiplication, and division without leaving the field GF(p)
AOT
Example GF(7)
a b mod 7 Inverses Balanced occurrences
AOT
GF(8) = GF(23)
0 000 0 1 001 1 2 010 x 3 011 x+1 4 100 x2 5 101 x2+1 6 110 x2+x 7 111 x2+x+1
AOT
Example GF(23)
AOT
Block Ciphers
Data Encryption Standard (DES) Triple-DES (3-DES) Modes of Operation Advanced Encryption Standards (AES)
Simplified AES
AOT