Lecture 8: Block Cipher Modes of Operation (features, standards, confidentiality modes, ECB, CBC, CTR, CMAC, HMAC) Flashcards
What type of blocks of data do block ciphers encrypt?
Single
Is breaking plaintext into blocks and encrypting each separately secure or insecure?
insecure
Why do block ciphers have different modes of operation?
Different modes have different efficiency and communication properties → trade-off between security and efficiency
What is the general reason that different modes were designed?
Designed to provide confidentiality and/or authentication (and integrity)
What do all modes that provided confidentiality include?
randomisation
What is the problem with having the same plaintext is encrypted to same ciphertext every time?
allowing patterns to be found in long ciphertext
How can we prevent the following problem?
same plaintext is encrypted to same ciphertext every time
use randomise encryption schemes
OR
vary encryption by including variable state which is updated with each block → update state each time
What is used in randomised encryption schemes?
- Using initialization vector V which propagates through entire ciphertext
- IV may be random or unique
What impact efficiency for practical usage?
Parallel processing and error propagation
Explain parallel processing
multiple plaintext blocks encrypted in parallel, multiple ciphertext blocks are decrypted in parallel
Explain error propagation
bit error occurs in ciphertext results in multiple bit errors in plaintext after decryption
When is padding used?
When requiring plaintext to consist of complete blocks
What is NIST’s suggestion for padding?
1) append ‘1’ bit to data string, 2) pad resulting string by as few ‘0’ bits to complete block
Explain what is meant by “padding bits remove ambiguity if known”
1) removing all trailing ‘0’ after last ‘1’ bit, 2) remove ‘1’ bit
Small probability of getting wrong → ½ chance per bit
What is the notation for the plaintext message i.t.o modes?
Plaintext message P (n blocks in length)
What is the notation for the t-th plaintext block i.t.o modes?
Pt, for 1 <= t <= n
What is the notation for the ciphertext message i.t.o modes?
C
What is the notiation for the T-th ciphertext block i.t.o modes?
Ct, for 1 <= t <= n
What is the notation for the key i.t.o modes?
K
What is the notation for the initialisation vector i.t.o modes?
V
Can any mode apply to any block cipher?
yes
What does ECB mode stand for?
Electronic code block
What is the formula for ECD mode’s encryption? What does it imply?
Ct = E(Pt ,K)
Implies that ECD mode is a basic mode for block ciphers as there is no chaining.
What is the decryption formula for ECB mode?
Pt = D(Ct,K)
Give the diagram for ECB encryption
see slides –> add to cheat sheet
Give the diagram for ECB decryption
see slides –> add to cheat sheet
Briefly explain ECB mode encryption
Plaintext block Pt encrypted with key K to produce ciphertext block Ct
Briefly explain ECB mode decryption
Ciphertext block Ct decrypted with key K to produce plaintext block Pt
Is ECD mode randomised?
no
Is padding required for ECD mode?
yes
Comment on the error propagation for ECD mode.
Errors propagate within blocks
Does ECB mode have an IV?
no
Is parallel encryption or decryption possible for ECB mode? Why?
Both possible since no chaining for either encryption or decryption
Is ECB mode deterministic? What does this imply?
Yes
Not normally used for bulk encryption since deterministic encryption schemes always produces the same ciphertext for a given plaintext and key, even over separate executions of the encryption algorithm
Is ECB a confidentiality or authentication mode?
confidentiality
Is CBC a confidentiality or authentication mode?
confidentiality
Is CTR a confidentiality or authentication mode?
confidentiality
Is MAC a confidentiality or authentication mode?
authentication
Is CDC-MAC a confidentiality or authentication mode?
authentication
Is CMAC a confidentiality or authentication mode?
authentication
Are blocks chained together in CBC mode encryption?
yes
What is the formula for determining Ct in CBC mode encryption?
Ct = E(Pt ⊕ Ct-1, K) s.t. C0 = IV
What role does IV play in CBC mode encryption?
IV chosen randomly and sent with ciphertext blocks
Briefly outline CBC mode encryption
Pt XORed with previous ciphertext block Ct-1 and encrypted with key K to produce Ct
Give the diagram for CBC mode encryption
see slides –> add to cheat sheet
What is the formula for determining Pt in CBC mode decryption
Pt = D(Ct,K) ⊕ Ct-1 s.t. C0 = IV
Briefly outline CBC mode decryption
Ct decrypted with key K and XORed with previous ciphertext block Ct-1 to produce Pt