Unit-2 - DES
Unit-2 - DES
And
Data Encryption Standard (DES)
Stream ciphers and Block ciphers
A stream cipher is one that encrypts a digital data stream one bit or one
byte at a time. E.g. Vernam cipher
2
Stream cipher Block Cipher
3
Motivation for the feistel cipher structure
A block cipher operates on a plaintext block of n bits to produce a
ciphertext block of n bits.
There are 2n possible different plaintext blocks and for the encryption to be
reversible (i.e., for decryption to be possible), each must produce a unique
ciphertext block. Such a transformation is called reversible, or nonsingular.
For n=2,
00 11 00 11
01 10 01 10
10 00 10 01
11 01 11 01
4
Ideal Block Cipher
5
Ideal Block Cipher (Conti…)
6
Ideal Block Cipher (Conti…)
7
Ideal Block Cipher (Conti…)
However, the ideal block cipher for a large block size is not
practical from an implementation and performance point of
view.
8
Diffusion and Confusion
The terms diffusion and confusion were introduced by Claude
Shannon.
9
Diffusion Confusion
Look for to make the statistical Look for to make the statistical
relationship between plaintext and relationship between ciphertext and
ciphertext as complex as possible encryption key as complex as possible
11
The feistel cipher
Feistel proposed the idea that use the concept of a product
cipher, which is the execution of two or more simple ciphers
in sequence in such a way that the final resulting cipher is
cryptographically stronger than any of the component ciphers.
so S = S1 x S2 : A → C.
12
Feistel cipher structure
The input to the encryption
algorithm are a plaintext block
of length 2w bits and a key K.
The plaintext block is divided
into two halves, L0 and R0.
Two halves of the data pass
through n rounds of processing
and then combine to produce
the ciphertext block.
Each round i has input Li-1 and
Ri-1, derived from the previous
round, as well as a subkey Ki,
derived from overall K.
In general, the sub keys Ki are
different from K and from
13
each other.
Feistel cipher structure (Conti…)
14
Feistel Cipher Design Elements
Block size
15
Feistel Cipher Design Elements (Conti…)
Key size
16
Feistel Cipher Design Elements (Conti…)
Number of rounds
The essence of the feistel cipher if that a single round offers inadequate
security but that multiple rounds offers increasing security.
Round function
17
Feistel Encryption Decryption Algorithm
20
Feistel Encryption Decryption Algorithm (Conti…)
Let
F be the round function and
K0,K1,K2, . . . ,KN+1 be the sub-keys for
the rounds 0,1,2,3,….n respectively
Basic operation:
split the plaintext block into two equal pieces, (L0, R0)
for each round , compute
Li+1 = Ri
Ri+1 = Li F(Ri, Ki)
Then the ciphertext is (Rn, Ln)
Commonly, two pieces Rn and Ln are not switched after
the last round
21
Feistel Encryption Decryption Algorithm (Conti…)
Li = Ri+1
22
Data Encryption Standard- History
The most widely used encryption scheme is based on the Data Encryption
Standard (DES) adopted in 1977 by the National Bureau of Standards, now
the National Institute of Standards and Technology (NIST).
23
Data Encryption Standard- History (Conti…)
Because of the promising results produced by the LUCIFER project, IBM
embarked on an effort to develop a marketable commercial encryption product
that ideally could be implemented on a single chip.
The effort was headed by walter tuchman and carl meyer, and it involved not
only IBM researchers but also outside consultants and technical advice from
NSA.
The outcome of this effort was a refined version of LUCIFER that was more
resistant to cryptanalysis but that had a reduced key size of 56 bits, to fit on a
single chip.
In 1973, the national Bureau of Standards (NBS) issued a request for proposals
for a national cipher standard.
IBM submitted the results of its Tuchman-Meyer project and this by far the
best algorithm proposed and was adopted in 1977 as the Data Encryption
24
Standard.
DES Overview
16 such Rounds
employs
standard repetitions of arithmetic/logical operations on numbers
of 64 bits
blocks
64 bit blocks in/out
26
DES Encryption
27
DES Encryption (Conti…)
Initial Permutation
X=IP(M)
28
DES Encryption (Conti…)
29
Details of Single Round of DES Algorithm
30
Details of Single Round of DES Algorithm (Conti…)
The left and right halves of each 64-bit intermediate value are
treated as separate 32-bit quantities, labeled L (left) and R
(right).
31
Details of Single Round of DES Algorithm (Conti…)
32
Details of Single Round of DES Algorithm (Conti…)
33
Details of Single Round of DES Algorithm (Conti…)
Substitution (s-box)
The substitution consists of a set of eight S-boxes, each of which accepts
6 bits as input and produces 4 bits as output.
34
S-Boxes
35
Details of Single Round of DES Algorithm (Conti…)
The first and last bits of the input to box form a 2-bit binary number
to select one of four substitutions defined by the four rows in the
table for .
The decimal value in the cell selected by the row and column is then
converted to its 4-bit representation to produce the output.
Example:
011001
37
38
Details of Single Round of DES Algorithm (Conti…)
Substitution (s-box)
The substitution consists of a set of eight S-boxes, each of which accepts
6 bits as input and produces 4 bits as output.
39
DES Encryption
40
Details of Single Round of DES Algorithm (Conti…)
Key Generation
64-bit key is used as input to the algorithm.
The bits of the key are numbered from 1 through 64; every eighth
bit is ignored.
41
Details of Single Round of DES Algorithm (Conti…)
42
Details of Single Round of DES Algorithm (Conti…)
Substitution (s-box)
The substitution consists of a set of eight S-boxes, each of which accepts
6 bits as input and produces 4 bits as output.
43
Details of Single Round of DES Algorithm (Conti…)
Key Generation (Conti…)
The resulting 56-bits key of (PC-1) is then treated as two 28-bit quantities,
labeled C0 and D0.
At each round Ci-1 and Di-1 are separately subjected to a circular left shift of 1
or 2 bits governed by following table.
44
Details of Single Round of DES Algorithm (Conti…)
45
The Strength of DES
The use of 56-bit keys
With the key length of 56 bits, there are 256 possible keys, which is
approximately 7.2x1016 keys. Thus, on the face of it, brute-force attack
appears impractical.
As far back as 1977, diffie and hellman postulated that the technology
existed to build a parallel machine with 1 million encryption devices,
each of which could perform one encryption per microsecond.
The authors estimated that the cost would be about $20 million in 1977.
DES finally and definitively proved insecure in july 1998, when the
Electronic Frontier Foundation (EFF) announced that it had broken a
DES encryption using a special-purpose “DES Crackers” machine that
was built for less than $250000.
46
The Strength of DES (Conti…)
The nature of the DES Algorithm.
The focus of concern has been on the eight substitution tables (S-boxes) that
are used in each iteration.
Because the design criteria for these boxes, and indeed for the entire algorithm,
were not made public, there is a mistrust that the boxes were constructed in
such a way that cryptanalysis is possible for an adversary who knows the
weakness in the S-boxes.
This statement is attracting and over the years a number of regularities and
unexpected behaviors of the S-boxes have been discovered.
Even if this , no one has so far succeeded in discovering the supposed fatal
weaknesses in the S-boxes. 47
The Strength of DES (Conti…)
Timing Attacks
Timing attack is one in which information about the key or the plaintext is
obtained by observing how long it takes a given implementation to perform
decryptions on various ciphertext.
48
The Strength of DES (Conti…)
Linear Cryptanalysis Attack
For example, the following equation, states the XOR sum of the first and
third plaintext bits and the first ciphertext bit is equal to the second bit of
the key:
This attack is generally not practical because it can find a DES key given
243known plaintexts.
49
The Strength of DES (Conti…)
Differential cryptanalysis Attack:
This attack is generally not practical because it can find a DES key given
247 chosen plaintexts.
50
Number of Rounds
The greater the number of rounds, the more difficult it is to perform
cryptanalysis,
52
Key Schedule Algorithm
With any Feistel block cipher, one key is used to generate one
subkey for each round.
53
Design of function F
Algorithm of F should have good avalanche properties.
55