Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
20 views19 pages

Unit 2 Part 5

The document outlines various block cipher modes of operation, including Electronic Codebook (ECB), Cipher Block Chaining (CBC), Cipher Feedback (CFB), Output Feedback (OFB), and Counter (CTR). Each mode has distinct characteristics regarding how plaintext is processed, the use of initialization vectors, and the implications for encryption and decryption. Additionally, the document highlights the advantages of the CTR mode, such as hardware and software efficiency, random access, and provable security.

Uploaded by

3atntv9hpx
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views19 pages

Unit 2 Part 5

The document outlines various block cipher modes of operation, including Electronic Codebook (ECB), Cipher Block Chaining (CBC), Cipher Feedback (CFB), Output Feedback (OFB), and Counter (CTR). Each mode has distinct characteristics regarding how plaintext is processed, the use of initialization vectors, and the implications for encryption and decryption. Additionally, the document highlights the advantages of the CTR mode, such as hardware and software efficiency, random access, and provable security.

Uploaded by

3atntv9hpx
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 19

Block Cipher Modes of

Operation
1. Electronic Codebook (ECB)
2. Cipher Block Chaining (CBC)
3. Cipher Feedback (CFB)
4. Output Feedback (OFB)
5. Counter (CTR)
1. Electronic Codebook
Key Points

● Plaintext is handled one block at a time


● Each block of plaintext is encrypted using the same key.
● The term codebook is used because, for a given key, there is a unique
ciphertext for every b-bit block of plaintext.
● For a message longer than b bits, the procedure is simply to break the
message into b-bit blocks, padding the last block if necessary.
● Decryption is performed one block at a time, always using the same
key.
● If the same b-bit block of plaintext appears more than once in the
message, it always produces the same ciphertext.
Criteria for other modes
2.Cipher Block Chaining Mode
Key Points
1. In this scheme, the input to the encryption algorithm is the XOR of the current plaintext
block and the preceding ciphertext block; the same key is used for each block.
2. In effect, we have chained together the processing of the sequence of plaintext blocks.
3. It requires that the last block be padded to a full b bits if it is a partial block.
4. For decryption, each cipher block is passed through the decryption algorithm. The result is
XORed with the preceding ciphertext block to produce the plaintext block
5. To produce the first block of ciphertext, an initialization vector (IV) is XORed with the first
block of plaintext. On decryption, the IV is XORed with the output of the decryption
algorithm to recover the first block of plaintext. The IV is a data block that is the same size
as the cipher block.
6. IV confidentiality shared between sender and receiver.
7. In particular, for any given plaintext, it must not be possible to predict the IV that will be
associated to the plaintext in advance of the generation of the IV.
8. because of the chaining mechanism of CBC, it is an appropriate mode for encrypting
messages of length greater than b bits.
Convert Block to Stream Cipher
Why?
● Eliminates need to pad data.
● Encryption and decryption can be done on the fly.
1. Cipher Feedback (CFB)
2. Output Feedback (OFB)
3. Counter (CTR)
3. Cipher Feedback Mode
Steps
The plaintext is divided into segments of s bits.

Encryption:

1. The input to the encryption function is a b-bit shift register that is initially set to some initialization vector (IV).
2. The leftmost (most significant) s bits of the output of the encryption function are XORed with the first segment of
plaintext P1 to produce the first unit of ciphertext C1, which is then transmitted.
3. In addition, the contents of the shift register are shifted left by s bits, and C1 is placed in the rightmost (least
significant) s bits of the shift register.
4. This process continues until all plaintext units have been encrypted.

Decryption:

The same scheme is used, except that the received ciphertext unit is XORed with the output of the encryption function
to produce the plaintext unit. Note that it is the encryption function that is used, not the decryption function.
4. Output Feedback Mode
Key Points
● For OFB, the output of the encryption function is fed back to become the input
for encrypting the next block of plaintext
● OFB mode operates on full blocks of plaintext and ciphertext.
● IV(Nonce) must be unique to each execution of the encryption operation
● One advantage of the OFB method is that bit errors in transmission do not
propagate.
● The disadvantage of OFB is that it is more vulnerable to a message stream
modification attack than is CFB
4. Counter Mode
Key Points
A counter equal to the plaintext block size is used.

The counter value must be different for each plaintext block that is encrypted. Typically, the
counter is initialized to some value and then incremented by 1 for each subsequent block .

For encryption, the counter is encrypted and then XORed with the plaintext block to produce the
ciphertext block; there is no chaining.

For decryption, the same sequence of counter values is used, with each encrypted counter
XORed with a ciphertext block to recover the corresponding plaintext block. Thus, the initial
counter value must be made available for decryption.

For the last plaintext block, which may be a partial block of u bits, the most significant u bits of the
last output block are used for the XOR operation; the remaining b - u bits are discarded.
Advantages of Counter Mode
1. Hardware efficiency: Unlike the three chaining modes, encryption (or decryption) in CTR
mode can be done in parallel on multiple blocks of plaintext or ciphertext.
2. Software efficiency: Similarly, because of the opportunities for parallel execution in CTR
mode, processors that support parallel features, such as aggressive pipelining, multiple
instruction dispatch per clock cycle, a large number of registers, and SIMD instructions, can
be effectively utilized.
3. Random access: The ith block of plaintext or ciphertext can be processed in random-access
fashion. With the chaining modes, block Ci cannot be computed until the i - 1 prior blocks are
computed.
4. Provable security: It can be shown that CTR is at least as secure as the other modes
discussed in this chapter.
5. Simplicity: Unlike ECB and CBC modes, CTR mode requires only the implementation of the
encryption algorithm and not the decryption algorithm. This matters most when the
decryption algorithm differs substantially from the encryption algorithm, as it does for AES

You might also like