Daniel Tefera
Daniel Tefera
FACULTY OF TECHNOLOGY
DEPARTMENT OF COMPUTER SCIENCE
Cipher Text =?
L = 01000100010000010100111001001001
R = 01000101010011000000100101010100
K = 133457799BBCDFF1
K(binary) = 0001001100110100010101110111100110011011101111001101111111110001
Next, split this key into left and right halves, C0 and D0, where each half has 28 bits.
With C0 and D0 defined, we now create sixteen blocks Cn and Dn, 1<=n<=16.
Each pair of blocks Cn and Dn is formed from the previous pair Cn-1 and Dn-1,
respectively, for n = 1, 2, ..., 16, (using the given schedule in the hand out) of "left shifts"
of the previous block.
C0 = 1111000011001100101010101111
D0 = 0101010101100110011110001111
C1 = 1110000110011001010101011111
D1 = 1010101011001100111100011110
C2 = 1100001100110010101010111111
D2 = 0101010110011001111000111101
C3 = 0000110011001010101011111111
D3 = 0101011001100111100011110101
C4 = 0011001100101010101111111100
D4 = 0101100110011110001111010101
C5 = 1100110010101010111111110000
D5 = 0110011001111000111101010101
C6 = 0011001010101011111111000011
D6 = 1001100111100011110101010101
C7 = 1100101010101111111100001100
D7 = 0110011110001111010101010110
C8 = 0010101010111111110000110011
D8 = 1001111000111101010101011001
C9 = 0101010101111111100001100110
D9 = 0011110001111010101010110011
C10 = 0101010111111110000110011001
D10 = 1111000111101010101011001100
C11 = 0101011111111000011001100101
D11 = 1100011110101010101100110011
C12 = 0101111111100001100110010101
D12 = 0001111010101010110011001111
C13 = 0111111110000110011001010101
D13 = 0111101010101011001100111100
C14 = 1111111000011001100101010101
D14 = 1110101010101100110011110001
C15 = 1111100001100110010101010111
D15 = 1010101010110011001111000111
C16 = 1111000011001100101010101111
D16 = 0101010101100110011110001111
We now form the keys Kn, for 1<=n<=16, by applying the following permutation table to each of
the concatenated pairs CnDn. Each pair has 56 bits, but PC-2( given in the hand out) only uses 48
of these.
C1D1 = 1110000 1100110 0101010 1011111 1010101 0110011 0011110 0011110 which,
after we apply the permutation PC-2, becomes
Now we look at the message (DANIEL TEFERA (the first 64 bit)) itself.
This rearranges the bits according to the table given in the hand out, where the entries in the table
show the new arrangement of the bits from their initial order. The 58th bit of M becomes the first
bit of IP. The 50th bit of M becomes the second bit of IP. The 7th bit of M is the last bit of IP.
IP is given in the handout.
M = 0100010001000001010011100100100101000101010011000000100101010100
IP = 1011111110000000101101010101101000000000000000000110110000000100
Next divide the permuted block IP into a left half L0 of 32 bits, and a right half R0 of 32 bits.
L0 = 10111111100000001011010101011010
R0 = 00000000000000000110110000000100
We now proceed through 16 iterations, for 1<=n<=16, using a function f which operates on two
blocks--a data block of 32 bits and a key Kn of 48 bits--to produce a block of 32 bits.
Let + denote XOR addition.
To calculate f, we first expand each block Rn-1 from 32 bits to 48 bits. This is done by using a E
bit-selection table (given in the hand out) that repeats some of the bits in Rn-1. We'll call the use
of this selection table the function E. Thus E (Rn-1) has a 32 bit input block, and a 48 bit output
block.
Note that each block of 4 original bits has been expanded to a block of 6 output bits.
Next in the f calculation, we XOR the output E(Rn-1) with the key Kn:
Kn + E(Rn-1).
For n = 1:
K1 = 000110110000001011101111111111000111000001110010
L1 = R0 = 00000000000000000110110000000100
R1 = L0 + f (R0, K1) = ?
K1 = 000110110000001011101111111111000111000001110010
E (R0) = 000000000000000000000000001101011000000000001000
K1 + E (R0) = 000110110000001011101111110010011111000001111010
where Si(Bi) refers to the output of the i th S box (given in the hand out).
The first and the last digit (in decimal) represent the row in the S table.
The middle four digit (in decimal) represents the column in the S table.
The final stage in the calculation of f is to do a permutation P table (given in the hand out) of the
S-box output to obtain the final value of f :
f = P(S1(B1)S2(B2)...S8(B8))
f = 00110011000100110100100001010011
R1 = L0 + f
In the next round, we will have L2 = R1, which is the block we just calculated, and then
we must calculate R2 =L1 + f(R1, K2), and so on for 16 rounds.
For n = 2:
f = P(S1(B1)S2(B2)...S8(B8))
R2 = L1 + f
f = P(S1(B1)S2(B2)...S8(B8))
R3 = L2 + f
f = P(S1(B1)S2(B2)...S8(B8))
R4 = L3 + f
E (R4) =
f = P(S1(B1)S2(B2)...S8(B8))
R5 = L4 + f
f = P (S1(B1)S2(B2)...S8(B8))
R6 = L5 + f
f = P (S1(B1)S2(B2)...S8(B8))
R7 = L6 + f
f = P (S1(B1)S2(B2)...S8(B8))
R8 = L7 + f
f = P (S1(B1)S2(B2)...S8(B8))
R9 = L8 + f
K10 + E (R9) = 111111 100010 011110 110010 111010 100110 110100 010110
f = P (S1(B1)S2(B2)...S8(B8))
R10 = L9 + f
L11 = R10 = 0111 1010 0111 1010 1101 1101 1010 0001
K11 + E (R10) = 100111 100001 110000 100110 101100 010110 111010 000100
f = P (S1(B1)S2(B2)...S8(B8))
R11 = L10 + f
L12 = R11 = 1011 0000 1000 0110 1110 0010 1111 0000
K12 + E (R11) = 001011 110110 010111 111000 111001 000011 000001 001000
f = P (S1(B1)S2(B2)...S8(B8))
R12 = L11 + f
L13 = R12 = 1010 1001 0100 1001 1110 1110 0001 1100
K13 + E (R12) = 110000 101110 111110 000010 000011 110111 101010 111000
f = P (S1(B1)S2(B2)...S8(B8))
R13 = L12 + f
L14 = R13 = 0001 1111 0010 0101 0001 1100 0001 1110
K14 + E (R13) = 010100 001010 101010 111101 011111 010110 011111 000110
f = P (S1(B1)S2(B2)...S8(B8))
R14 = L13 + f
L15 = R14 = 1110 1101 0001 0100 0010 1001 1011 0000
K15 + E (R14) = 110010 100011 100100 100101 001010 000000 001010 101011
f = P (S1(B1)S2(B2)...S8(B8))
R15 = L14 + f
L16 = R15 = 0000 0110 1010 1110 1001 1100 1001 0110
K16 + E (R15) = 110010 111110 100011 010110 010000 011000 001101 011001
f = P (S1(B1)S2(B2)...S8(B8))
R16 = L15 + f
R16L16 = 0011 1110 1011 1100 1111 1000 1010 1100 0000 0110 1010 1110 1001 1100 1001 0110
IP-1 = 0000 0000 1110 0010 1111 1011 0111 1101 0101 1110 0111 0101 0000 0100 0011 1111
C = 00E2FB7D5E75043F
This is the encrypted form of M =DANIEL TE (The first 64 bit of my full name: DANIEL
TEFERA).