Bcse309l Module2 Block Cipher Modes
Bcse309l Module2 Block Cipher Modes
Security
Block Cipher Modes of Operation
2
Modes of Operation
3
Modes of Operation
4
Electronic Codebook Book (ECB)
6
Remarks on ECB
• Strength: it’s simple.
• Weakness:
– Repetitive information contained in the plaintext may
show in the ciphertext, if aligned with blocks.
– If the same message is encrypted (with the same key)
and sent twice, their ciphertext are the same.
• Typical application:
– secure transmission of short pieces of information (e.g. a
temporary encryption key)
7
Cipher Block Chaining (CBC)
• Solve security deficiencies in ECB
– Repeated same plaintext block result different ciphertext block
9
Remarks on CBC
10
Cipher FeedBack (CFB)
• Use Initial Vector to start process
• Encrypt previous ciphertext, then combined with the plaintext
block using X-OR to produce the current ciphertext
• Cipher is fed back (hence name) to concatenate with the rest of IV
• Plaintext is treated as a stream of bits
– Any number of bit (1, 8 or 64 or whatever) to be feed back (denoted CFB-1,
CFB-8, CFB-64)
• Relation between plaintext and ciphertext
Ci = Pi XOR SelectLeft(EK (ShiftLeft(Ci-1)))
C0 = IV
• Uses: stream data encryption, authentication
11
Cipher FeedBack (CFB)
12
Cipher FeedBack (CFB)
CFB as a Stream Cipher
• In CFB mode, encipherment and decipherment use the
encryption function of the underlying block cipher.
Remark on CFB
• The block cipher is used as a stream cipher.
• enable to encrypt any number of bits e.g. single bits or single
characters (bytes)
• S=1 : bit stream cipher
• S=8 : character stream cipher
Cipher Feedback
Output Feedback
17
OFB Scheme
18
OFB Encryption and Decryption
OFB as a Stream Cipher
• In OFB mode, encipherment and decipherment use the encryption
function of the underlying block cipher.
Remarks on OFB
• Each bit in the ciphertext is independent of the previous bit or
bits. This avoids error propagation
• Security issue
– when jth plaintext is known, the jth output of the forward
cipher function will be known
– Easily cover jth plaintext block of other message with the
same IV
21
Counter (CTR)
• Encrypts counter value with the key rather than any feedback value
(no feedback)
• Relation
Ci = Pi XOR Oi
Oi = EK (i)
28
CBC and CTR comparison
CBC CTR
Padding needed No padding
30
Comparison of Modes
31
Comparison of Modes
Mode Description Application
32