1st Assignment of CSE 403
1st Assignment of CSE 403
1st Assignment of CSE 403
PART-A
Q1. Write the design principle of Block cipher.
Ans: Block Ciphers:
Basically a particular block cipher just like a Hill cipher treats a n letter block of plain text and
produce the cipher text block of same length. A block cipher encryption algorithm might take
(for example) a 128-bit block of plaintext as input, and output a corresponding 128-bit block of
ciphertext. The exact transformation is controlled using a second input — the secret key.
Decryption is similar: the decryption algorithm takes, in this example, a 128-bit block of
ciphertext together with the secret key, and yields the original 128-bit block of plaintext.
Any block cipher can be operated in one of several modes. These are as follows:
Electronic Codebook (ECB) Mode:
ECB is the simplest mode of operation for a block cipher. The input data is padded out to a
multiple of the block size, broken into a integer number of blocks, each of which is encrypted
independently using the key. In addition to simplicity, ECB has the advantage of allowing any
block to be decrypted independently of the others. Thus, lost data blocks do not affect the
decryption of other blocks. The disadvantage of ECB is that it aids known-plaintext attacks. If
the same block of plaintext is encrypted twice with ECB, the two resulting blocks of ciphertext
will be the same.
After decryption, the output of the cipher must then be XOR-ed with the previous ciphertext to
recover the original plaintext. The first block of plaintext is XOR-ed with an initialization vector
(IV), which is usually a block of random bits transmitted in the clear. CBC is more secure than
ECB because it effectively scrambles the plaintext prior to each encryption step. Since the
ciphertext is constantly changing, two identical blocks of plaintext will encrypt to two different
blocks of ciphertext.
CBC can be used to convert a block cipher into a hash algorithm. To do this, CBC is run
repeatedly on the input data, and all the ciphertext is discarded except for the last block, which
will depend on all the data blocks in the message. This last block becomes the output of the hash
function.
The Block Cipher Principle: Block Cipher Principles
As block cipher have different modes of operation (we will discuss this topic later in this lecture)
and
applies to a broader range of applications than stream cipher, we will focus on its design
principles in
this lecture.
A block cipher transform a plaintext block of n letters into an encrypted block. For the alphabet
with
26 letters, there are 26n possible different plaintext blocks. The most general way of encrypting a
n-letter
block is to take each of the plaintext blocks and map it to a cipher block (arbitrary n-letter
substitution
cipher). For decryption to be possible, such mapping needs to be one-to-one (i.e., each plaintext
block
must be mapped to a unique ciphertext block). The number of different one-to-one mappings
among
n-letter blocks is (26n)!.
The length of block n can not be too short in order to secure the cryptographic scheme. For
example, n
= 1 gives a monoalphabetic cipher. Such schemes, as we have seen, are vulnerable to frequency
analysis
and brute-force attacks. However, an arbitrary reversible substitution cipher for a large block size
n is not
practical. Let’s consider the problem of specifying a mapping of all possible n-letter blocks. In a
cipher,
each key specifies such a mapping. Let’s assume the key consists of a block of k letters. Then the
number
of all possible keys is 26k. Then for a n-letter arbitrary substitution block cipher, the key size
needs to
satisfy 26k § (26n)!, i.e., k § n × 26n!.
Q2. What is the purpose of S-boxes in DES?
Ans: - Advanced Encryption Standard (AES) block cipher system is widely used in
cryptographic applications. A nonlinear substitution operation is the main factor of
the AES cipher system strength. The purpose of the proposed approach is to
generate the random S-boxes changing for every change of the secret key. The fact
that the S-boxes are randomly key-dependent and unknown is the main strength of
the new approach, since both linear and differential cryptanalysis requires known S-
boxes.
The following is the 128-bit value that you will encrypt with the indexes array:
00 11 22 33 44 55 66 77 88 99 aa bb cc dd ee ff
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 14 15 16
17 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 .
For instance, the use of double encryption does not provide the expected increase in security
[MH81] when compared with the increased implementation requirements, and it cannot be
recommended as a good alternative. Instead, triple-encryption is the point at which multiple
encryption gives substantial improvements in security.
The reson why it is used: For more information security and to prevent Brute Force attacks you
can encrypt the same text or file multiple times. Set how many time you want to encrypt you
data.
Multiple encryption provides good protection from plaintext attacks making ciphering stronger.
A good example of multiple encryption is Triple DES.