Block Cipher Operations
Block Cipher Operations
• B = D(i, C)
Cipher
Feedback
Cipher (CFB)
Electronic Output
Block Counter
Codebook Feedback
Chaining (CTR)
(ECB) (OFB)
(CBC)
ECB
• Ci = E(K, Pi); where i = 1, 2, ……….., N.
• P1 = D(K, C1) ⊕ IV
• Pi = D(K, Ci) ⊕ Ci-1; where i = 2, 3, 4, ……………, N
CBC
(Contd..) • The size of IV is same as that of the blocks.
• The IV must be known and kept confidential to both
sender and the receiver, and must be protected against
unauthorized changes.
• IV must be unique for each session
• IV can be kept confidential through ECB encryption.
• Integrity of IV can be provided using Message
Authentication Codes (MACs).
• P1 = IV ⊕ D(K, C1)
• So, P1[i] = IV[i] ⊕ D(K, C1)[i]
• Hence, P1[i]’ = IV[i]’ ⊕ D(K, C1)[i]
• The attacker takes advantage of ‘⊕’ to manipulate the
PT by altering IV.
Threat to
Integrity of IV
in CBC
• Recommended methods for unpredictable IV
generations:- Nonce, Random Number Generator
• Simple to understand and easy to implement.
• More resistant to Pattern attack when compared to
that of ECB.
• Provides better diffusion property when compared to
that of ECB.
• Higher Efficiency
• Lower Latency
• Flexibility
• Error Propagation Control
CFB
(Encryption)
CFB
(Decryption)
• PT is divided into segments of ‘s’ bits each.
• Popular choice of ‘s’ = 1 Byte.
• I1 = IV
CFB • Ij = LSBb-s(Ij-1)||Cj-1; j = 2, 3, 4, …….., N
(Contd..) • Oj = E(K, Ij); j = 1, 2, 3, ………., N
• Cj = Pj ⊕ MSBs(Oj) ; j = 1, 2, 3, ………., N
• Pj = Cj ⊕ MSBs(Oj); j = 1, 2, 3, ………., N
• Padding is not required.
• Encryption Function can be used for executing the
corresponding Decryption function as well.
• Error Propagation is lesser compared to that of CBC.
• More Flexible.
• I1 = Nonce
OFB
• Ij = Oj-1; j = 2, 3, …………., N
(Contd..)
• Oj = E(K, Ij); j = 1, 2, 3, ……., N
• Cj = Pj ⊕ Oj; j = 1, 2, 3, ……., N – 1
• CN = PN ⊕ MSBu(ON); where u<=b
• Pj = Cj ⊕ Oj; j = 1, 2, 3, ……., N – 1
• PN = CN ⊕ MSBu(ON); where u<=b
• Encryption Function can be used for executing the
corresponding Decryption function as well.
• Error Propagation doesn’t happen.
• Provides partial parallel processing of the blocks.
• Padding is not required.
• Management of Tweaks
• The Cipher is more vulnerable if the Tweak space is small
Storage Encryption Requirements (Defined by P1619)
• The ciphertext is freely available for an attacker.
• The data layout is not changed on the storage medium and in transit.
• Data are accessed in fixed sized blocks, independently from each other.
• Encryption is performed in 16-byte blocks, independently from other blocks.
• There are no other metadata used, except the location of the data blocks within
the whole data set.
• The same plaintext is encrypted to different ciphertexts at different locations,
but always to the same ciphertext when written to the same location again.
• A standard conformant device can be constructed for decryption of data
encrypted by another standard conformant device.
Vulnerabilities identified by P1619 group for stored data
encryptions by traditional modes
• IV Prediction attack in CBC
• CT copying in CBC
• Bit Flipping attack in CBC.
Encryption:-
XTS-AES
• T = E(K2, i) ⊗ αj
Operation
• PP = P ⊕ T
on Single
• CC = E(K1, PP)
Block • C = CC ⊕ T
(Contd..)
Decryption:-
• CC = C ⊕ T
• PP = D(K1, CC)
• P = PP ⊕ T
XTS-AES
Operation on
a Sector
• PT → (P0, P1, P2, ……., Pm-1, Pm; 128 bits each till
XTS-AES th
(m-1) block)
Operation on
• Pm (‘s’ bits); where 1 ≤ s ≤ 127 bits.
a Sector
(Contd..) • Cm-1 is the last CT block having 128 bits.
• YY = Pm||CP
• Cm = MSBs(XX)
XTS-AES • Pj = XTS-AES-blockDec(K, Cj, i, j); j= 0, 1, ……., m-2
Operation on a
Sector, when
final block is • YY = XTS-AES-blockDec(K, Cm-1, i, m-1)
incomplete
(Decryption) • CP = LSB128-s(YY)
• XX = Cm||CP
• Pm = MSBs(YY)
• Parallel Processing (Except the last incomplete block)
• Flexibility
• More secure compared to the traditional modes of
operations of Block Ciphers.
Pros and • Suits well for confidentiality in sector-based storage
devices.
Cons of XTS- • Provides a minor level of Data Integrity.
AES
• Complex Implementation
• Generally limited to data at rest.
• Generally, doesn’t suite for a network of devices.
• Key Management Issues