BLOCK CIPHER OPERATIONS
BLOCK CIPHER OPERATIONS
OPERATIONS
BY DR. DIPANWITA SADHUKHAN
Multiple Encryption
• Multiple encryption is a technique in
which an encryption algorithm is used
multiple times.
• In the first instance, plaintext is converted
to ciphertext using the encryption
algorithm.
• This ciphertext is then used as input and
the algorithm is applied again.
• This process may be repeated through
any number of stages.
• E.g. Triple DES uses three stages of the
DES algorithm, using two or three distinct
• keys.
Advantage:
• Padding
The final block may require padding to fit a
block size. Add null Bytes, Add the n bytes
with value to achieve padding.
Electronic Codebook (ECB)
• It is one of the simplest modes of
operation.
• The plain text is divided into a block. Why codebook?
• Each block is encrypted separately. • If the block of plain text is
• The same key is used for the repeated in the original message,
encryption of all blocks. then the ciphertext’s
corresponding block will also
• It makes the block of ciphertext. repeat.
• The same key which is used for • As the same key is used for tor all
encryption is used for decryption.
blocks.
• Each block is encoded independently
of the other blocks. C i = EK (Pi)
C0 = IV
Cipher Block Chaining (CBC)
Pros Cons
• Identical blocks do not have the • Block Loss: blocks depend on their
same cipher. previous blocks for encryption. So,
if block Bi is lost, the encryption of
• This is because the initialization all subsequent blocks will not be
vector adds a random factor to possible.
each block.
• Slow
• Confidentiality
• No parallelism: the encryption of
• Authentication due to IV blocks needs to be done
sequentially, not in parallel.
• IV must be known to both sender
and receiver.
Cipher Feedback (CFB)
• Convert the block cipher into a • Like cipher block chaining mode, IV
stream cipher. is initialized.
• The length of PT=the length of CT • The IV is kept in the shift register.
It is encrypted using the key and
• Real-time data transfer. forms the ciphertext.
• No need for padding. • Now the leftmost j bits of the
encrypted IV is XOR with the plain
• Usage: General purpose stream- text’s first j bits.
oriented data transfer.
• This process will form the first part
• Authentication. of the ciphertext, and this
• ciphertext will be transmitted to
the receiver.
Cipher Feedback (CFB)
Cipher Feedback (CFB)
Pros Cons
• Can operate on real-time data • Wastage of transmission capacity
of the channel.
• Need for padding is eliminated
• Not a typical stream cipher
• Encryption function does the
decryption as well.
• Length PT=Length of CT
Output Feedback (OFB)
• OFB mode is similar to CFB mode; the only difference is in CFB, the
ciphertext is used for the next stage of the encryption process,
whereas in OFB, the output of the IV encryption is used for the next
stage of the encryption process.
• The IV is encrypted using the key and form encrypted IV. Plain text
and encrypted IV are combined using XOR and produce the ciphertext.
• For the next stage, the ciphertext, which is the form in the previous
stage, is used as an IV for the next iteration. The same procedure is
followed for all blocks.
Output Feedback (OFB)
Ci = Pi XOR Oi
Oi = EK (Oi-1)
O0 = IV
Output Feedback (OFB)
• The alternative to CFB is OFB.
• Here the generation of the “random” • Feedback is independent of the
bits is independent of the message message.
being encrypted. • Sender and receiver must be
• The advantage is that firstly, they can synched every time.
be computed in advance, good for • Vulnerable to modification attack.
bursty traffic • Not parallelizable.
Ci = Pi XOR Oi
Oi = EK (i)
Counter (CTR)
•Strengths:
• Needs only the encryption algorithm
• Random access to encrypted data blocks
• Simple; fast encryption/decryption
•Counter must be
• Must be unknown and unpredictable
• Randomness in the cipher is a goal
CBC and CTR comparison
Applications of Different Modes
Comparison