Des PDF
Des PDF
Des PDF
As mentioned earlier there are two main types of cryptography in use today - symmet-
ric or secret key cryptography and asymmetric or public key cryptography. Symmet-
ric key cryptography is the oldest type whereas asymmetric cryptography is only being
used publicly since the late 1970s1 . Asymmetric cryptography was a major milestone
in the search for a perfect encryption scheme.
Secret key cryptography goes back to at least Egyptian times and is of concern here.
It involves the use of only one key which is used for both encryption and decryption
(hence the use of the term symmetric). Figure 2.1 depicts this idea. It is necessary for
security purposes that the secret key never be revealed.
? ?
Plaintext (P ) - E{P,K} - Ciphertext (C) - D{C,K} - Plaintext (P )
To accomplish encryption, most secret key algorithms use two main techniques known
as substitution and permutation. Substitution is simply a mapping of one value to
another whereas permutation is a reordering of the bit positions for each of the inputs.
These techniques are used a number of times in iterations called rounds. Generally,
the more rounds there are, the more secure the algorithm. A non-linearity is also
introduced into the encryption so that decryption will be computationally infeasible2
without the secret key. This is achieved with the use of S-boxes which are basically
non-linear substitution tables where either the output is smaller than the input or vice
versa.
1
It is claimed by some that government agencies knew about asymmetric cryptography before this.
2
This means that it costs more to implement the attack than the information is worth.
10
Chapter 2 The DES Algorithm
One of the main problems with secret key cryptography is key distribution. For this
form of cryptography to work, both parties must have a copy of the secret key. This
would have to be communicated over some secure channel which, unfortunately, is not
that easy to achieve. As will be seen later, puplic key cryptography provides a solution
to this.
3
Now known as the National Institute of Standards and Technology (NIST).
4
This is where every possible key is tried in order to determine the actual key.
11
Chapter 2 The DES Algorithm
knowledge at the time and they didnt want them leaking - this is quite a plausible
claim as differential cryptanalysis has shown. However, despite all this controversy, in
1994 NIST reaffirmed DES for government use for a further five years for use in areas
other than classified.
DES of course isnt the only symmetric cipher. There are many others, each with vary-
ing levels of complexity. Such ciphers include: IDEA, RC4, RC5, RC6 and the new
Advanced Encryption Standard (AES). AES is an important algorithm and was orig-
inally meant to replace DES (and its more secure variant triple DES) as the standard
algorithm for non-classified material. However as of 2003, AES with key sizes of 192
and 256 bits has been found to be secure enough to protect information up to top se-
cret. Since its creation, AES had underdone intense scrutiny as one would expect for
an algorithm that is to be used as the standard. To date it has withstood all attacks but
the search is still on and it remains to be seen whether or not this will last. We will
look at AES later in the course.
5
This was a typical block size used in cryptographic algorithms for the past number of years as it
made attacks difficult to implement but was small enough for efficient manipulation. With the introduc-
tion of AES the block size has increased to at least 128 bits.
12
Chapter 2 The DES Algorithm
the standard).
Figure 2.2 shows the sequence of events that occur during an encryption operation.
DES performs an initial permutation on the entire 64 bit block of data. It is then split
into 2, 32 bit sub-blocks, Li and Ri which are then passed into what is known as a
round (see figure 2.3), of which there are 16 (the subscript i in Li and Ri indicates
the current round). Each of the rounds are identical and the effects of increasing their
number is twofold - the algorithms security is increased and its temporal efficiency
decreased. Clearly these are two conflicting outcomes and a compromise must be
made. For DES the number chosen was 16, probably to guarantee the elimination of
any correlation between the ciphertext and either the plaintext or key6 . At the end of the
16th round, the 32 bit Li and Ri output quantities are swapped to create what is known
as the pre-output. This [R16 , L16 ] concatenation is permuted using a function which
is the exact inverse of the initial permutation. The output of this final permutation is
the 64 bit ciphertext.
32 bits
? ?
32 bits 56 bits
?
? ? ?
? ? K15 ?
Round 15
48 bits Permuted choice 2
56 bits Left circular shift
32 bits 32 bits 56 bits
? ? K16 ?
Round 16
48 bits Permuted choice 2
56 bits Left circular shift
32 bits ? ?32 bits
32 bit Swap
64 bits
?
Inverse Permutation
...
? ? ? ?
64-bit ciphertext
So in total the processing of the plaintext proceeds in three phases as can be seen from
6
No reason was given in the design specification as to why 16 rounds were chosen.
13
Chapter 2 The DES Algorithm
1. Initial permutation (IP - defined in table 2.1) rearranging the bits to form the
permuted input.
2. Followed by 16 iterations of the same function (substitution and permutation).
The output of the last iteration consists of 64 bits which is a function of the
plaintext and key. The left and right halves are swapped to produce the preoutput.
3. Finally, the preoutput is passed through a permutation (IP1 - defined in table
2.1) which is simply the inverse of the initial permutation (IP). The output of
IP1 is the 64-bit ciphertext.
As figure 2.2 shows, the inputs to each round consist of the Li , Ri pair and a 48 bit
subkey which is a shifted and contracted version of the original 56 bit key. The use of
the key can be seen in the right hand portion of figure 2.2:
Initially the key is passed through a permutation function (PC1 - defined in table
2.2)
For each of the 16 iterations, a subkey (Ki ) is produced by a combination of a left
circular shift and a permutation (PC2 - defined in table 2.2) which is the same
14
Chapter 2 The DES Algorithm
for each iteration. However, the resulting subkey is different for each iteration
because of repeated shifts.
Details of an individual round can be seen in figure 2.3. The main operations on the
data are encompassed into what is referred to as the cipher function and is labeled F.
This function accepts two different length inputs of 32 bits and 48 bits and outputs a
single 32 bit number. Both the data and key are operated on in parallel, however the
operations are quite different. The 56 bit key is split into two 28 bit halves Ci and Di
(C and D being chosen so as not to be confused with L and R). The value of the key
used in any round is simply a left cyclic shift and a permuted contraction of that used
in the previous round. Mathematically, this can be written as
Ki = P C2 (Ci , Di ) (2.2)
15
Chapter 2 The DES Algorithm
where Lcsi is the left cyclic shift for round i, Ci and Di are the outputs after the shifts,
P C2 (.) is a function which permutes and compresses a 56 bit number into a 48 bit
number and Ki is the actual key used in round i. The number of shifts is either one
or two and is determined by the round number i. For i = {1, 2, 9, 16} the number of
shifts is one and for every other round it is two (table 2.2).
m
? ? ?
F A
A PC2
? A
A
S-box
Ki
A
A
?
Perm.
- m
?
? ? ? ?
Li Ri Ci Di
The common formulas used to describe the relationships between the input to one
round and its output (or the input to the next round) are:
Li = Ri1 (2.3)
1. The E-box expansion permutation - here the 32-bit input data from Ri1 is ex-
panded and permuted to give the 48 bits necessary for combination with the
48 bit key (defined in table 2.1). The E-box expansion permutation delivers a
larger output by splitting its input into 8, 4-bit blocks and copying every first and
fourth bit in each block into the output in a defined manner. The security offered
by this operation comes from one bit affecting two substitutions in the S-boxes.
16
Chapter 2 The DES Algorithm
This causes the dependency of the output bits on the input bits to spread faster,
and is known as the avalanche affect.
2. The bit by bit addition modulo 2 (or exclusive OR) of the E-box output and 48
bit subkey Ki .
4. The P-box permutation - This simply permutes the output of the S-box without
changing the size of the data (defined in table 2.1). It is simply a permutation
and nothing else. It has a one to one mapping of its input to its output giving a
32 bit output from a 32 bit input.
The DES algorithm is a basic building block for providing data security. To apply
DES in a variety of applications, five modes of operation have been defined which
cover virtually all variation of use of the algorithm and these are shown in table 2.4.
We will be discussing these in more detail in the next lecture.
7
Later they claimed that there were certain attacks that they knew about , e.g. differential cryptanal-
ysis, which would have been revealed to the public if the design criteria had been exposed.
17
Chapter 2 The DES Algorithm
18
Chapter 2 The DES Algorithm
The decryption process with DES is essentially the same as the encryption process and
is as follows:
Use the ciphertext as the input to the DES algorithm but use the keys Ki in
reverse order. That is, use K16 on the first iteration, K15 on the second until K1
which is used on the 16th and last iteration.
A desirable property of any encryption algorithm is that a small change in either plain-
text or key should produce significant changes in the ciphertext. DES exhibits a strong
avalanche effect. Table 2.5 illustrates this.
19
Chapter 2 The DES Algorithm
Table 2.5: Avalanche effect - a small change in the plaintext produces a significant change in
the ciphertext.
As mentioned initially, since its adoption as a federal standard there have been concerns
about the level of security provided by DES in two areas, Key size and nature of the
algorithm.
56 bit key length (approx 7.2 1016 ) on initial consideration brute-force at-
tack seems impractical. However with a massively parallel machine of about
5000 nodes with each node capable of achieving a key search rate of 50 mil-
lion keys/sec, the time taken to do a brute-force search is approximately 100 hrs
which is far from excessive.
20
Chapter 2 The DES Algorithm
clipper project raises many question. These are the main reasons DES is now
being replaced by the AES standard which we will look at later on.
21