NS 3
NS 3
• We focus now on the most widely used symmetric cipher: DES
– DES has been replaced by AES as a standard
– We will use DES to illustrate the principles of modern symmetric
ciphers
• Adopted in 1977 by the National Bureau of Standards (US),
nowadays NIST
• Originates from an IBM project from late 1960s led by Feistel
– Project ended in 1971 with the development of LUCIFER (key 128
bits)
– LUCIFER was then refined with the help of NSA to produce DES (key
56 bits)
– Immediate criticism: the reduction in key length was enormous and the
internal details of the design were (and remained) classified information
– 1994: DES is reaffirmed as a standard for 5 more years
– 1999: DES should only be used for legacy systems and 3DES should
replace it
Block cipher principles
• We focus now on the most widely used symmetric cipher: DES
– DES has been replaced by AES as a standard
– We will use DES to illustrate the principles of modern symmetric
ciphers
• Adopted in 1977 by the National Bureau of Standards (US),
nowadays NIST
• Originates from an IBM project from late 1960s led by Feistel
– Project ended in 1971 with the development of LUCIFER (key 128
bits)
– LUCIFER was then refined with the help of NSA to produce DES (key
56 bits)
– Immediate criticism: the reduction in key length was enormous and the
internal details of the design were (and remained) classified information
– 1994: DES is reaffirmed as a standard for 5 more years
– 1999: DES should only be used for legacy systems and 3DES
shouldreplace it
Conventional Encryption
Algorithms
• Data Encryption Standard (DES)
– The most widely used encryption scheme
– The algorithm is reffered to the Data
Encryption Algorithm (DEA)
– DES is a block cipher
– The plaintext is processed in 64-bit blocks
– The key is 56-bits in length
DES encryption scheme
• K = 133457799BBCDFF1
– K = 00010011 00110100 01010111 01111001 10011011 10111100 11011111
11110001
Step 1: Create 16 sub keys, each of which is 48-bits
long.
• In the general scheme of DES is shown that a 64-bit key is used –the bits of the key
are numbered from 1 to 64.
• The algorithm ignores every 8, 16, 24, 32, 40, 48, 56, and 64 bit –thus, the key for
DES is effectively 56-bit long
Sub keys cont’d
• Example: From the original 64-bit key
– K = 00010011 00110100 01010111 01111001
10011011 10111100 11011111 11110001
– we get the 56-bit permutation
• K+ = 1111000 0110011 0010101 0101111
0101010 1011001 1001111 0001111
• Next, split this key into left and right halves, C0
and D0, where each half has 28 bits.
Example: From the permuted key K+, we get
C0 = 1111000 0110011 0010101 0101111
D0 = 0101010 1011001 1001111 0001111
C1 = 1110000110011001010101011111
D1 = 1010101011001100111100011110
C2 = 1100001100110010101010111111
D2 = 0101010110011001111000111101
C3 = 0000110011001010101011111111
D3 = 0101011001100111100011110101
C4 = 0011001100101010101111111100
D4 = 0101100110011110001111010101
C5 = 1100110010101010111111110000
D5 = 0110011001111000111101010101
C6 = 0011001010101011111111000011
D6 = 1001100111100011110101010101
C7 = 1100101010101111111100001100
D7 = 0110011110001111010101010110
…
……….
Sub key contd
• We now form the keys Kn, for 1<=n<=16, by
applying the following permutation table to each of
the concatenated pairs CnDn. Each pair has 56
• There is an initial permutation IP of the 64 bits of the message data M. This rearranges the bits
according to the following table
• Example: Applying the initial permutation to the block of text M, given previously, we get
• M = 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110
1111
IP = 1100 1100 0000 0000 1100 1100 1111 1111 1111 0000 1010 1010 1111 0000 1010
1010
Step 2 contd
• Next divide the permuted block IP into a left half L0 of 32 bits, and a right half R0 of
32 bits.
• Example: From IP, we get L0 and R0
• L0 = 1100 1100 0000 0000 1100 1100 1111 1111
R0 = 1111 0000 1010 1010 1111 0000 1010 1010
• for 1<=n<=16, using a function f which operates on two blocks--a data block
of 32 bits and a key Kn of 48 bits--to produce a block of 32 bits. Let +
denote XOR addition, Then for n going from 1 to 16 we calculate
• Ln = Rn-1
Rn = Ln-1 + f(Rn-1,Kn)
• Example: For n = 1, we have
– K1 = 000110 110000 001011 101111 111111 000111 000001 110010
L1 = R0 = 1111 0000 1010 1010 1111 0000 1010 1010
R1 = L0 + f(R0,K1)
Step 2 contd
• To calculate f, we first expand each block Rn-1 from 32 bits to 48 bits. This is done by
using a selection table
• Example: We calculate E(R0) from R0 as follows:
• R0 = 1111 0000 1010 1010 1111 0000 1010 1010
E(R0) = 011110 100001 010101 010101 011110 100001 010101 010101
• Triple DES
• RC5
• RC4
• Blowfish (read from the book or other
reference)
Replacing DES
• C=EK2(EK1(P))
• To decrypt simply use DES decryption twice
• P=DK1(DK2(C))
• The scheme involves now a key of 112 bits
which should make it much more secure than
DES, at least in principle
Meet-in-the-middle attack
• The meet-in-the-middle attack targets block cipher cryptographic
functions
• X=EK1(P)=DK2(C)
• Assume we have two pairs of plaintext-ciphertext (of only one byte
each!)
• Given a known pair (P,C) attack as follows:
– Encrypt P for all 2^56possible keys K1
– Store the results in a table and sort the table by the values of X
– Decrypt C using all possible 2^56possible keys K2
– For each decryption check the result in the table
– In case of match, either we have the answer, or a false positive
– Test the two keys with the second pair of plaintext-ciphertext: if they
match, the correct keys were found
Triple DES
• use three stages of encryption with three
different keys
• C=EK3(EK2(EK1(P)))
– Drawback: keys is now 168 bits which
makes it slower
– Alternative: 3DES with 2 keys: K3=K1
• Another alternative: instead of three
encryptions, use 2 encryptions and one
decryption
Triple DES
• Use three keys and three executions of
the DES algorithm (encrypt-decrypt-
encrypt)
C = EK3[DK2[EK1[P]]]
• C = ciphertext
• P = Plaintext
• EK[X] = encryption of X using key K
• DK[Y] = decryption of Y using key K
Triple DEA