Assignment: 1: Subject Code: Cryptography & Network Security
Assignment: 1: Subject Code: Cryptography & Network Security
Ans:
The meet-in-the-middle attack is one of the types of known plaintext attacks. The intruder has to know some
parts of plaintext and their ciphertexts. Using meet-in-the-middle attacks it is possible to break ciphers,
which have two or more secret keys for multiple encryptions using the same algorithm. For example,
although Double DES encrypts the data with two different 56-bit keys, Double DES can be broken with 257
encryption and decryption operations. Meet-in-the-middle attack was first presented by Diffie and Hellman
for cryptanalysis of DES algorithm.
By using AES algorithm, we might be able to resolve the meet-in-the-middle attack, since it is at least six
time faster than triple DES.
2. Difference between
Ans:
3. Define strength and weakness of DES. How to resolve the weakness of DESdescribed
briefly.
Ans:
The Data Encryption Standard (DES) is a symmetric key block cipher which takes 64-bit plaintext and 56-
bit key as an input and produces 64-bit cipher text as output. The DES function is made up of P and S-boxes.
P-boxes transpose bits and S-boxes substitute bits to generate a cipher.
The strengths of the DES are:
a. The use of 56-bit keys: 56-bit key is used in encryption, there are 256 possible keys. A brute force
attack on such number of keys is impractical.
b. The nature of algorithm: Cryptanalyst can perform cryptanalysis by exploiting the characteristic of
DES algorithm but no one has succeeded in finding out the weakness.
The weakness of des are:
a. Two chosen input to an S-box can create the same output.
b. The purpose of initial and final permutation is not clear.
How to resolve weakness of DES:
We will see later in the chapter that one solution is to use triple DES (3DES) with two keys
(112 bits) or triple DES with three keys (168 bits).
4. Define round function of DES. Define two properties of block cipher thatmakes DES
strong.
Ans:
The heart of DES cipher is the DES round function, f. The DES function applies a 48-bit key to the
rightmost 32 bits to produce a 32-bit output.
Two properties of block cipher that makes DES cipher very strong:
Avalanche effect− A small change in plaintext results in the very great change in the ciphertext.
Completeness− Each bit of ciphertext depends on many bits of plaintext.
5. Describe the operation of the algorithm which is six times faster than TripelDES.
Ans: The more popular and widely adopted symmetric encryption algorithm likely to be encountered
nowadays is the Advanced Encryption Standard (AES). It is found at least six time faster than triple DES.
Operation of AES:
AES is an iterative rather than Feistel cipher. It is based on ‘substitution–permutation network’. It comprises
of a series of linked operations, some of which involve replacing inputs by specific outputs (substitutions)
and others involve shuffling bits around (permutations).
Encryption Process
Byte Substitution (SubBytes):
The 16 input bytes are substituted by looking up a fixed table (S-box) given in design. The result is
in a matrix of four rows and four columns.
Shiftrows:
Each of the four rows of the matrix is shifted to the left. Any entries that ‘fall off’ are re-inserted on
the right side of row. Shift is carried out as follows −
First row is not shifted.
Second row is shifted one (byte) position to the left.
Third row is shifted two positions to the left.
Fourth row is shifted three positions to the left.
The result is a new matrix consisting of the same 16 bytes but shifted with respect to each other.
MixColumns
Each column of four bytes is now transformed using a special mathematical function. This function
takes as input the four bytes of one column and outputs four completely new bytes, which replace the
original column. The result is another new matrix consisting of 16 new bytes. It should be noted that
this step is not performed in the last round.
Addroundkey
The 16 bytes of the matrix are now considered as 128 bits and are XORed to the 128 bits of the
round key. If this is the last round then the output is the ciphertext. Otherwise, the resulting 128 bits
are interpreted as 16 bytes and we begin another similar round.
Decryption Process
The process of decryption of an AES ciphertext is similar to the encryption process in the reverse
order. Each round consists of the four processes conducted in the reverse order −
Add round key
Mix columns
Shift rows
Byte substitution
Since sub-processes in each round are in reverse manner, unlike for a Feistel Cipher, the encryption
and decryption algorithms need to be separately implemented, although they are very closely related.