4-1 CNS R20
4-1 CNS R20
UNIT -II
Symmetric Encryption
Mathematics of Symmetric Key Cryptography, Introduction to Modern Symmetric Key Ciphers,
Data Encryption Standard, Advanced Encryption Standard.
Cryptography ?
Cryptography is a technique of securing information and communications through use of codes. Thus
preventing unauthorized access to information. The prefix “crypt” means “hidden” and suffix graphy means
“writing”.
Cryptography Types
1) Symmetric Key Cryptography:
The sender and receiver of message use a single common key to encrypt and decrypt messages.
2) Asymmetric Key Cryptography:
A pair of keys is used to encrypt and decrypt information. A public key is used for encryption and a private
key is used for decryption. Even if the public key is known by everyone the intended receiver can only
decode it because he alone knows the private key.
3) Hash Functions:
There is no usage of any key in this algorithm. A hash value with fixed length is calculated as per the
plain text which makes it impossible for contents of plain text to be recovered..
1. Groups
A Group (G) is a set elements with a binary operation “” usually Addition or multiplication that satisfies
four properties(Axioms).
• A Commutative Group, also called an abelian group, is a group in which the operator satisfies the four
properties for groups plus an extra property, commutativity.
• Closure Property: if a and b are elements of G, then c = a b is also an element of G.
• Associatively Property: if a, b, and c are elements of “G, then ( a b ) c = a ( b c ).
• Existence of Identity Property: For all a in G, there exists an element e, called the identity element,
such that ea=ae=a
30
SATYA INSTITUTE OF TECHNOLOGY AND MANAGEMENT
• Existence of Inverse Property: For each a in G, there exists an element a 1 , called the inverse of a,
such that a a1 = a1 a = e
• Commutativity Property: For all a and b in G, we have a b = b a.
EXAMPLE 1
The set of residue integers with the addition operator, G=< Zn , + >, is a commutative group
1. Closure is satisfied. The result of adding two integers in Z n is another integer in Zn
2.Associativity is satisfied. The result of 4+(3+2) is same as (4+3) + 2
3. Commutative is satisfied. we have 3+4=4+3
4.The identity element is 0. we have 3+0=0+3=3
5. Every element has an additive inverse. The inverse of 3 is 7 (3+7 mod 10 =0 mod 10 in Z10 ) and
inverse of 7 is 3( 7+3 mod 10 =0 mod 10 in Z10 ), so inverse property satisfied
EXAMPLE 2
The set Zn * with multiplication operator, G=<Zn *, x >, is also an abelian group. We can perform
multiplication and divisions on the elements. We an identity element as 1.
Finite Group: A group is called a finite group if the set has a finite number of elements; otherwise, it is an
infinite group.
Order of a Group: The order of group, |G|, is the number of elements in the group. If the group is not
finite, its order is infinite; if the group is finite, the order is finite.
Subgroups: A subset H of a group G is a subgroup of G if H itself is a group with respect to the operation
on G. In other words, if G = <S, > is a group, H = <T, > is a group under the same operation, and T is a
non-empty subset of S, then H is a subgroup of G. The above definition implies that:
1. If a and b are members of both groups, then c=a b is also a member of both groups
2.The group share the same identity element
3.If a is a member of both groups, the inverse of a is also a member of both groups
4.The group made with the identity element of G,H=<{e}, >, is a sub group of G
5. Each group is a subgroup of itself
Cyclic Subgroup: If a subgroup of a group can be generated using the power of an element, the subgroup is
called the cyclic subgroup.
The term power means repeatedly applying the group operation to the element:
an -> a.a.a.a ..... a (n times)
Example: The group G=< Z3, + > contains cyclic subgroups for 0,1 and 2:
If generated using 0:
00 mod 3 = 0, 01 mod 3 = 0, 02 mod 3 = 0. so, H1=<{0}, +>
31
SATYA INSTITUTE OF TECHNOLOGY AND MANAGEMENT
If generated using 1:
10 mod 3 = 0, 1 1 mod 3 = 1, 1 2 mod 3 = (1+1) mod 3=2. so, H2=G
If generated using 2:
20 mod 3 = 0, 21 mod 3 = 2, 22 mod 3 = (2+2) mod 3=1. so, H3=G
Cyclic Group: A Cyclic group is a group that is its own cyclic subgroup. The element that generates cyclic
subgroup can also generates group itself.This element is referred as generator ‘g’.
Example: In the previous example, The group G=<Z3, +> is a cyclic grop with two generators g=1 and g=2
Lagrange’s Theorem:
It related the order of a group to the order of its sub group. Assme that G is group and H is its subgroup.
If order of G and H are |G| and |H|, respectively, based on this theorem |H| divides |G|.
EXAMPLE: As per the previous cyclic subgroup example, |H1|=1, |H2|=3, |H3|=3,
Obviously, all of these orders divide the order of |G|.
Example:
In the group G=<Z3, +>, ord(0)=1, ord(1)=3, ord(2)=3
2. RING
A Ring, denoted as R = < {. ...}, , □ >, is an algebraic structure with two operations(addition and
multiplication).
The first operation must satisfy all five properties required for an abelian group.
The second operation must satisfy only the first two.
In addition, the second operation must be distributed over the first operation.
Distributivity means that for all a, b and c elements of R, we have
a □ ( b c ) = ( a □ b ) ( a □ c ) and ( a b ) □ c = ( a □ c ) ( b □ c )
Commutative Ring: If a ring satisfies commutative property, then we say the ring is a commutative ring.
• Rings do not need to have a multiplicative inverse.
32
SATYA INSTITUTE OF TECHNOLOGY AND MANAGEMENT
3. FIELDS
A field, denoted by F = < { ... }, , □ >, is a commutative ring in which first and second operations satisfies
all five properties.
In other words:
A field is a set with the two binary operations of addition and multiplication, both of which operations are
commutative, associative, contain identity elements, and contain inverse elements.
The identity element for addition is 0, and the identity element for multiplication is 1.
Application: A field is a structure that supports two pairs of operations: addition/subtraction and
multiplication/division
FIELDS-Example
Explain why R is a field.(R is set of real numbers) :Suppose that a,b,c,d∈R. We know that R has addition
and multiplication as binary operations since (a+b)=c for some c, and ab=d for some d. Furthermore, we
know that addition and multiplication defined on real numbers is both commutative and associative.
Additionally, the identity element for addition is 0, x+0=x, and the identity element for multiplication is 1,
since 1x=x.
Lastly, the inverse element for addition is -x, since x+(−x)=0 (0 being the identity for addition), and the
inverse element for multiplication 1/x since x⋅1/x=1 when x ≠ 0.
33
SATYA INSTITUTE OF TECHNOLOGY AND MANAGEMENT
Finite Fields:
A finite field, a field with a finite number of elements. The finite fields are usually called Galois fields and
denoted as GF(pn).
Note: A Galois field, GF(pn), is a finite field with pn elements where p is prime.
GF(p) Fields: When n=1, we have GF(p) field. Tis field can be the set Z, (0,1,2,p-1), with two operations
addition and multiplication. Each element has an additive inverse and that nonzero elements have a
multiplicative inverse for prime p.
Example for GF(p) Field: A very common field in this category is GF(2) with the set {0,1} and two
operations addition and multiplication a shown below:
34
SATYA INSTITUTE OF TECHNOLOGY AND MANAGEMENT
2) If we GF(2n) with the set 2n elements. The elements in this set are n-bit words. Example: If n=3, , the set
is {000,001,010,011,100,101,110,111}
Polynomials
The data is shown as n-bit words in the computers that satisfy the properties in GF(2 n) . These n-bit words
are easily represented by Polynomial of degree n-1.
A polynomial of degree n-1 is an expression of the form: Where x i is called the ith term and ai is called
coefficient of the ith term.
Note: Polynomials representing n-bit words use two fields: GF(2) for Coefficients and GF(2 n) for
terms.
Modulus:
Addition of two polynomials never creates a polynomial out of the set. However, multiplication of two
polynomials may create a polynomial with degrees more than n-1. This means that we need to divide the
result by a modulus and keep only the remainder.
A Prime Polynomial cannot be factored into a polynomial with degree of less than n. Such polynomials are
referred to as Irreducible polynomials.
35
SATYA INSTITUTE OF TECHNOLOGY AND MANAGEMENT
Additive Identity: The additive identity in a polynomial is a zero polynomial ( a polynomial with all
coefficients set to zero).
Additive inverse: The additive inverse of a polynomial with coefficients in GF(2) is the polynomial itself.
This means that the subtraction operation is the same as the addition operation.
Polynomials-Addition
Polynomials- Multiplication
• Multiplication in polynomials is the sum of the multiplication of each term of the first polynomial
with each term of the second polynomial.
• The multiplication may create terms with degree more than n-1, which means the result needs to be
reduced using a modulus polynomial
36
SATYA INSTITUTE OF TECHNOLOGY AND MANAGEMENT
37
SATYA INSTITUTE OF TECHNOLOGY AND MANAGEMENT
Example:
Power Operation New Result Reduction
x0 P2 x +x +x3+x2+x
7 4
No
x1 P 2 x (x7+x4+x3+x2+x) x5+x2+x+1 Yes
x2 P 2 x ( x5+x2+x+1) x6+x3+x2+x No
x3 P 2 x ( X6+x3+x2+x) x7+x4+x3+x2 No
x4 P 2 x ( x7+x4+x3+x2) x5+x+1 Yes
x5 P 2 x ( x5 +x+1) x6+x2+x No
Multiplication of polynomials in GF(2n) can be achieved using shift-left and exclusive-or operations
38
SATYA INSTITUTE OF TECHNOLOGY AND MANAGEMENT
Example :find Multiplication Table for GF(23 ) -with irreducible polynomial is x3 +x2 +1
39
SATYA INSTITUTE OF TECHNOLOGY AND MANAGEMENT
Kerckhoff’s Principle
Based on Kerckhoff’s principle, one should always assume that the adversary, Eve, knows the
encryption/decryption algorithm. The resistance of the cipher to attack must be based only on the secrecy of
the key.
Cryptanalysis
As cryptography is the science and art of creating secret codes, cryptanalysis is the science and art of breaking those
codes.
40
SATYA INSTITUTE OF TECHNOLOGY AND MANAGEMENT
Ciphertext-Only Attack
Figure Ciphertext-only attack
In Ciphertext-Only Attack , the attacker knows only some cipher text. He try to find
corresponding key and plain text using various methods.
Brute-Force attack: Attacker tries all possible keys. We assume that he knows key domain
Statistical attack: The cryptanalyst can benefit from some inherent charactersistics of the plain text language
to perform statistical attack. Example: Letter E is most frequently used character in English.
Known-Plaintext Attack
Figure Known-plaintext attack
In this attack, he know some cipher text and plain text pairs that were sent previously by Alice to Bob. Attacker has
kept both cipher text and plain text to use them to break the next secrete message.
Chosen-Plaintext Attack
Figure Chosen-plaintext attack
This is similar to known-plaintext attack, but plaintext/cipher text pairs have been choosen by the attacker .
This can happen when attacker has access to Alice computer. She can choose some plaintext and interpret
ciphertext.
41
SATYA INSTITUTE OF TECHNOLOGY AND MANAGEMENT
Chosen-Ciphertext Attack
Figure Chosen-Ciphertext attack
This is similar to Chosen Plaintext attack except eve chooses some ciphertext and decrypt it to from a
cipher/plain text pairs. This can happen when Eve has access to Bob computer.
Monoalphabetic Ciphers:
In monoalphabetic substitution, the relationship between a symbol in the plaintext to a symbol in the
ciphertext is always one-to-one.
Example 1
The following shows a plaintext and its corresponding ciphertext. The cipher is probably
monoalphabetic because both l’s (els) are encrypted as O’s.
Example 2
The following shows a plaintext and its corresponding ciphertext. The cipher is not monoalphabetic
because each l (el) is encrypted by a different character. The first l (el) is encrypted with N;the second as Z
42
SATYA INSTITUTE OF TECHNOLOGY AND MANAGEMENT
Additive Cipher
The simplest monoalphabetic cipher is the additive cipher. This cipher is sometimes called a shift cipher and
sometimes a Caesar cipher, but the term additive cipher better reveals its mathematical nature.
Figure Plaintext and ciphertext in Z26
Note:
When the cipher is additive, the plaintext, ciphertext, and key are integers in Z26.
Example:
Use the additive cipher with key = 15 to encrypt the message “hello”.
Solution
We apply the encryption algorithm to the plaintext, character by character:
Example:
Use the additive cipher with key = 15 to decrypt the message “WTAAD”.
Solution
We apply the decryption algorithm to the plaintext character by character:
43
SATYA INSTITUTE OF TECHNOLOGY AND MANAGEMENT
Multiplicative Ciphers
Figure Multiplicative cipher
Note:
In a multiplicative cipher, the plaintext and ciphertext are integers in Z26 ; the key is an integer in Z26 *.
Example1:
Example2:
We use a multiplicative cipher to encrypt the message “hello” with a key of 7. The ciphertext is “XCZZU”.
Affine Ciphers:
44
SATYA INSTITUTE OF TECHNOLOGY AND MANAGEMENT
Example1:
The affine cipher uses a pair of keys in which the first key is from Z26 * and the second is from Z26 .
The size of the key domain is
26 × 12 = 312.
Example2:
Use an affine cipher to encrypt the message “hello” with the key pair (7, 2).
Example:
The ciphertext is
Reference
Polyalphabetic Ciphers
In polyalphabetic substitution, each occurrence of a character may have a different substitute. The
relationship between a character in the plaintext to a character in the ciphertext is one-to-many.
Example ‘a’ can be enciphered as ‘D’ in the beginning of the text, but as ‘N’ at the middle.
45
SATYA INSTITUTE OF TECHNOLOGY AND MANAGEMENT
Example:
Assume that Alice and Bob agreed to use an autokey cipher with initial key value k1 = 12. Now
Alice wants to send Bob the message “Attack is today”. Enciphering is done character by character.
TRANSPOSITION CIPHERS
A transposition cipher does not substitute one symbol for another, instead it changes the location of the
symbols. A symbol in the first position may appaer in the tenth position of the cipher. A symbol in the
eighth position may appear in the first osition of the cipher.
Note: A transposition cipher reorders symbols
Keyless Transposition Ciphers
Simple transposition ciphers, which were used in the past, are keyless.
Example 1:
A good example of a keyless cipher using the first method is the rail fence cipher. The ciphertext is
created reading the pattern row by row. For example, to send the message “ Meet me at the park” to Bob,
Alice writes
She then creates the ciphertext “MMTAEEHREAEKTTP” by transmitting the characters column by
column. Bob receives the cipher text and follows the reverse process to get plain text .
Example:
46
SATYA INSTITUTE OF TECHNOLOGY AND MANAGEMENT
The cipher in previous example is actually a transposition cipher. The following shows the permutation of
each character in the plaintext into the ciphertext based on the positions.
The second character in the plaintext has moved to the fifth position in the ciphertext; the third character has
moved to the ninth position; and so on.Although the characters are permuted, there is a pattern in the
permutation: (01, 05, 09, 13), (02, 06, 10, 13), (03, 07, 11, 15), and (4, 8, 12). In each section, the difference
between the two adjacent numbers is 4.
Keyed Transposition Ciphers
The keyless ciphers permute the characters by using writing plaintext in one way and reading it in another
way The permutation is done on the whole plaintext to create the whole ciphertext.
Another method is to divide the plaintext into groups of predetermined size, called blocks, and then use a
key to permute the characters in each block separately.
Example
Alice needs to send the message “Enemy attacks tonight” to Bob..
The key used for encryption and decryption is a permutation key, which shows how the character
are permuted.
47
SATYA INSTITUTE OF TECHNOLOGY AND MANAGEMENT
Keys
In the previous Example, a single key was used in two directions for the column exchange: downward for
encryption, upward for decryption. It is customary to create two keys.
Using Matrices
We can use matrices to show the encryption/decryption process for a transposition cipher. The plain text and
cipher text are lxm matrices with numberical values of characters and keys are mxm matri x.
In a permutation matrix, every row or column has exactly one 1 and others are 0’s. Encryption multiplies
plaintext matrix with key matrix and decryption multiplies ciphertext matrix with inverse of key matrix(This
simply the transpostion of key matrix)
48
SATYA INSTITUTE OF TECHNOLOGY AND MANAGEMENT
Example
Block Ciphers
A block cipher is one in which a block of plaintext is treated as a whole and used to produce a cipher text
block of equal length. Typically, a block size of 64 or 128 bits is used.
49
SATYA INSTITUTE OF TECHNOLOGY AND MANAGEMENT
Example: How many padding bits must be added to a message of 100 characters if 8-bit ASCII is used for
encoding and the block cipher accepts blocks of 64 bits?
Solution
Encoding 100 characters using 8-bit ASCII results in an 800-bit (100x8) message. The plaintext must be
divisible by 64. If | M | and |Pad| are the length of the message and the length of the padding,
A modern block cipher can be designed to act as a substitution cipher or a transposition cipher.
To be resistant to exhaustive-search attack, a modern block cipher needs to be designed as a substitution
cipher.
Example
Suppose that we have a block cipher where n = 64. If there are 10 1’s in the ciphertext, how many trial-and-
error tests does Eve need to do to recover the plaintext from the intercepted ciphertext in each of the
following cases?
a. The cipher is designed as a substitution cipher.
b. The cipher is designed as a transposition cipher.
Solution
a) In the first case, Eve has no idea how many 1’s are in the plaintext. Eve needs to try all possible 264
64-bit blocks to find one that makes sense.
b) In the second case, Eve knows that there are exactly 10 1’s in the plaintext. Eve can launch an
exhaustive-search attack using only those 64-bit blocks that have exactly 101’s.
50
SATYA INSTITUTE OF TECHNOLOGY AND MANAGEMENT
P-Boxes
P-Boxes(also called ad D-Box means Diffusion box)
A P-box (permutation box) parallels the traditional transposition cipher for characters. It transposes bits.
Three types of P-boxes
Example
Figure shows all 6 possible mappings of a 3 × 3 P-box.
Straight P-Boxes
Table Example of a permutation table for a straight P-box(64x64)
At output of P-Box:
Input 58 goes to 1 st position, input 50 goes to 2nd position, input 42 to 3rd position,….
Example
Design an 8 × 8 permutation table for a straight P-box that moves the two middle bits (bits 4 and 5) in the
input word to the two ends (bits 1 and 8) in the output words. Relative positions of other bits should not be
changed.
Solution
We need a straight P-box with the table [4 1 2 3 6 7 8 5]. The relative positions of input bits 1, 2, 3, 6, 7,
and 8 have not been changed, but the first output takes the fourth input and the eighth output takes the fifth
input.
51
SATYA INSTITUTE OF TECHNOLOGY AND MANAGEMENT
Compression P-Boxes
Example of a 32 × 24 permutation table
Expansion P-Boxes
Example of a 12 × 16 permutation table
P-Boxes: Invertibility
A straight P-Box is invertible, that means we use straight P-Box in encryption cipher and its inverse in
decryption cipher.
Note
A straight P-box is invertible, but compression and expansion P-boxes are not.
Example
52
SATYA INSTITUTE OF TECHNOLOGY AND MANAGEMENT
S-Box
An S-box (substitution box) can be thought of as a small substitution cipher
Note
An S-box is an m × n substitution unit, where m and n are not necessarily the same.
Linear S-Box: if the inputs are x1,x2,x3… and outputs are y1,y2,y3… and relationship between them is
Y1=f1(x1,x2,x3..) ,
Y2=f2 (x1,x2,x3..)
…..
Then above relation can be expressedas
Y1=a11 x1 +a12 x2 +…
Y2=a21x1+a22x2+…
Example: In a nonlinear s-box, such boxes can have ‘and’ terms like x1 x2 , x3 x5 …
In an S-box with three inputs and two outputs, we have
The S-box is linear because a1,1 = a1,2 = a1,3 = a2,1 = 1 and a2,2 = a2,3 = 0. The relationship can be
represented by matrices, as shown below:
Example
In an S-box with three inputs and two outputs, we have
53
SATYA INSTITUTE OF TECHNOLOGY AND MANAGEMENT
where multiplication and addition is in GF(2). The S-box is nonlinear because there is no linear relationship
between the inputs and the outputs.
Example
The following table defines the input/output relationship for an S-box of size 3 × 2. The leftmost bit of the
input defines the row; the two rightmost bits of the input define the column. The two output bits are values
on the cross section of the selected row and column.
Based on the table, an input of 010 yields the output 01. An input of 101 yields the output of 00.
S-Boxes: Invertibility
An S-box may or may not be invertible. In an invertible
S-box, the number of input bits should be the same as the number of output bits.
Example
Figure shows an example of an invertible S-box. For example, if the input to the left box is 001, the output
is 101. The input 101 in the right table creates the output 001, which shows that the two tables are inverses
of each other.
Exclusive-OR
An important component in most block ciphers is the exclusive-or operation.
Invertibility of the exclusive-or operation
Product Ciphers
Shannon introduced the concept of a product cipher. A product cipher is a complex cipher combining
substitution, permutation, and other components .
Combination of S-box and P-box transformation—a product cipher.
Two classes of product ciphers:
a) Feistel ciphers, Example DES(data encryption standard)
b) Non-feistel Ciphers, Example AES(Advanced Encryptin system)
54
SATYA INSTITUTE OF TECHNOLOGY AND MANAGEMENT
Diffusion
The idea of diffusion is to hide the relationship between the ciphertext and the plaintext.
Confusion
The idea of confusion is to hide the relationship between the ciphertext and the key.
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.
55
SATYA INSTITUTE OF TECHNOLOGY AND MANAGEMENT
56
SATYA INSTITUTE OF TECHNOLOGY AND MANAGEMENT
57
SATYA INSTITUTE OF TECHNOLOGY AND MANAGEMENT
The initial permutation and its inverse are defined by tables, as shown in Tables.
The tables are to be interpreted as follows.
The input to a table consists of 64 bits numbered from 1 to 64.
The 64 entries in the permutation table contain a permutation of the numbers from 1 to 64.
Each entry in the permutation table indicates the position of a numbered input bit in the output, which also
consists of 64 bits.
The initial and final permutations are straight Permutation boxes (P-boxes) that are inverses of each other.
Note:
Initial Permutation & Inverse Initial Permutations have no cryptography significance in DES.
Input Table
In output
At 1st place 58
At 2nd place 50
58
SATYA INSTITUTE OF TECHNOLOGY AND MANAGEMENT
At 3rd place 42 ..
In output
At 1st place 40
At 2nd place 8
At 3rd place 48 ..
Rounds
The left and right halves of each 64- bit intermediate value are treated as separate 32-bit quantities, labeled
L (left) and R (right).
As in any classic Feistel cipher, the overall processing at each round can be summarized in the following
formulas:
The round key Ki is 48 bits. The R input is 32 bits. This R input is first expanded to 48 bits by using a table
that defines a permutation plus an expansion that involves duplication of 16 of the R bits.
59
SATYA INSTITUTE OF TECHNOLOGY AND MANAGEMENT
The resulting 48 bits are XORed with Ki. This 48-bit result passes through a substitution function that
produces a 32-bit output, which is permuted as defined by Table.
The role of the S-boxes in the function F is illustrated in Figure 3.7.The substitution consists of a set of eight
S-boxes, each of which accepts 6 bits as input and produces 4 bits as output. These transformations are
defined in Table 3.3, which is interpreted as follows: The first and last bits of the input to box Si form a 2-bit
binary number to select one of four substitutions defined by the four rows in the table for Si. The middle
four bits select one of the sixteen columns. The decimal value in the cell selected by the row and column is
then converted to its 4-bit representation to produce the output. For example, in S1, for input 011001, the
row is 01 (row 1) and the column is 1100 (column 12). The value in row 1, column 12 is 9, so the output is
1001.
60
SATYA INSTITUTE OF TECHNOLOGY AND MANAGEMENT
Round Function
The heart of this cipher is the DES function, f. The DES function applies a 48-bit key to the rightmost 32
bits to produce a 32-bit output.
Expansion Permutation Box − Since right input is 32-bit and round key is a 48-bit, we first need to expand
right input to 48 bits. Permutation logic is graphically depicted in the following illustration −
The graphically depicted permutation logic is generally described as table in DES specification illustrated as
shown −
61
SATYA INSTITUTE OF TECHNOLOGY AND MANAGEMENT
XOR (Whitener). − After the expansion permutation, DES does XOR operation on the expanded right
section and the round key. The round key is used only in this operation.
Substitution Boxes. − The S-boxes carry out the real mixing (confusion). DES uses 8 S-boxes, each with a
6-bit input and a 4-bit output. Refer the following illustration −
62
SATYA INSTITUTE OF TECHNOLOGY AND MANAGEMENT
63
SATYA INSTITUTE OF TECHNOLOGY AND MANAGEMENT
The 32-bit output from the eight S-boxes is then permuted, so that on the next round, the output from
each S-box immediately affects as many others as possible.
Straight Permutation
− The 32 bit output of S-boxes is then subjected to the straight permutation with rule shown in the
following illustration:
64
SATYA INSTITUTE OF TECHNOLOGY AND MANAGEMENT
DES Decryption
As with any Feistel cipher, decryption uses the same algorithm as encryption, except that the application of
the subkeys is reversed.
DES Analysis
Two desired properties of a block cipher are the Avalanche effect and the completeness.
Avalanche effect :
65
SATYA INSTITUTE OF TECHNOLOGY AND MANAGEMENT
A small change in plaintext results in the very great change in the ciphertext.
Completeness effect:
Completeness effect means that each bit of ciphertext needs to depends on many bits on the plaintext. The
diffusion and confusion produced by P-Boxes and S-Boxes in DES, show a very strong completeness effect.
Double – DES
66
SATYA INSTITUTE OF TECHNOLOGY AND MANAGEMENT
Triple – DES
Triple DES was developed in 1999 by IBM – by a team led by Walter Tuchman. DES prevents a meet-in-
the-middle attack. 3- DES has a 168-bit key and enciphers blocks of 64 bits.
67
SATYA INSTITUTE OF TECHNOLOGY AND MANAGEMENT
68
SATYA INSTITUTE OF TECHNOLOGY AND MANAGEMENT
69
SATYA INSTITUTE OF TECHNOLOGY AND MANAGEMENT
Unlike DES, the number of rounds in AES is variable and depends on the length of the key.
AES uses 10 rounds for 128-bit keys, 12 rounds for 192-bit keys and 14 rounds for 256-bit keys. Each
of these rounds uses a different 128-bit round key, which is calculated from the original AES key.
ROUNDS
• Unlike DES, the number of rounds in AES is variable and depends on the length of the key.
• AES uses 10 rounds for 128-bit keys,
• 12 rounds for 192-bit keys and
• 14 rounds for 256-bit keys.
• Each of these rounds uses a different 128-bit round key, which is calculated from the original AES
key.
Each round comprise of four sub-processes. The first round process is depicted below −
AES Transformations:
There are four transformation functions used in AES Cipher at each round.
1. Substitute Bytes Transformation
70
SATYA INSTITUTE OF TECHNOLOGY AND MANAGEMENT
2. ShiftRows Transformation
3. MixColumns Transformation
4. AddRoundKey Transformation
2. ShiftRows Transformation:
71
SATYA INSTITUTE OF TECHNOLOGY AND MANAGEMENT
The inverse shift row transformation, called InvShiftRows, performs the circular shifts in the
opposite direction for each of the last three rows, with a 1-byte circular right shift for the second row, and so
on.
3. MixColumns Transformation:
Mixing is the transformaton that changes bits inside byte.
This operation takes 4 bytes(a column) and by multiplying it with a constant matrix then mixes them that
produces new bytes.
MixColumn: operates on each column individually. Each byte of a column is mapped into a new value.
72
SATYA INSTITUTE OF TECHNOLOGY AND MANAGEMENT
It takes a column from state and multiply it with a constant square matrix.
The byte values are represented as polynomials with coefficients in GF(2) and mulitplications are done in
GF(28)
4. AddRoundKey Transformation:
To make the ciphertext more secrete, we add cipher key to the data in a state.
AddRoundKey is same as to MixColumns but performs addition operation instead of multiplication.
73
SATYA INSTITUTE OF TECHNOLOGY AND MANAGEMENT
The first matrix is State, and the second matrix is the round key.
74
SATYA INSTITUTE OF TECHNOLOGY AND MANAGEMENT
75
SATYA INSTITUTE OF TECHNOLOGY AND MANAGEMENT
ANALYSIS OF AES
Security
• AES was designed after DES. Most of the known attacks on DES were already tested on AES.
• Brute-Force Attack
• AES is definitely more secure than DES due to the larger-size key.
• Statistical Attacks
• Numerous tests have failed to do statistical analysis of the ciphertext.
• Differential and Linear Attacks
• There are no differential and linear attacks on AES as yet.
Implementation
• AES can be implemented in software, hardware, and firmware. The implementation can use table
lookup process or routines that use a well-defined algebraic structure.
Simplicity and Cost
• The algorithms used in AES are so simple that they can be easily implemented using cheap
processors and a minimum amount of memory.
76