Csc332 Csc332 Assignment 2 Csc332 Fa2019
Csc332 Csc332 Assignment 2 Csc332 Fa2019
Assignment -2_FA19
Network Security (CSC332)
Marks 10
1
Name: ABDUL ALEEM FAHEEM Reg ID: SP15-BSCS-084
Q.1) What is the purpose of Cryptanalysis and Brute force attack? Which attack is more dangerous and
Why?
ANS: Cryptanalysis is the decryption and analysis of codes, ciphers or encrypted text. Cryptanalysis uses
mathematical formulas to search for algorithm vulnerabilities and break into cryptography or information
security systems Cryptanalysis means attacking a cryptographic system by looking for something clever that the
designers of the system didn't think of, for example finding a mathematical relation that makes some
computation fasters.
A brute force attack is any type of attack that involves trying every possible combination of characters or data in
order to find the key in order to decrypt an encrypted message. Brute force attack is usually used as a last-resort
tactic in a cryptanalysis scenario, as it very much involves extreme amounts of trial and error and relies on a lot
of luck in order to find the key. A brute force attack is different from a dictionary attack, as it does not rely on a
dictionary and simply tries every possible key that could be used. Brute force attack is one that doesn't use any
intelligence and enumerates all possibilities; cryptography is always vulnerable to brute force attacks, but if
properly designed it makes them practically impossible by arranging for the probability of success to be utterly
negligible.
Q.2) What are the main design features of Feistel Network? Explain Data Encryption Standard with help
of an example.
ANS: Feistel Cipher is not a specific scheme of block cipher. It is a design model from which many
different block ciphers are derived. DES is just one example of a Feistel Cipher. A cryptographic
system based on Feistel cipher structure uses the same algorithm for both encryption and
decryption.
Encryption Process
The encryption process uses the Feistel structure consisting multiple rounds of processing of the
plaintext, each round consisting of a “substitution” step followed by a permutation step.
Feistel Structure is shown in the following
2
The input block to each round is divided into two halves that can be denoted as L and R for the left half
and the right half.
In each round, the right half of the block, R, goes through unchanged. But the left half, L, goes through
an operation that depends on R and the encryption key. First, we apply an encrypting function ‘f’ that
takes two input − the key K and R. The function produces the output f(R,K). Then, we XOR the output
of the mathematical function with L.
In real implementation of the Feistel Cipher, such as DES, instead of using the whole encryption key
during each round, a round-dependent key is derived from the encryption key. This means that each
round uses a different key, although all these subkeys are related to the original key.
The permutation step at the end of each round swaps the modified L and unmodified R. Therefore, the L
for the next round would be R of the current round. And R for the next round be the output L of the
current round.
Above substitution and permutation steps form a ‘round’. The number of rounds are specified by the
algorithm design.
3
Once the last round is completed then the two sub blocks, ‘R’ and ‘L’ are concatenated in this order to
form the ciphertext block.
The difficult part of designing a Feistel Cipher is selection of round function ‘f’. In order to be unbreakable
scheme, this function needs to have several important properties that are beyond the scope of our discussion.
Decryption Process
The process of decryption in Feistel cipher is almost similar. Instead of starting with a block of plaintext, the
cipher text block is fed into the start of the Feistel structure and then the process thereafter is exactly the same
as described in the given illustration.
The process is said to be almost similar and not exactly same. In the case of decryption, the only difference is
that the sub keys used in encryption are used in the reverse order.
The final swapping of ‘L’ and ‘R’ in last step of the Feistel Cipher is essential. If these are not swapped then
the resulting cipher text could not be decrypted using the same algorithm
Q.3) Explain in detail the four stages of Advanced Encryption Standard with the help of an example.
ANS:
Stage 1: “Sub Bytes” transformation is a non-linear byte substitution for each byte of the block.
Stage 2: “Shift Rows” transformation cyclically shifts (permutes) the bytes within the block
Stage 3: “Mix Columns” transformation groups 4-bytes together forming 4-term polynomials
and multiplies the polynomials with a fixed polynomial mod (x^4+1).
Stage 4: “Add Round Key” transformation adds the round key with the block of data.
In most ciphers, the iterated transform (or round) usually has a Feistel Structure. Typically in this
structure, some of the bits of the intermediate state are transposed unchanged to another position
(permutation)
4
5