S DES and DES Complete
S DES and DES Complete
S DES and DES Complete
3.1 Simplified DES 3.2 Block Cipher Principles 3.3 The Data Encryption Standard 3.4 The Strength of DES 3.5 Differential and Linear Cryptanalysis 3.6 Block Cipher Design Principles 3.7 Block Cipher Modes of Operation Ch06- Contemporary symmetric ciphers
--VIJAY KATTA---VIJAY KATTA-2
stream ciphers process messages a bit or byte at a time when en/decrypting many current ciphers are block ciphers hence are focus of course
--VIJAY KATTA---VIJAY KATTA-4
S-DES
Encryption
Input: 8-bit plaintext 8 Input: 10-bit key K 10 Output: 8-bit ciphertext 8-
Decryption
Input: 8-bit ciphertext 8 Input: 10-bit key K 10 Output: 8-bit plaintext 8--VIJAY KATTA---VIJAY KATTA-6
Encryption/Decryption
IP: initial permutation fK: a complex function (substitution+permutation) SW: a simple permutation (swapping) IP-1: the inverse of IP
--VIJAY KATTA---VIJAY KATTA-7
Encryption
C= IP-1 y fK2 y SW y fK1 y IP (P)
Decryption
P= IP-1 y fK1 y SW y fK2 y IP (C)
SubSub-key generation
10
P10 4 10 1
P10 (k1 k2 k3 k4 k5 k6 k7 k8 k9 k10) k3 k5 k2 k7 k4 k10 k1 k9 k8 k6 e.g. K= 10100 00010 P10(K) = P10 (10100 00010) = 10000 01100
--VIJAY KATTA---VIJAY KATTA-11
12
P8 4 8
5 10 9
13
14
P8 4 8
5 10 9
15
S-DES encryption
16
IP 2 6 3 1 4 8 5 7
IP-1 5 7
18
19
20
SK
21
22
Example: E/P(1001)=11000011
23
2 bits
01 10 11
00
00 01 10 11
01 11 00 11
00 10 10 01
--VIJAY KATTA---VIJAY KATTA--
11 01 01 11
10 00 11 10
24
00
01
10
11
00 01 10 11
00 10 11 10
10 00 00 01
10 01 01 00
11 11 00 11
25
26
10011001 0101
11000011 1010
01
00
1000
--VIJAY KATTA---VIJAY KATTA-27
b5 b6 b7 b8
b1 b2 b3 b4
28
29
Plaintext: 11110011
IP (11110011) = 10111101 = L || R 10111101 F (R, K1)
E/P (1101) K1 = 1110101110100100 = 01001111 (1101) 01001111 S0 (0100) = 11 (0100) S1 (1111) = 11 (1111) P4 (1111) = 1111
30
fK2(1101 0100) = (LF(R, K2), R) 0100) (L = (11010101, 0100) = 0000100 11010101, 0100) IP-1 (10000100) = 01000001
Ciphertext C=01000001
--VIJAY KATTA---VIJAY KATTA-31
S-DES decryption
32
35
Decryption
RS-2 (k1 k2 k3 k4 k5) = k4 k5 k1 k2 k3 RS RS-2 (k4 k5 k1 k2 k3) = k2 k3 k4 k5 k1 RS--VIJAY KATTA---VIJAY KATTA-36
RS-2
RS-2
K2 RS-2 K1
--VIJAY KATTA---VIJAY KATTA-37
RS-2
K1/K2
K2/K1
C/P
--VIJAY KATTA---VIJAY KATTA-38
these form the basis of modern block ciphers S-P networks are based on the two primitive cryptographic operations we have seen before:
substitution (S-box) (S permutation (P-box) (P-
41
5.1.4 Continued
Diffusion The idea of diffusion is to hide the relationship between the ciphertext and the plaintext. Note Diffusion hides the relationship between the ciphertext and the plaintext.
42
5.1.4 Continued
Confusion The idea of confusion is to hide the relationship between the ciphertext and the key. Note Confusion hides the relationship between the ciphertext and the key.
43
5.1.4 Continued
Rounds Diffusion and confusion can be achieved using iterated product ciphers where each iteration is a combination of S-boxes, P-boxes, and other components.
44
45
Diffusion
Each ciphertext alphabet is affected by many plaintext alphabet Repeated permutations
46
48
49
50
encrypts 64-bit data using 56-bit key 6456has widespread use has been considerable controversy over its security
52
DES History
IBM developed Lucifer cipher
by team led by Feistel used 64-bit data blocks with 128-bit key 64128-
then redeveloped as a commercial cipher with input from NSA and others in 1973 NBS issued request for proposals for a national cipher standard IBM submitted their revised Lucifer which was eventually accepted as the DES
--VIJAY KATTA---VIJAY KATTA-53
55
A single round
56
6.2.3 Continued
Figure 6.10
Key generation
57
58
59
60
61
Avalanche effect
A small change in either the plaintext or the key should produce a significant change in the ciphertext In particular, one bit change in either the plaintext or the key half bits change in ciphertext
62
63
Parallel encryptions
Counter (CTR)
--VIJAY KATTA---VIJAY KATTA-66
67
ECB mode
Simplest mode Each block of 64-bit plaintext is handled 64independently It is like a codebook (huge) lookup The same 64-bit block has the same 64cipher text Same key is used in all block encryption. APPLICATION ::Secured Transmission of Key.
--VIJAY KATTA---VIJAY KATTA-68
Ciphertext C=C1C2CN
Ci = EK(Pi), 1eieN 1e
--VIJAY KATTA---VIJAY KATTA-69
70
71
72
weakness due to encrypted message blocks being independent main use is sending a few blocks of data
--VIJAY KATTA---VIJAY KATTA-73
75
76
77
78
79
80
81
82
83
Disadvantage
Complement bits of Ci result in complementing bits in Pi
Not suitable for error-correcting (See the next errordecryption figure)( modify one bit of C1)
--VIJAY KATTA---VIJAY KATTA-85
86
Counter (CTR)
a new mode, though proposed early on similar to OFB but encrypts counter value rather than any feedback value must have a different key & counter value for every plaintext block (never reused)
Ci = Pi XOR Oi Oi = DESK1(i)
Counter (CTR)
88
random access to encrypted data blocks provable security (good as other modes) ? but must ensure never reuse key/counter values, otherwise could break (cf OFB)
--VIJAY KATTA---VIJAY KATTA-89
90
91
92
6.4.1 Continued
Figure 6.14 Meet-in-the-middle attack for double DES
94
6.4.1 Continued
95
96
Triple DES
Plaintext, ciphertext: 64 bits ciphertext: Key K=(K1, K2): 112 bits Encryption: Encryption: C=EK1(DK2(EK1(P))) Decryption: P=DK1(EK2(DK1(P))) Advantages
Key size is larger Compatible with regular one-key DES oneSet K1=K2=K (56-bit) (56C=EK(DK(EK(P)))=EK(P) P=DK(EK(DK(P)))=DK(P)
--VIJAY KATTA---VIJAY KATTA-97
98
6.4.2 Continuous
Triple DES with Three Keys The possibility of known-plaintext attacks on triple DES with two keys has enticed some applications to use triple DES with three keys. Triple DES with three keys is used by many applications such as PGP (See Chapter 16).
99
Plain text = 64 bit. Key =128 bit. Sub key = 52. (16 bit each) Cipher text = 64. Number of identical rounds =8.(6 key in each round) And one output transformation round(4 key)
--VIJAY KATTA---VIJAY KATTA-100
Design Issues
The design philosophy behind the algorithm is one of mixing operation from different algebraic groups. 1) XOR 2)Addition modulo 216 3) Multiplication modulo 216 + 1
101
102
103
Encryption Algorithm.
104
Sequence of operation
1)Multiply x1 and first sub key(sk) 2)Add x2 and second sk 3)Add x3 and third sk 4)Multiply x4 and fourth sk 5) Step 1 step 3 6) Step 2 step 4 7)Multiply step 5 with fifth sk. 8)Add result of step 6 and step 7 9) Multiply result of step 8 with sixth sk. 10)Add result of step 7 and step 9.
--VIJAY KATTA---VIJAY KATTA-105
Continue..
11) XOR result of steps 1 and step 9. 12) XOR result of steps 3 and step 9. 13) XOR result of steps 2 and step 10. 14) XOR result of steps 2 and step 10.
106
107
Next generation
NIST begin the process of selecting the nextnext-generation secret-key encryption secretalgorithm in 1998. Advanced encryption standard (AES)
Rijndael (Chapter 5) (Chapter 5)
Plaintext, ciphertext: at least 128 bits. bits. Key size: flexible, at least 128 bits. bits. You can check its web.
Http://www.nist.gov/aes
--VIJAY KATTA---VIJAY KATTA-108
Stream Ciphers
process the message bit by bit (or byes) (as a stream) typically have a (pseudo) random stream key combined (XOR) with plaintext bit by bit (XOR) randomness of stream key completely destroys any statistically properties in the message
Ci = Mi XOR StreamKeyi
111
protocol standard IEEE 802.11a 802.11b 802.11g (WEP) 802.11i (TKIP short-term solution)
112
113
Long-term solution
A single key to provide confidentiality and integrity Provide integrity protection for the plaintext packet header, as well as
--VIJAY KATTA---VIJAY KATTA-114
TKIP
RC4 128-bit encryption 1286464-bit authentication 4848-bit IV TKIP mixing function Michael Enforcing IV sequencing IEEE802.1X
115
EAP
RADIUS
116