14-Block Cipher Modes of Operation
14-Block Cipher Modes of Operation
The major criticism of DES regards its key length. Fortunately DES is not a
group. This means that we can use double or triple DES to increase the key size.
A substitution that maps every possible input to every possible output is a group.
Double DES
The first approach is to use double DES (2DES).
Meet-in-the-Middle Attack
However, using a known-plaintext attack called meet-in-the-middle attack
proves that double DES improves this vulnerability slightly (to 257 tests),
but not tremendously (to 2112).
C = EK3[DK2[EK1[P]]]
• C = Ciphertext
• P = Plaintext
• EK[X] = encryption of X using key K
• DK[Y] = decryption of Y using key K
• Effective key length of 168 bits
Triple DES
• At the receiver’s end, the incoming data is divided into ‘N’ blocks of
‘n’ bits each, and by using the same key as was used for encryption,
each block is decrypted to produce the corresponding plain text block.
• In ECB, since a single key is used for encrypting all the blocks of
message, if a plain text block repeats in the original message, the
corresponding cipher text block will also repeat in the encrypted
message. Therefore ECB is suitable only for encrypting small
message where the scope for repeating the same plain text blocks is
quite less.
Electronic Codebook Mode (ECB) Contd.
Advantages
• Each block can be encrypted/decrypted in parallel
• Noise in one block affects no other block
• Simple
Disadvantage: vulnerable to cryptanalysis
• Repetitive information contained in the plaintext may show in
the ciphertext, if aligned with blocks.
• If the same message (e.g., an SSN) is encrypted (with the same
key)
• Typical application: secure transmission of short pieces of
information (e.g. a temporary encryption key)
Electronic Codebook Mode (ECB) Contd.
Cipher Block Chaining (CBC)
• First step receives two inputs: the first block of plain text and a
random block of text called as Initialization Vector (IV)
• Remember that the IV is used only in the first plain text block.
However, the same key is for encryption of all plain text blocks.
Cipher Block Chaining (CBC) Contd.
Ci = E K ( Ci −1 Pi )
C0 = IV
Encryption Decryption
C0 = IV P0 = D(K, C0) IV
Ci = E(K, Pi Ci-1) Pi = D(K, Ci) Ci-1
Cipher Block Chaining (CBC)
Advantages and Limitations of CBC
• Not all applications can work with blocks of data. Security is also
required in applications that are character-oriented. For instance, an
operator can be typing keystrokes at terminal, which need to be
immediately transmitted across the communications link in a secure
manner. In such situations, stream cipher must be used.
r-bit Ci
transmitted
Cipher Feedback Mode Contd.
Decryption:
• Recipient uses previous ciphertext to
create same shift register S
• Encrypted with key
• First r bits taken to create byte key
ki
• XORed with next r bits of
ciphertext received to get next r
bits of plaintext.
Cipher Feedback Mode Contd.
Problem
• CFB inherently sequential
• Each block depends on previous block(s)
• Cannot take advantage of parallel hardware to speed up
encryption/decryption
• Cannot generate byte keys in advance while waiting for rest of
message
Solutions:
• Output Feedback Mode (OFB)
• Counter Mode (CTR)
Problem 1
• With the ECB mode of DES, if there is an erro in a block of the
transmitted cipher text only the corresponding plaintext block is
affected. However, in the CBC mode, this error propagates. For
example, an error in the transmitted C1 obiviously corrupts in P1 and
P2
▪ Are any blocks beyond P2 affected
▪ Suppose that there is a bit error in the source version of P1.
Through how many Ciphertext blocks is this error propagated?
What is the effect at the receiver