Assuming you are using a 64-bit (8-byte) block cipher in CBC mode. Show the results of padding the following plaintexts so they can fit into an even number of blocks.
(A) 0f8353c2 8e1ff6
(B) 8c521e
(C) c1
(D) 9f6bef2c 902fe4ba
We will use PKCS5 padding. It is most common type of padding.
In PKCS5, the padding bytes have thesame value and is equal to the number of padding bytes
I will write the padded bytes in bold
(A) 0f8353c2 8e1ff6
Here we need 1 padding byte, and the value will be 01
It is given that block size = 8 bytes
Block 1 = 0f8353c2
Block 2 = 8e1ff601
(B) 8c521e
Here we need 5 padding byte, and the value will be 05
Block 1 = 8c521e05
Block 2 = 05050505
(C) c1
Here we need 7 padding bytes, so the value will be 07
Block 1 = c1070707
Block 2 = 07070707
(D) 9f6bef2c 902fe4ba
Here we don't need any padding bytes
Block 1 = 9f6bef2c
Block 2 = 902fe4ba
Get Answers For Free
Most questions answered within 1 hours.