Is - Unit 3
Is - Unit 3
Is - Unit 3
• Properties of ECB
• Deterministic:
• The identical data block gets encrypted the identical way, reveals patterns of
data when a data block repeats
Block Cipher Encryption Modes: ECB
• Advantages
• Each clock is independent; multiple blocks can be processed simultaneously
• If any plaintext/ciphertext block is lost, other blocks are not affected
• Parallel processing during encryption and decryption will increase the speed
• Disadvantages
• Two identical plaintext blocks will generate two identical ciphertext blocks
• Therefore, known plaintext attack is possible!
Block Cipher
Encryption Modes:
CBC
• Cipher Block Chaining (CBC):
• Uses a random Initial Vector (IV)
• Next input depends upon previous
output
• Encryption: Ci= Ek (Mi⊕Ci-1), with
C0=IV
• Decryption: Mi= Ci-1⊕Dk(Ci), with
C0=IV
• Size of Pi,Ci and IV?
Properties of CBC
• Randomized encryption:
• repeated text gets mapped to different encrypted data.
• A ciphertext block depends on all preceding plaintext blocks; reorder affects
decryption
• Usage:
• chooses random IV and protects the integrity of IV
Pros and Cons of CBC mode
• Aadvantages:
• For identical blocks of plaintext, different ciphertext blocks are generated; It
is more resilient to the known plaintext attacks as compared to the ECB
• Hash Value: last ciphertext block depends upon all the plaintext blocks; it can
be used as a hash value of the whole message, and it helps to identify if the
message is modified
• Disadvantages
Block Cipher Encryption Modes: CFB
• Feedback Mode
• No padding required..
• Two types of feedback – CFB and OFB
• CFB
• Initialization vector of 64 bit is chosen randomly
• IV is passed through a 64-bit shift register
• The result is encrypted
• From the encryption results – s bits are selected and 64-s bits are discarded
• Plaintext block is XORed with s bits to generate the Ciphertext block
• Ciphertext block is fed as an input to the shift register for processing Next
plaintext block
Block Cipher Encryption Modes: CFB
• Advantages
• No padding needed
• Disadvantages
• Bit error may propagate
Block Cipher Encryption Modes: OFB
• Output Feedback (S bits – S = size of plaintext block)
• A 64 bit Shift register is used here.
• One Initialization Vector (IV) is selected and passed through the shift
register;
• Apply the encryption Algorithm
• Divide the Cipher text into two parts: s-bits and b-s bits
• Discard (64-s) bits and XOR the s bits with the plaintext block –
ciphertext generated
• Feed s bits to the next block
Pros and Cons of OFB
• Advantages
• Free from Bit error
• Disadvantages
• Vulnerable to a stream modification attack
Block Cipher Encryption Modes: CTR
• The block cipher works like a stream cipher.
• Here one counter is used and the value of counter is changed for processing next block
• Initially, the user needs to set some value to the counter.
• That counter value is encrypted and the result is XORed with the plaintext block to
generate the ciphertext.
• For the next block, the counter value is increased by 1 and the same procedure is
followed.
• For identical plaintexts, ciphertexts would be different.
Block Cipher Encryption Modes: CTR
• Advantages:
• This is faster that CBC mode
• Encryption can be done in parallel
• Padding is not required
• Processing of blocks can be done randomly
• Disadvantages:
• If the counter values are reused, the security is compromised.
• Integrity of the message is not maintained.