*3.3.4 Step 4: plotting*

Then shifting operation is performed as follows:

For M1 ⊕ K1, M2 ⊕ K1, M3 ⊕ K1 and M4 ⊕ K1 1st row, R1 no shift 2nd row, R2 1 bit 3rd row, R3 2 bits 4th row, R4 3 bits

For M1 ⊕ K2, M2 ⊕ K2, M3 ⊕ K2 and M4 ⊕ K2

For M1 ⊕ K3, M2 ⊕ K3, M3 ⊕ K3 and M4 ⊕ K3

For M1 ⊕ K4, M2 ⊕ K4, M3 ⊕ K4 and M4 ⊕ K4

As its name suggests, first quadrant selection operation is performed, which gives the selected quadrant value for further processing. In this step, only one 4 � 4 matrix value is selected for further processing for each Mi value. Thus, step. 2 and 3 via series of confusion and logical operations propose four possible 4 � 4 matrix values for further processing, and finally, the selection step selects only one 4 � 4 matrix value for further processing. For this purpose, counters are deployed, which will count the number of 1 s in each quadrant of subkeys K1, K2, K3 and K4 for M1', M2', M3' and M4', respectively. Then, the total number of 1 s in corresponding Ki is

*Total*\_*no*\_*of* \_1*s*\_*in*\_*Ki*

Depending upon the total number of 1 s in Ki for corresponding Mi, the selected

For instance, let us consider that for M1, the total number of 1 s in K1 is calculated (consider 7, for example) and divided by 4. Now, considering the remainder which will be 3, hence Q <sup>s</sup> = 4, the fourth quadrant is selected for further

After this, we pass the Ki via permutation box "P," which will shift the bit position of standard matrix as per bit position of randomly selected transposition

<sup>4</sup> (1)

*Q*<sup>s</sup> ¼ *R*<sup>i</sup> þ 1 (2)

1st row, R1 3 bit 2nd row, R2 no shift 3rd row, R3 1 bit 4th row, R4 2 bits

*Computer and Network Security*

1st row, R1 2 bits 2nd row, R2 3 bits 3rd row, R3 no shift 4th row, R4 1 bit

1st row, R1 1 bit 2nd row, R2 2 bits 3rd row, R3 3 bits 4th row, R4 no shift

divided by 4 and the remainder is found.

quadrant value will be decided.

processing and denoted as Mis.

matrix shown in the **Table 5**.

**150**

*Remainder R*ð Þ¼*<sup>i</sup>*

*3.3.3 Step 3: selection*

Now, consider the standard matrix distribution of any 4 � 4 matrix as shown in **Table 6**. Each of the four M1\*, M2\*, M3\* and M4\* values will have different transformations when plotted in XY graph. Values of M1" will be populated to 1st quadrant as per graph position, which can be realized by permutation as shown in **Tables 7** and **8**.

In this way, the values of M1", M2", M3" and M4" are populated to the reference XY graph.

#### *3.3.5 Step 5: arrangement and conversion*

Finally, we have M1", M2", M3" and M4" plotted in 8 � 8 matrix form. Now, each row of the matrix is converted from binay to decimal and then to plaintext


**Table 5.**

*Reference standard 4* � *4 transposition matrix distribution.*



#### **Table 6.**

*Plotting the values to standard XY axis graph.*


#### **Table 7.**

*Permutations P1 and P2 for M1 and M2.*


4: for, (j = 0; j < 4; j++); 5: M1 [i] [j] Mp; 6: for, (i = 0; i < 4; i++); 7: for, (j = 0; j < 4; j++);

*Hybrid Approaches to Block Cipher*

*DOI: http://dx.doi.org/10.5772/intechopen.82272*

8: l = j + 4;

11: k = i + 4:

15: k = i + 4:

17: l = j + 4;

20: Compute:

9: M2 [i] [j] Mp; 10: for, (i = 0; i < 4; i++);

12: for, (j = 0; j < 4; j++); 13: M3 [i] [j] Mp; 14: for, (i = 0; i < 4; i++);

16: for, (j = 0; j < 4; j++);

18: M4 [i] [j] Mp;

27: 1st row no shift

33: 2nd row no shift

39: 3rd row no shift

**153**

19: Generate K1, K2, K3, K4 from K similar to plaint text.

21: M1 ⊕ K1, M1 ⊕ K2, M1 ⊕ K3, M1 ⊕ K4; 22: M2 ⊕ K1, M2 ⊕ K2, M2 ⊕ K3, M2 ⊕ K4; 23: M3 ⊕ K1, M3 ⊕ K2, M3 ⊕ K3, M3 ⊕ K4; 24: M4 ⊕ K1, M4 ⊕ K2, M4 ⊕ K3 and M4 ⊕ K4; 25: Perform Right Shift Operation circularly: 26: With M1 ⊕ K1, M2 ⊕ K1, M3 ⊕ K1 and M4 ⊕ K1

28: Right circular shift the 2nd row by 1 bit 29: Right circular shift the 3rd row by 2 bits 30: Right circular shift the 4th row by 3 bits 31: With, M1 ⊕ K2, M2 ⊕ K2, M3 ⊕ K2 and M4 ⊕ K2 32: Right circular shift the 1st row by 3 bits

34: Right circular shift the 3rd row by 1 bit 35: Right circular shift the 4th row by 2 bits 36: With M1 ⊕ K3, M2 ⊕ K3, M3 ⊕ K3 and M4 ⊕ K3 37: Right circular shift the 1st row by 2 bits 38: Right circular shift the 2nd row by 3 bits

40: Right circular shift the 4th row by 1 bit 41: With M1 ⊕ K4, M2 ⊕ K4, M3 ⊕ K4 and M4 ⊕ K4 42: Right circular shift the 1st row by 1 bit 43: Right circular shift the 2nd row by 2 bits 44: Right circular shift the 3rd row by 3 bits

**Table 8.** *Permutations P3 and P4 for M3 and M4.*


**Table 9.**

*Example conversion of ASCII cipher into binary.*

characters by referring the standard ASCII table, as illustrated in **Table 9**, and this is our ciphertext.

### **3.4 The decryption process**

Decryption is also performed in the same manner as encryption but in reverse order. The steps involved in decryption are: (1) conversion and arrangement, (2) plotting, (3) selection, (4) transformation and (5) arrangement and conversion.
