Lec-6 Modes of Operation
Lec-6 Modes of Operation
Lec. 6
Modes of Operation
Block Cipher
• In a block cipher, a group of plaintext symbols
of size m (m > 1) are encrypted together
creating a group of ciphertext of the same size.
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)
Parallel Processing
Cipher Block Chaining (CBC)
Solve security deficiencies in ECB
Repeated same plaintext block result different ciphertext
block
Weakness
• Error propagation: A corrupted ciphertext segment during
transmission will affect the current and next several plaintext
segments.
• Parallel processing is not possible
Output FeedBack (OFB)
Very similar to CFB
Limitations
Nonce is used as IV. Nonce can be used only one time
Parallel processing is not possible
It is more vulnerable to a message stream modification attack than CFB.
Consider that complementing a bit in the cipher text complements the
corresponding bit in the recovered plaintext. So undetected controlled
changes to both ciphertext as well plaintext can be made
Counter (CTR)
Encrypts counter value with the key rather than any feedback
value (no feedback)
Relation
Ci = Pi XOR Oi
Oi = EK (i)
Pi = Ci XOR Oi
Uses: high-speed network encryptions
CTR Encryption and Decryption
Counter (CTR)
Strengths:
Needs only the encryption algorithm
Random access to encrypted data blocks
blocks can be processed (encrypted or decrypted) in parallel
Simple; fast encryption/decryption
Weakness:
Counter must be
Must be unknown and unpredictable(the initial counter value must be a
nonce; that is, must be different for all of the messages encrypted using
the same key. )
pseudo-randomness in the key stream is a goal
CBC and CTR comparison
CBC CTR
Padding needed No padding
Nonce reuse leaks some information Nonce reuse will leak information
about initial plaintext block about the entire message
Comparison of Different Modes
Applications