0% found this document useful (0 votes)
51 views22 pages

Daniel Tefera

The document describes encrypting a name using DES encryption. It provides the plain text, encryption process including key generation, subkey generation, encryption rounds, and ciphertext. The encryption is done on the first 64 bits of the name 'DANIEL TEFERA'.

Uploaded by

yoseftefera40
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
51 views22 pages

Daniel Tefera

The document describes encrypting a name using DES encryption. It provides the plain text, encryption process including key generation, subkey generation, encryption rounds, and ciphertext. The encryption is done on the first 64 bits of the name 'DANIEL TEFERA'.

Uploaded by

yoseftefera40
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 22

WOLDIA UNIVERSITY

FACULTY OF TECHNOLOGY
DEPARTMENT OF COMPUTER SCIENCE

Computer Security Individual Assignment on


Cryptography and Encryption Techniques:
Encrypting my name (the first 64 bit only) using DES
Encryption Techniques.
Name: DANIEL TEFERA
ID: 1699/08
Section: One

Submitted to: Instructor Sebahadin Nasir (MSc)


May 20, 2019
Woldia, Ethiopia
Plain Text (M) = DANIEL TEFERA (the first 64 bit)

Cipher Text =?

Binary Version of plain text (M) = 010001000100000101001110010010010100010101001100


0000100101010100

L = 01000100010000010100111001001001

R = 01000101010011000000100101010100

K = 133457799BBCDFF1

K(binary) = 0001001100110100010101110111100110011011101111001101111111110001

Step 1: Create 16 sub keys, each of which is 48-bits long.


The 64-bit key K is permuted according to PC-1(given in the Hand out).

Here we get the 56-bit permutation.

K+ = 1111000 0110011 0010101 0101111 0101010 1011001 1001111 0001111

Next, split this key into left and right halves, C0 and D0, where each half has 28 bits.

C0 = 1111000 0110011 0010101 0101111


D0 = 0101010 1011001 1001111 0001111

 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

K1 = 000110 110000 001011 101111 111111 000111 000001 110010

For the other keys we have

K2 = 011110 011010 111011 011001 110110 111100 100111 100101


K3 = 010101 011111 110010 001010 010000 101100 111110 011001
K4 = 011100 101010 110111 010110 110110 110011 010100 011101
K5 = 011111 001110 110000 000111 111010 110101 001110 101000

K6 = 011000 111010 010100 111110 010100 000111 101100 101111


K7 = 111011 001000 010010 110111 111101 100001 100010 111100
K8 = 111101 111000 101000 111010 110000 010011 101111 111011

K9 = 111000 001101 101111 101011 111011 011110 011110 000001

K10 = 101100 011111 001101 000111 101110 100100 011001 001111


K11 = 001000 010101 111111 010011 110111 101101 001110 000110
K12 = 011101 010111 000111 110101 100101 000110 011111 101001
K13 = 100101 111100 010111 010001 111110 101011 101001 000001
K14 = 010111 110100 001110 110111 111100 101110 011100 111010
K15 = 101111 111001 000110 001101 001111 010011 111100 001010
K16 = 110010 110011 110110 001011 000011 100001 011111 110101

So much for the sub keys.

Now we look at the message (DANIEL TEFERA (the first 64 bit)) itself.

Step 2: Encode each 64-bit block of data.


There is an initial permutation IP of the 64 bits of the message data DANIEL TEFERA (the first
64 bit).

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.

Then for n going from 1 to 16 we calculate Ln = Rn-1


Rn = Ln-1 + f (Rn-1,Kn) This results in a final block, for n = 16, of L16R16. That is, in each
iteration, we take the right 32 bits of the previous result and make them the left 32 bits of the
current step. For the right 32 bits in the current step, we XOR the left 32 bits of the previous step
with the calculation f .

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

Kn + E(Rn-1) =B1B2B3B4B5B6B7B8, where each Bi is a group of six bits.

We now calculate S1(B1)S2(B2)S3(B3)S4(B4)S5(B5)S6(B6)S7(B7)S8(B8)

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.

B1 = 000110, row = 00 = 0, column = 0011 = 3, S1 (B1) = 1

B2 = 110000, row = 10 = 2, column = 1000 = 8, S2 (B2) = 5

B3 = 001011, row = 01 = 1, column = 0101 = 5, S3 (B3) = 4

B4 = 101111, row = 11 = 3, column = 0111 = 7, S4 (B4) = 8

B5 = 110010, row = 10 = 2, column = 1001 = 9, S5 (B5) = 9

B6 = 011111, row = 01 = 1, column = 1111 = 15, S6 (B6) = 8

B7 = 000001, row = 01 = 1, column = 0000 = 0, S7 (B7) = 13

B8 = 111010, row = 10 = 2, column = 1101 = 13, S8 (B8) = 3

S1(B1)S2(B2)S3(B3)S4(B4)S5(B5)S6(B6)S7(B7)S8(B8) = 1 5 4 8 9 8 13 3 (in Hexa Decimal) =


00010101010010001001100011010011 (in binary)

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

L0 = 1011 1111 1000 0000 1011 0101 0101 1010

f = 0011 0011 0001 0011 0100 1000 0101 0011

R1 = 1000 1100 1001 0011 1111 1101 0000 1001

 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:

L2 = R1 = 1000 1100 1001 0011 1111 1101 0000 1001

K2 = 011110 011010 111011 011001 110110 111100 100111 100101

R2 =L1 + f (R1, K2) = ?

K2 = 011110 011010 111011 011001 110110 111100 100111 100101

E (R1) = 110001 011001 010010 100111 111111 111010 100001 010011

K2 + E (R1) = 101111 000011 101001 111110 001001 000110 000110 110110

B1 = 101111, row = 11 = 3, column = 0111= 7, S1 (B1) = 7

B2 = 000011, row = 01 = 1, column = 0001= 1, S2 (B2) = 13

B3 = 101001, row = 11 = 3, column = 0100= 4, S3 (B3) = 6

B4 = 111110, row = 10 = 2, column = 1111= 15, S4 (B4) = 4

B5 = 001001, row = 01 = 1, column = 0100= 4, S5 (B5) = 4

B6 = 000110, row = 00 = 0, column = 0011= 3, S6 (B6) = 15

B7 = 000110, row = 00 = 0, column = 0011= 3, S7 (B7) = 14

B8 = 110110, row = 10 = 2, column = 1011= 3, S8 (B8) = 14

S1(B1)S2(B2)S3(B3)S4(B4)S5(B5)S6(B6)S7(B7)S8(B8) = 7 13 6 4 4 15 14 14 (in Hexa Decimal)


= 0111 1101 0110 0100 0100 1111 1110 1110 (in Binary).

f = P(S1(B1)S2(B2)...S8(B8))

f = 0001 1000 0011 1111 1111 0110 0011 1111

 R2 = L1 + f

L1 = 0000 0000 0000 0000 0110 1100 0000 0100

f = 0001 1000 0011 1111 1111 0110 0011 1111

R2 = 0001 1000 0011 1111 1001 1010 0011 1011


For n = 3:

L3 = R2 = 0001 1000 0011 1111 1001 1010 0011 1011

K3 = 010101 011111 110010 001010 010000 101100 111110 011001

R3 =L2 + f (R2, K3) = ?

K3 = 010101 011111 110010 001010 010000 101100 111110 011001

E (R2) = 100011 110000 000111 111111 110011 110100 000111 110110

K3 + E (R2) = 110110 101111 110101 110101 100011 011000 111001 101111

B1 = 110110, row = 10 = 2, column = 1011= 11, S1 (B1) = 7

B2 = 101111, row = 11 = 3, column = 0111= 7, S2 (B2) = 2

B3 = 110101, row = 11 = 3, column = 1010= 10, S3 (B3) = 14

B4 = 110101, row = 11 = 3, column = 1010= 10, S4 (B4) = 5

B5 = 100011, row = 11 = 3, column = 0001= 1, S5 (B5) = 8

B6 = 011000, row = 00 = 0, column = 1100= 12, S6 (B6) = 14

B7 = 111001, row = 11 = 3, column = 1100= 12, S7 (B7) = 14

B8 = 101111, row = 11 = 3, column = 0111= 7, S8 (B8) = 13

S1(B1)S2(B2)S3(B3)S4(B4)S5(B5)S6(B6)S7(B7)S8(B8) = 7 2 14 5 8 14 14 13 (in Hexa Decimal)


= 0111 0010 1110 0101 1000 1110 1110 1101 (in Binary).

f = P(S1(B1)S2(B2)...S8(B8))

f = 1101 1001 0011 0001 1001 1111 0010 1111

 R3 = L2 + f

L2 = 1000 1100 1001 0011 1111 1101 0000 1001

f = 1101 1001 0011 0001 1001 1111 0010 1111

R3 = 0101 0101 1010 0010 0110 0010 0010 0110


For n = 4:

L4 = R3 = 0101 0101 1010 0010 0110 0010 0010 0110

K4 = 011100 101010 110111 010110 110110 110011 010100 011101

R4 =L3 + f (R3, K4) = ?

K4 = 011100 101010 110111 010110 110110 110011 010100 011101

E (R3) = 001010 101011 110100 000100 001100 000100 000100 001100

K4 + E (R3) = 010110 000001 000011 010010 111010 110111 010000 010001

B1 = 010110, row = 00 = 0, column = 1011= 11, S1 (B1) = 12

B2 = 000001, row = 01 = 1, column = 0000= 0, S2 (B2) = 3

B3 = 000011, row = 01 = 1, column = 0001= 1, S3 (B3) = 7

B4 = 010010, row = 00 = 0, column = 1001= 9, S4 (B4) = 2

B5 = 111010, row = 10 = 2, column = 1101= 13, S5 (B5) = 6

B6 = 110111, row = 11 = 3, column = 1011= 11, S6 (B6) = 7

B7 = 010000, row = 00 = 0, column = 1000= 8, S7 (B7) = 3

B8 = 010001, row = 01 = 1, column = 1000= 8, S8 (B8) = 12

S1(B1)S2(B2)S3(B3)S4(B4)S5(B5)S6(B6)S7(B7)S8(B8) = 12 3 7 2 6 7 3 12 (in Hexa Decimal) =


1100 0011 0111 0010 0110 0111 0011 1100 (in Binary).

f = P(S1(B1)S2(B2)...S8(B8))

f = 0100 1110 1110 0101 1110 0100 1010 1100

 R4 = L3 + f

L3 = 0001 1000 0011 1111 1001 1010 0011 1011

f = 0100 1110 1110 0101 1110 0100 1010 1100

R4 = 0101 0110 1101 1010 0111 1110 1001 0111


For n = 5:

L5 = R4 = 0101 0110 1101 1010 0111 1110 1001 0111

K5 = 011111 001110 110000 000111 111010 110101 001110 101000

R5 =L4 + f (R4, K5) = ?

K5 = 011111 001110 110000 000111 111010 110101 001110 101000

E (R4) =

K5 + E (R4) = 101010 101101 011011 110100 001111 111101 010010 101110

B1 = 101010, row = 10 = 2, column = 0101= 5, S1 (B1) = 6

B2 = 101101, row = 11 = 3, column = 0110= 6, S2 (B2) = 4

B3 = 011011, row = 01 = 1, column = 1101= 13, S3 (B3) = 11

B4 = 110100, row = 10 = 0, column = 1010= 10, S4 (B4) = 8

B5 = 001111, row = 01 = 1, column = 0111= 7, S5 (B5) = 1

B6 = 111101, row = 11 = 3, column = 1110= 14, S6 (B6) = 8

B7 = 010010, row = 00 = 0, column = 1001= 9, S7 (B7) = 12

B8 = 101110, row = 10 = 2, column = 0111= 7, S8 (B8) = 2

S1(B1)S2(B2)S3(B3)S4(B4)S5(B5)S6(B6)S7(B7)S8(B8) = 6 4 11 8 1 8 12 2 (in Hexa Decimal) =


0110 0100 1011 1000 0001 1000 1100 0010 (in Binary).

f = P(S1(B1)S2(B2)...S8(B8))

f = 0011 0100 0001 0010 1000 0011 0101 0101

 R5 = L4 + f

L4 = 0101 0101 1010 0010 0110 0010 0010 0110

f = 0011 0100 0001 0010 1000 0011 0101 0101

R5 = 0110 0001 1011 0000 1110 0001 0111 0011


For n = 6:

L6 = R5 = 0110 0001 1011 0000 1110 0001 0111 0011

K6 = 011000 111010 010100 111110 010100 000111 101100 101111

R6 =L5 + f (R5, K6) = ?

K6 = 011000 111010 010100 111110 010100 000111 101100 101111

E (R5) = 101100 000011 110110 100001 011100 000010 101110 100110

K6 + E (R5) = 110100 111001 100010 011111 001000 000101 000010 001001

B1 = 110100, row = 10 = 2, column = 1010= 10, S1 (B1) = 9

B2 = 111001, row = 11 = 3, column = 1100= 12, S2 (B2) = 0

B3 = 100010, row = 10 = 2, column = 0001= 1, S3 (B3) = 6

B4 = 011111, row = 01 = 1, column = 1111= 15, S4 (B4) = 9

B5 = 001000, row = 00 = 0, column = 0100= 4, S5 (B5) = 7

B6 = 000101, row = 01 = 1, column = 0010= 2, S6 (B6) = 4

B7 = 000010, row = 00 = 0, column = 0001= 1, S7 (B7) = 11

B8 = 001001, row = 01 = 1, column = 0100= 4, S8 (B8) = 10

S1(B1)S2(B2)S3(B3)S4(B4)S5(B5)S6(B6)S7(B7)S8(B8) = 9 0 6 9 7 4 11 10 (in Hexa Decimal) =


1001 0000 0110 1001 0111 0100 1011 1010 (in Binary).

f = P (S1(B1)S2(B2)...S8(B8))

f = 1010 1010 1000 0111 0000 0100 1100 1111

R6 = L5 + f

L5 = 0101 0110 1101 1010 0111 1110 1001 0111

f = 1010 1010 1000 0111 0000 0100 1100 1111

R6 = 1111 1100 0101 1101 0111 1010 0101 1000


For n = 7:

L7 = R6 = 1111 1100 0101 1101 0111 1010 0101 1000

K7 = 111011 001000 010010 110111 111101 100001 100010 111100

R7 =L6 + f (R6, K7) = ?

K7 = 111011 001000 010010 110111 111101 100001 100010 111100

E (R6) = 011111 111000 001011 111010 101111 110100 001011 110001

K7 + E (R6) = 100100 110000 011001 001101 010010 010101 101001 001101

B1 = 100100, row = 10 = 2, column = 0010= 2, S1 (B1) = 14

B2 = 110000, row = 10 = 2, column = 1000= 8, S2 (B2) = 5

B3 = 011001, row = 01 = 1, column = 1100= 12, S3 (B3) = 12

B4 = 001101, row = 01 = 1, column = 0110= 6, S4 (B4) = 0

B5 = 010010, row = 00 = 0, column = 1001= 9, S5 (B5) = 5

B6 = 010101, row = 01 = 1, column = 1010= 10, S6 (B6) = 13

B7 = 101001, row = 11 = 3, column = 0100= 4, S7 (B7) = 1

B8 = 001101, row = 01 = 1, column = 0110= 6, S8 (B8) = 7

S1(B1)S2(B2)S3(B3)S4(B4)S5(B5)S6(B6)S7(B7)S8(B8) = 14 5 12 0 5 13 1 7 (in Hexa Decimal)


= 1110 0101 1100 0000 0101 1101 0001 0111 (in Binary).

f = P (S1(B1)S2(B2)...S8(B8))

f = 0011 0010 1000 0111 1110 1011 0011 1000

R7 = L6 + f

L6 = 0110 0001 1011 0000 1110 0001 0111 0011

f = 0011 0010 1000 0111 1110 1011 0011 1000

R7 = 0101 0011 0011 0111 0000 1010 0100 1011


For n = 8:

L8 = R7 = 0101 0011 0011 0111 0000 1010 0100 1011

K8 = 111101 111000 101000 111010 110000 010011 101111 111011

R8 =L7 + f (R7, K8) = ?

K8 = 111101 111000 101000 111010 110000 010011 101111 111011

E (R7) = 101010 100110 100110 101110 100001 010100 001001 010110

K8 + E (R7) = 010111 011110 001110 010100 010001 000111 100110 101101

B1 = 010111, row = 01 = 1, column = 1011= 11, S1 (B1) = 11

B2 = 011110, row = 00 = 0, column = 1111= 15, S2 (B2) = 10

B3 = 001110, row = 00 = 0, column = 0111= 7, S3 (B3) = 5

B4 = 010100 , row = 00 = 0, column = 1010= 10, S4 (B4) = 8

B5 = 010001, row = 01 = 1, column = 1000= 8, S5 (B5) = 5

B6 = 000111, row = 01 = 1, column = 0011= 3, S6 (B6) = 2

B7 = 100110, row = 10 = 2, column = 0011= 3, S7 (B7) = 13

B8 = 101101, row = 11 = 3, column = 0110= 6, S8 (B8) = 8

S1(B1)S2(B2)S3(B3)S4(B4)S5(B5)S6(B6)S7(B7)S8(B8) = 11 10 5 8 5 2 13 8 (in Hexa Decimal)


= 1011 1010 0101 1000 0101 0010 1101 1000 (in Binary).

f = P (S1(B1)S2(B2)...S8(B8))

f = 0110 1110 1011 1101 0000 0010 0100 0011

R8 = L7 + f

L7 = 1111 1100 0101 1101 0111 1010 0101 1000

f = 0110 1110 1011 1101 0000 0010 0100 0011

R8 = 1001 0010 1110 0000 0111 1000 0001 1011


For n = 9:

L9 = R8 = 1001 0010 1110 0000 0111 1000 0001 1011

K9 = 111000 001101 101111 101011 111011 011110 011110 000001

R9 =L8 + f (R8, K9) = ?

K9 = 111000 001101 101111 101011 111011 011110 011110 000001

E (R8) = 110010 100101 011100 000000 001111 110000 000011 110111

K9 + E (R8) = 001010 101000 110011 101011 110100 101110 011101 110110

B1 = 001010, row = 00 = 0, column = 0101= 5, S1 (B1) = 15

B2 = 101000, row = 10 = 2, column = 0100= 4, S2 (B2) = 10

B3 = 110011, row = 11 = 3, column = 1001= 9, S3 (B3) = 15

B4 = 101011 , row = 11 = 3, column = 0101= 5, S4 (B4) = 1

B5 = 110100, row = 10 = 2, column = 1010= 10, S5 (B5) = 12

B6 = 101110, row = 10 = 2, column = 0111= 7, S6 (B6) = 3

B7 = 011101, row = 01 = 1, column = 1110= 14, S7 (B7) = 8

B8 = 110110, row = 10 = 2, column = 1011= 11, S8 (B8) = 13

S1(B1)S2(B2)S3(B3)S4(B4)S5(B5)S6(B6)S7(B7)S8(B8) = 15 10 15 1 12 3 8 13(in Hexa Decimal)


= 1111 1010 1111 0001 1100 0011 1000 1101 (in Binary).

f = P (S1(B1)S2(B2)...S8(B8))

f = 1100 1101 1010 1101 1010 1011 0010 0111

R9 = L8 + f

L8 = 0101 0011 0011 0111 0000 1010 0100 1011

f = 1100 1101 1010 1101 1010 1011 0010 0111

R9 = 1001 1110 1001 1010 1010 0001 0110 1100


For n = 10:

L10 = R9 = 1001 1110 1001 1010 1010 0001 0110 1100

K10 = 101100 011111 001101 000111 101110 100100 011001 001111

R10 =L9 + f (R9, K10) = ?

K10 = 101100 011111 001101 000111 101110 100100 011001 001111

E (R9) = 010011 111101 010011 110101 010100 000010 101101 011001

K10 + E (R9) = 111111 100010 011110 110010 111010 100110 110100 010110

B1 = 111111, row = 11 = 3, column = 1111= 15, S1 (B1) = 13

B2 = 100010, row = 10 = 2, column = 0001= 1, S2 (B2) = 14

B3 = 011110, row = 00 = 0, column = 1111= 15, S3 (B3) = 8

B4 = 110010, row = 10 = 2, column = 1001= 9, S4 (B4) = 1

B5 = 111010, row = 10 = 2, column = 1101= 13, S5 (B5) = 3

B6 = 100110, row = 10 = 2, column = 0011= 3, S6 (B6) = 5

B7 = 110100, row = 10 = 2, column = 1010= 10, S7 (B7) = 6

B8 = 010110, row = 00 = 0, column = 1011= 11, S8 (B8) = 14

S1(B1)S2(B2)S3(B3)S4(B4)S5(B5)S6(B6)S7(B7)S8(B8) = 13 14 8 1 3 5 6 14(in Hexa Decimal) =


1101 1110 1000 0001 0011 0101 0110 1110 (in Binary).

f = P (S1(B1)S2(B2)...S8(B8))

f = 1110 1000 1001 1010 1010 0101 1011 1010

R10 = L9 + f

L9 = 1001 0010 1110 0000 0111 1000 0001 1011

f = 1110 1000 1001 1010 1010 0101 1011 1010

R10 = 0111 1010 0111 1010 1101 1101 1010 0001


For n = 11:

L11 = R10 = 0111 1010 0111 1010 1101 1101 1010 0001

K11 = 001000 010101 111111 010011 110111 101101 001110 000110

R11 =L10 + f (R10, K11) = ?

K11 = 001000 010101 111111 010011 110111 101101 001110 000110

E (R10) = 101111 110100 001111 110101 011011 111011 110100 000010

K11 + E (R10) = 100111 100001 110000 100110 101100 010110 111010 000100

B1 = 100111, row = 11 = 3, column = 0011= 3, S1 (B1) = 2

B2 = 100001, row = 11 = 3, column = 0000= 0, S2 (B2) = 13

B3 = 110000, row = 10 = 2, column = 1000= 8, S3 (B3) = 11

B4 = 100110, row = 10 = 2, column = 0011= 3, S4 (B4) = 0

B5 = 101100, row = 10 = 2, column = 0110= 6, S5 (B5) = 7

B6 = 010110, row = 00 = 0, column = 1011= 11, S6 (B6) = 4

B7 = 111010, row = 10 = 2, column = 1101= 13, S7 (B7) = 5

B8 = 000100, row = 00 = 0, column = 0010= 2, S8 (B8) = 8

S1(B1)S2(B2)S3(B3)S4(B4)S5(B5)S6(B6)S7(B7)S8(B8) = 2 13 11 0 7 4 5 8(in Hexa Decimal) =


0010 1101 1011 0000 0111 0100 0101 1000 (in Binary).

f = P (S1(B1)S2(B2)...S8(B8))

f = 0010 1110 0001 1100 0100 0011 1001 1100

R11 = L10 + f

L10 = 1001 1110 1001 1010 1010 0001 0110 1100

f = 0010 1110 0001 1100 0100 0011 1001 1100

R11 = 1011 0000 1000 0110 1110 0010 1111 0000


For n = 12:

L12 = R11 = 1011 0000 1000 0110 1110 0010 1111 0000

K12 = 011101 010111 000111 110101 100101 000110 011111 101001

R12 =L11 + f (R11, K12) = ?

K12 = 011101 010111 000111 110101 100101 000110 011111 101001

E (R11) = 010110 100001 010000 001101 011100 000101 011110 100001

K12 + E (R11) = 001011 110110 010111 111000 111001 000011 000001 001000

B1 = 001011, row = 01 = 1, column = 0101= 5, S1 (B1) = 2

B2 = 110110, row = 10 = 2, column = 1011= 11, S2 (B2) = 6

B3 = 010111, row = 01 = 1, column = 1011= 11, S3 (B3) = 14

B4 = 111000, row = 10 = 2, column = 1100= 12, S4 (B4) = 5

B5 = 111001, row = 11 = 3, column = 1100= 12, S5 (B5) = 10

B6 = 000011, row = 01 = 1, column = 0001= 1, S6 (B6) = 15

B7 = 000001, row = 01 = 1, column = 0000= 0, S7 (B7) = 13

B8 = 001000, row = 00 = 0, column = 0100= 4, S8 (B8) = 6

S1(B1)S2(B2)S3(B3)S4(B4)S5(B5)S6(B6)S7(B7)S8(B8) = 2 6 14 5 10 15 13 6(in Hexa Decimal)


= 0010 0110 1110 0101 1010 1111 1101 0110 (in Binary).

f = P (S1(B1)S2(B2)...S8(B8))

f = 1101 0011 0011 0011 0011 0011 1011 1101

R12 = L11 + f

L11 = 0111 1010 0111 1010 1101 1101 1010 0001

f = 1101 0011 0011 0011 0011 0011 1011 1101

R12 = 1010 1001 0100 1001 1110 1110 0001 1100


For n = 13:

L13 = R12 = 1010 1001 0100 1001 1110 1110 0001 1100

K13 = 100101 111100 010111 010001 111110 101011 101001 000001

R13 =L12 + f (R12, K13) = ?

K13 = 100101 111100 010111 010001 111110 101011 101001 000001

E (R12) = 010101 010010 101001 010011 111101 011100 000011 111001

K13 + E (R12) = 110000 101110 111110 000010 000011 110111 101010 111000

B1 = 110000, row = 10 = 2, column = 1000= 8, S1 (B1) = 15

B2 = 101110, row = 10 = 2, column = 0111= 7, S2 (B2) = 1

B3 = 111110, row = 10 = 2, column = 1111= 15, S3 (B3) = 7

B4 = 000010, row = 00 = 0, column = 0001= 1, S4 (B4) = 13

B5 = 000011, row = 01 = 1, column = 0001= 1, S5 (B5) = 11

B6 = 110111, row = 11 = 3, column = 1011= 11, S6 (B6) = 7

B7 = 101010, row = 10 = 2, column = 0101= 5, S7 (B7) = 3

B8 = 111000, row = 10 = 2, column = 1100= 12, S8 (B8) = 15

S1(B1)S2(B2)S3(B3)S4(B4)S5(B5)S6(B6)S7(B7)S8(B8) = 15 1 7 13 11 7 3 15(in Hexa Decimal)


= 1111 0001 0111 1101 1011 0111 0011 1111 (in Binary).

f = P (S1(B1)S2(B2)...S8(B8))

f = 1010 1111 1010 0011 1111 1110 1110 1110

R13 = L12 + f

L12 = 1011 0000 1000 0110 1110 0010 1111 0000

f = 1010 1111 1010 0011 1111 1110 1110 1110

R13 = 0001 1111 0010 0101 0001 1100 0001 1110


For n = 14:

L14 = R13 = 0001 1111 0010 0101 0001 1100 0001 1110

K14 = 010111 110100 001110 110111 111100 101110 011100 111010

R14 =L13 + f (R13, K14) =?

K14 = 010111 110100 001110 110111 111100 101110 011100 111010

E (R13) = 000011 111110 100100 001010 100011 111000 000011 111100

K14 + E (R13) = 010100 001010 101010 111101 011111 010110 011111 000110

B1 = 010100, row = 00 = 0, column = 1010= 10, S1 (B1) = 6

B2 = 001010, row = 00 = 0, column = 0101= 5, S2 (B2) = 11

B3 = 101010, row = 10 = 2, column = 0101= 5, S3 (B3) = 15

B4 = 111101, row = 11 = 3, column = 1110= 14, S4 (B4) = 2

B5 = 011111, row = 01 = 1, column = 1111= 15, S5 (B5) = 6

B6 = 010110, row = 00 = 0, column = 1011= 11, S6 (B6) = 4

B7 = 011111, row = 01 = 1, column = 1111= 15, S7 (B7) = 6

B8 = 000110, row = 00 = 0, column = 0011= 3, S8 (B8) = 4

S1(B1)S2(B2)S3(B3)S4(B4)S5(B5)S6(B6)S7(B7)S8(B8) = 6 11 15 2 6 4 6 4 (in Hexa Decimal) =


0110 1011 1111 0010 0110 0100 0110 0100 (in Binary).

f = P (S1(B1)S2(B2)...S8(B8))

f = 0100 0100 0101 1101 1100 0111 1010 1100

R14 = L13 + f

L13 = 1010 1001 0100 1001 1110 1110 0001 1100

f = 0100 0100 0101 1101 1100 0111 1010 1100

R14 = 1110 1101 0001 0100 0010 1001 1011 0000


For n = 15:

L15 = R14 = 1110 1101 0001 0100 0010 1001 1011 0000

K15 = 101111 111001 000110 001101 001111 010011 111100 001010

R15 =L14 + f (R14, K15) =?

K15 = 101111 111001 000110 001101 001111 010011 111100 001010

E (R14) = 011101 011010 100010 101000 000101 010011 110110 100001

K15 + E (R14) = 110010 100011 100100 100101 001010 000000 001010 101011

B1 = 110010, row = 10 = 2, column = 1001= 9, S1 (B1) = 12

B2 = 100011, row = 11 = 3, column = 0001= 1, S2 (B2) = 8

B3 = 100100, row = 10 = 2, column = 0010= 2, S3 (B3) = 4

B4 = 100101, row = 11 = 3, column = 0010= 2, S4 (B4) = 0

B5 = 001010, row = 00 = 0, column = 0101= 5, S5 (B5) = 10

B6 = 000000, row = 00 = 0, column = 0000= 0, S6 (B6) = 12

B7 = 001010, row = 00 = 0, column = 0101= 5, S7 (B7) = 0

B8 = 101011, row = 11 = 3, column = 0101= 5, S8 (B8) = 10

S1(B1)S2(B2)S3(B3)S4(B4)S5(B5)S6(B6)S7(B7)S8(B8) = 12 8 4 0 10 12 0 10 (in Hexa Decimal)


= 1100 1000 0100 0000 1010 1100 0000 1010 (in Binary).

f = P (S1(B1)S2(B2)...S8(B8))

f = 0001 1001 1000 1011 1000 0000 1000 1000

R15 = L14 + f

L14 = 0001 1111 0010 0101 0001 1100 0001 1110

f = 0001 1001 1000 1011 1000 0000 1000 1000

R15 = 0000 0110 1010 1110 1001 1100 1001 0110


For n = 16:

L16 = R15 = 0000 0110 1010 1110 1001 1100 1001 0110

K16 = 110010 110011 110110 001011 000011 100001 011111 110101

R16 =L15 + f (R15, K16) =?

K16 = 110010 110011 110110 001011 000011 100001 011111 110101

E (R15) = 000000 001101 010101 011101 010011 111001 010010 101100

K16 + E (R15) = 110010 111110 100011 010110 010000 011000 001101 011001

B1 = 110010, row = 10 = 2, column = 1001= 9, S1 (B1) = 12

B2 = 111110, row = 10 = 2, column = 1111= 15, S2 (B2) = 15

B3 = 100011, row = 11 = 3, column = 0001= 1, S3 (B3) = 10

B4 = 010110, row = 00 = 0, column = 1011= 11, S4 (B4) = 5

B5 = 010000, row = 00 = 0, column = 1000= 8, S5 (B5) = 8

B6 = 011000, row = 00 = 0, column = 1100= 12, S6 (B6) = 14

B7 = 001101, row = 01 = 1, column = 0110= 6, S7 (B7) = 1

B8 = 011001, row = 01 = 1, column = 1100= 12, S8 (B8) = 0

S1(B1)S2(B2)S3(B3)S4(B4)S5(B5)S6(B6)S7(B7)S8(B8) = 12 15 10 5 8 14 1 0 (in Hexa Decimal)


= 1100 1111 1010 0101 1000 1110 0001 0000 (in Binary).

f = P (S1(B1)S2(B2)...S8(B8))

f = 1101 0011 1010 1000 1101 0001 0001 1100

R16 = L15 + f

L15 = 1110 1101 0001 0100 0010 1001 1011 0000

f = 1101 0011 1010 1000 1101 0001 0001 1100

R16 = 0011 1110 1011 1100 1111 1000 1010 1100


We then reverse the order of the two blocks into the 64-bit block R16L16 and apply a final
permutation IP-1 (given in the hand out):

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

BOOM!! BOOM!! BOOM!! BOOM!! BOOM!! BOOM!! BOOM!! BOOM!!

Which is in hexadecimal format is 00E2FB7D5E75043F

C = 00E2FB7D5E75043F
This is the encrypted form of M =DANIEL TE (The first 64 bit of my full name: DANIEL
TEFERA).

You might also like