In: Computer Science
Consider the following substitution block cipher:
Plain-text
000 110
001 100
010 111
011 001
100 101
101 000
110 010
111 011
Cipher-text
[10]
Compute the cipher-text belonging to plaintext 001 110 000 101 110 (using a block size of 3 bits) for the Electronic Code Book (ECB) mode and Cipher Block Chaining (CBC) mode taking IV = 111. Show the intermediate steps.
Let's Consider the given substitution block cipher:
Plain Text | Cipher-Text |
000 | 110 |
001 | 100 |
010 | 111 |
011 | 001 |
100 | 101 |
101 | 000 |
110 | 010 |
111 | 011 |
To Compute the cipher-text belonging to plaintext 001 110 000 101 110
Electronic Code Book (ECB): In Electronic Code Book Mode we encrypt each block independently. So We use the Given Substitution cipher and encrypt the message as follow:
Plain Text(Block of 3) | 001 | 110 | 000 | 101 | 110 |
Cipher-Text(Block of 3) | 100 | 010 | 110 | 000 | 010 |
The Cipher Text (Computed using ECB) is: 100 010 110 000 010
Cipher Block Chaining (CBC) mode taking IV = 111. Show the intermediate steps. |
Solution:
In CBC we use the following Formula for Encrypting the Given Message:
Ci=Fk(Pi⊕Ci-1)
For i=1:
C1=Fk (P1⊕IV) For the first Block we use the Initialization Vector.
=F(001⊕ 111)=F(110)=101
C2=Fk (P2⊕C1)=Fk (110⊕101)=Fk(011)=001
C3=Fk (P3⊕C2)=Fk (000⊕001)=Fk(001)=100
C4=Fk (P4⊕C3)=Fk (101⊕100)=Fk(001)=100
C5=Fk (P5⊕C4)=Fk (110⊕100)=Fk(010)=111
The Computation is Summarized in the following Table:
S.NO | Pi | Ci-1 | Pi⊕Ci-1 | Cipher Text (ci) |
1 | 001 | 111 | 110 | 101 |
2 | 110 | 101 | 011 | 001 |
3 | 000 | 001 | 001 | 100 |
4 | 101 | 100 | 001 | 100 |
5 | 110 | 100 | 010 | 111 |
The Encrypted Message is: 101 001 100 100 111