Professional Documents
Culture Documents
1. Write a program to generate the key that is provided as input is expanded into an array of
forty-four 32-bit words, w[i]. Four distinct words (128 bits) serve as a round key for each
round; these are indicated in below algorithm
Key[16]=” abcdefghijklmnoz”;
[ a0,0 ] [ 4 3 2 1 ] [ a0,0 ]
| a1,0 | | 5 2 5 4 | | a1,1 |
| a2,0 | = | 2 1 4 3 | | a2,2 |
[ a3,0 ] [ 5 1 2 2 ] [ a3,3 ]
int E[] ={ 32, 1, 2, 3, 4, 5, 4, 5, 6, 7, 8, 9, 8, 9, 10, 11, 12, 13, 12, 13, 14, 15, 16, 17, 16, 17, 18,
19, 20, 21, 20, 21, 22, 23, 24, 25, 24, 25, 26, 27, 28, 29, 28, 29, 30, 31, 32, 1};
int P[] ={ 16, 7, 20, 21, 29, 12, 28, 17, 1, 15, 23, 26, 5, 18, 31, 10, 2, 8, 24, 14, 32, 27, 3, 9, 19, 13, 30,
6, 22, 11, 4, 25};
int P-box[] =
{
14, 17, 11, 24, 1, 5,
3, 28, 15, 6, 21, 10,
23, 19, 12, 4, 26, 8,
16, 7, 27, 20, 13, 2,
41, 52, 31, 37, 47, 55,
30, 40, 51, 45, 33, 48,
44, 49, 39, 56, 34, 53,
46, 42, 50, 36, 29, 32
};
5. Write the program to generate cipher text for the plaintext= “ januarymarchuytr” using below four
steps in sequence for each round. Perform 8 rounds of operation to produce the cipher text
Step 1: X1 * K1
Step 2: X2 + K2
Step 3: X3 + K3
Step 4: X4 * K4
Algorithm
Symbol Operation
* Multiplication modulo 24
+ Addition modulo 24
K1 K2 K3 K4