Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 31

Block Cipher

•BLOCK CIPHER IS AN ENCRYPTION AND DECRYPTION


METHOD WHICH OPERATES ON THE BLOCKS OF PLAIN TEXT,
INSTEAD OF OPERATING ON EACH BIT OF PLAIN TEXT
SEPARATELY.
•EACH BLOCK IS OF EQUAL SIZE AND HAS FIXED NO OF BITS
•THE
GENERATED CIPHERTEXT HAS BLOCKS EQUAL TO THE
NUMBER OF BLOCKS IN PLAINTEXT AND ALSO HAS THE SAME
NUMBER OF BITS IN EACH BLOCK AS OF PLAIN TEXT
 Block cipher uses the same key for encryption and decryption.
  Block ciphers are built in the Feistel cipher structure
 Block cipher has a specific number of rounds and keys for generating
ciphertext
 For defining the complexity level of an algorithm few design principles are
to be considered.
These are explained as following below:
Number of Rounds :

 The number of Rounds is regularly considered in design criteria.


 It just reflects the number of rounds to be suitable for an algorithm to make
it more complex.
 In DES we have 16 rounds ensuring it to be more secure.
 In AES we have 10 rounds which makes it more secure.
Design of function F :

 The core part of the Feistel Block cipher structure is the Round Function.
 The complexity of cryptanalysis can be derived from the Round function.
 The avalanche effect is also included in the round function, as the change
of a single bit in plain text would produce a mischievous output due to the
presence of avalanche effect.
Key schedule algorithm :

 In Feistel Block cipher structure, each round would generate a sub-key for
increasing the complexity of cryptanalysis.
 The Avalanche effect makes it more complex in deriving sub-key.
 Decryption must be done very carefully to get the actual output as the
avalanche effect is present in it.
Fiestel Structure
Step 1: 
 The plain text is divided into the blocks of a fixed size and only one block
is processed at a time. So, the input to encryption algorithm is a plain text
block and a key K.
Step 2: 
 The plain text block is divided into two equal halves which we will denote
as a LE0 as the left half of the plain text block and RE0 as the right half of
the plain text block.
 Now, both these halves of the plain text block (LE0 & RE0) undergoes
multiple rounds to produce ciphertext block.
 In each round, the encryption function is applied on the right half REi of
the plaintext block along with the key Ki.
 The result of this encryption function is then XORed with the left half Lei.
 The result of XOR function becomes the new right half for next
round REi+1.
 The old right half REi becomes the new left half LEi+1 for the next round.
 Each round executes the same function. In each round initially,
a substitution function is implemented .
 A permutation function is implemented by swapping the two halves and
the result of this permutation is provided to the next round.

The design features of Feistel cipher that are considered while implementing
any block cipher are as follow:
Block Size:
 The block cipher is considered more secure if the block size is larger.
 But the larger block size can reduce the execution speed of encryption and
decryption
 Generally, the block size of a block cipher is of 64-bit. But, the modern-
day block cipher such as AES has 128-bit block size.
Key Size:
 The security of block cipher increases with the increasing key size.
 But the large key size may decrease the speed of encryption and
decryption.
 Earlier the key of 64-bit was considered to adequate. But the modern
cipher uses a key of size 128-bit.
Number of rounds:
 The number of rounds also increases the security of the block cipher. .
More are the number of rounds more complex is the cipher
Subkey generation function
More the subkey generation function is complex, difficult it is for a
cryptanalyst to crack it .
Round Function
Complex round function enhances the security of the block cipher.
Feistel Decryption Algorithm

Feistel Cipher structure does not have a different algorithm for


decryption.
 The input to the decryption algorithm is a cipher text block
produced by the encryption algorithm.
 The sequence of subkeys used in encryption are reversed.
The key Kn is used in the first round of decryption, key Kn-
1 in the second round of decryption and so on, until the last
round occurs where key K1 is used.
 As you can observe in the figure above the cipher text block has two
halves left half (LD0) and the right half (RD0). Where LD0 = RE16 and
RD0 = LE16.
 Now as in encryption algorithm, the round function is performed on the
right half of cipher block with the key K16 and the result of the round
function is XORed with the left half of the cipher text block.
 The output of the XOR function is now considered as new right half
i.e.RD1 and the RD0 swaps with LD0 and becomes the new left half LD1 for
the next round.
 Each round has the same function and after the fixed number of rounds,
the plain text block is obtained
 Feistel cipher was based on the structure proposed by Shannon.
 Feistel block cipher operates on each block independently.
 The encryption and decryption algorithm in Feistel cipher is the same.
 The key used for encryption and decryption is the same but the sequence
of application of subkey is reversed.
 During encryption a plain text block undergoes multiple rounds. But the
function performed in each round is same
 Generally, 16 rounds are performed in Feistel cipher.
 Typical block size of Feistel cipher is 64-bit but modern block cipher uses
128-bit block. .
So, this is all about the Feistel block cipher, its structure, design
features.
Block cipher Modes of operation

Electronic Code Book (ECB):


 Electronic code book is the easiest block cipher mode of functioning.
 It is easier because of direct encryption of each block of input plaintext and
output is in form of blocks of encrypted cipher text.
 Generally, if a message is larger than b bits in size, it can be broken down
into a bunch of blocks and the procedure is repeated. 
Advantages of using ECB – 
 Parallel encryption of blocks of bits is possible, thus it is a faster way of
encryption.
 Simple way of the block cipher.
Disadvantages of using ECB –  
 Prone to cryptanalysis since there is a direct relationship between plaintext
and cipher text. 
 
 
Cipher Block Chaining – 

 Cipher block chaining or CBC is an advancement made on ECB.


 ECB compromises some security requirements.
 In CBC, the previous cipher block is given as input to the next encryption
algorithm after XOR with the original plaintext block.
 In a nutshell here, a cipher block is produced by encrypting an XOR output
of the previous cipher block and present plaintext block. 
The process is illustrated here: 

 
Advantages of CBC – 
 CBC works well for input greater than b bits.
 CBC is a good authentication mechanism.
 Better resistive nature towards cryptanalysis than ECB.
Disadvantages of CBC –  
 Parallel encryption is not possible since every encryption requires a
previous cipher. 
Cipher Feedback Mode (CFB) – 
 In this mode the cipher is given as feedback to the next block of encryption
with some new specifications.
 First, an initial vector IV is used for first encryption and output bits are
divided as a set of s and b-s bits.
 The left-hand side s bits are selected along with plaintext bits to which an
XOR operation is applied.
 The result is given as input to a shift register having b-s bits to lhs,s bits to
rhs and the process continues.
Advantages of CFB – 
 Since, there is some data loss due to the use of shift register, thus it is
difficult for applying cryptanalysis. 
 
Output Feedback Mode – 
 The output feedback mode follows nearly the same process as the Cipher
Feedback mode except that it sends the encrypted output as feedback
instead of the actual cipher which is XOR output.
 In this output feedback mode, all bits of the block are sent instead of
sending selected s bits.
 The Output Feedback mode of block cipher holds great resistance towards
bit transmission errors.
 It also decreases the dependency or relationship of the cipher on the
plaintext.
Advantages of OFB –

 In the case of CFB, a single bit error in a block is propagated to all


subsequent blocks. This problem is solved by OFB as it is free from bit
errors in the plaintext block. 
 
Counter Mode – 

 The Counter Mode or CTR is a simple counter-based block cipher


implementation.
 Every time a counter-initiated value is encrypted and given as input to
XOR with plaintext which results in cipher text block.
 The CTR mode is independent of feedback use and thus can be
implemented in parallel.
Its simple implementation is shown below:
Its simple implementation is shown below:
Advantages of Counter –
  Since there is a different counter value for each block, the direct plaintext
and cipher text relationship is avoided. This means that the same plain text
can map to different cipher text.
 Parallel execution of encryption is possible as outputs from previous stages
are not chained as in the case of CBC

You might also like