Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Assignment No 2 Complete

Download as pdf or txt
Download as pdf or txt
You are on page 1of 35

ASSIGNMENT No.

2
Advance Cryptography
QASIM ALI, PhD(IS)

The goal of this assignment is to prove that in DES Encryption if double encryption is applied on a text using
weak key pairs the resulting cipher text is the original plain text i.e. EK2(EK1(x) )= x.
There are six weak key pairs which are as under:-

I have solved the assignment by developing a DES encryption program encrypting the plain text twice with weak
key pairs.

Screen shot of the input screen is below:

Figure 1: Input Screen

Figure 2: Input Details

Figure 3: Figure 2: Output verified.

The output at all the steps is displayed from page 4. The program output is shown with

Plain text:
Key 1:
Key 2:

123456ABCD132536
01E0 01E0 01F1 01F1
E001 E001 F101 F101

But the program can generate results with any weak key pair and plain text. The results are stored in a file.

DES WEAK KEY ANALYSIS REPORT


****************************
Plain Text in HEXADECIMAL IS: 123456ABCD132536
Plain Text in Binary IS: 0001001000110100010101101010101111001101000100110010010100110110
First Weak Key USED in HEXADECIMAL IS: 01E001E001F101F1
Second Weak Key USED in HEXADECIMAL IS: E001E001F101F101

FIRST DES KEY ENCRYPTION


************************
Key USED in BINARY IS: 0000000111100000000000011110000000000001111100010000000111110001
Key USED in HEXADECIMAL IS: 01E001E001F101F1

Plain Text in BINARY IS: 0001001000110100010101101010101111001101000100110010010100110110


Plain Text in HEXADECIMAL IS: 123456ABCD132536

KEY GENERATION
**************
KEY REDUCED FROM 64 bits to 56 bits: 10101010101010101010101010100000000000000000000000000000(AAAAAAA0000000)

ROUND 1 KEY

Shift Left Key: 0101010101010101010101010101(5555555)


Shift right Key: 0101010101010101010101010101(0000000)
48 bits Key for round 1: 100100010101001111100101000000000000000000000000(9153E5000000)

ROUND 2 KEY

Shift Left Key: 1010101010101010101010101010(AAAAAAA)


Shift right Key: 1010101010101010101010101010(0000000)
48 bits Key for round 2: 011011101010110000011010000000000000000000000000(6EAC1A000000)

ROUND 3 KEY

Shift Left Key: 1010101010101010101010101010(AAAAAAA)


Shift right Key: 1010101010101010101010101010(0000000)
48 bits Key for round 2: 011011101010110000011010000000000000000000000000(6EAC1A000000)

ROUND 4 KEY

Shift Left Key: 1010101010101010101010101010(AAAAAAA)


Shift right Key: 1010101010101010101010101010(0000000)
48 bits Key for round 4: 011011101010110000011010000000000000000000000000(6EAC1A000000)

ROUND 5 KEY

Shift Left Key: 1010101010101010101010101010(AAAAAAA)


Shift right Key: 1010101010101010101010101010(0000000)
48 bits Key for round 5: 011011101010110000011010000000000000000000000000(6EAC1A000000)

ROUND 6 KEY

Shift Left Key: 1010101010101010101010101010(AAAAAAA)


Shift right Key: 1010101010101010101010101010(0000000)
48 bits Key for round 6: 011011101010110000011010000000000000000000000000(6EAC1A000000)

ROUND 7 KEY

Shift Left Key: 1010101010101010101010101010(AAAAAAA)


Shift right Key: 1010101010101010101010101010(0000000)
48 bits Key for round 7: 011011101010110000011010000000000000000000000000(6EAC1A000000)

ROUND 8 KEY

Shift Left Key: 1010101010101010101010101010(AAAAAAA)


Shift right Key: 1010101010101010101010101010(0000000)
48 bits Key for round 8: 011011101010110000011010000000000000000000000000(6EAC1A000000)

ROUND 9 KEY

Shift Left Key: 0101010101010101010101010101(5555555)


Shift right Key: 0101010101010101010101010101(0000000)

48 bits Key for round 9: 100100010101001111100101000000000000000000000000(9153E5000000)

ROUND 10 KEY

Shift Left Key: 0101010101010101010101010101(5555555)


Shift right Key: 0101010101010101010101010101(0000000)
48 bits Key for round 10: 100100010101001111100101000000000000000000000000(9153E5000000)

ROUND 11 KEY

Shift Left Key: 0101010101010101010101010101(5555555)


Shift right Key: 0101010101010101010101010101(0000000)
48 bits Key for round 11: 100100010101001111100101000000000000000000000000(9153E5000000)

ROUND 12 KEY

Shift Left Key: 0101010101010101010101010101(5555555)


Shift right Key: 0101010101010101010101010101(0000000)
48 bits Key for round 12: 100100010101001111100101000000000000000000000000(9153E5000000)

ROUND 13 KEY

Shift Left Key: 0101010101010101010101010101(5555555)


Shift right Key: 0101010101010101010101010101(0000000)
48 bits Key for round 13: 100100010101001111100101000000000000000000000000(9153E5000000)

ROUND 14 KEY

Shift Left Key: 0101010101010101010101010101(5555555)


Shift right Key: 0101010101010101010101010101(0000000)
48 bits Key for round 14: 100100010101001111100101000000000000000000000000(9153E5000000)

ROUND 15 KEY

Shift Left Key: 0101010101010101010101010101(5555555)


Shift right Key: 0101010101010101010101010101(0000000)
48 bits Key for round 15: 100100010101001111100101000000000000000000000000(9153E5000000)

ROUND 16 KEY

Shift Left Key: 1010101010101010101010101010(AAAAAAA)


Shift right Key: 1010101010101010101010101010(0000000)
48 bits Key for round 16: 011011101010110000011010000000000000000000000000(6EAC1A000000)

DES ENCRYPTION STARTS HERE


**************************

Intial Permuation String: 0001010010100111110101100111100000011000110010100001100010101101(14A7D67818CA18AD)

LEFT0 and RIGHT0 32 bits: 00010100101001111101011001111000, 00011000110010100001100010101101


LEFT0 and RIGHT0 32 bits: 14A7D678, 18CA18AD

FIESTEL ROUND NO 1
******************

EXPANSION TO 48 BITS: 100011110001011001010100000011110001010101011010(8F16540F155A)


RIGHT0 XOR with ROUNDKEY1 : 000111100100010110110001000011110001010101011010(1E45B10F155A)

SBOX SUBSTITUTION TO 32 bits: 01000111011110011011101101010000(4779BB50)


PERMUTATION: 11110111001100011110000011010100(F731E0D4)
LEFT XOR WITH RIGHT SIDE OPERATRION:11100011100101100011011010101100(E39636AC)

LEFT1 and RIGHT1 32 bits: 00011000110010100001100010101101, 11100011100101100011011010101100


LEFT1 and RIGHT1 32 bits: 18CA18AD, E39636AC

FIESTEL ROUND NO 2
******************

EXPANSION TO 48 BITS: 011100000111110010101100000110101101010101011001(707CAC1AD559)


RIGHT1 XOR with ROUNDKEY2 : 000111101101000010110110000110101101010101011001(1ED0B61AD559)
SBOX SUBSTITUTION TO 32 bits: 01000100000011100001111101010000(440E1F50)
PERMUTATION: 00110010011100001011000001011000(3270B058)
LEFT XOR WITH RIGHT SIDE OPERATRION:00101010101110101010100011110101(2ABAA8F5)

LEFT2 and RIGHT2 32 bits: 11100011100101100011011010101100, 00101010101110101010100011110101


LEFT2 and RIGHT2 32 bits: E39636AC, 2ABAA8F5

FIESTEL ROUND NO 3

******************

EXPANSION TO 48 BITS: 100101010101010111110101010101010001011110101010(9555F55517AA)


RIGHT2 XOR with ROUNDKEY3 : 111110111111100111101111010101010001011110101010(FBF9EF5517AA)
SBOX SUBSTITUTION TO 32 bits: 00001001000010001111011000011100(0908F61C)
PERMUTATION: 00101011001011000100000011101000(2B2C40E8)
LEFT XOR WITH RIGHT SIDE OPERATRION:11001000101110100111011001000100(C8BA7644)

LEFT3 and RIGHT3 32 bits: 00101010101110101010100011110101, 11001000101110100111011001000100


LEFT3 and RIGHT3 32 bits: 2ABAA8F5, C8BA7644

FIESTEL ROUND NO 4
******************

EXPANSION TO 48 BITS: 011001010001010111110100001110101100001000001001(6515F43AC209)


RIGHT3 XOR with ROUNDKEY4 : 000010111011100111101110001110101100001000001001(0BB9EE3AC209)
SBOX SUBSTITUTION TO 32 bits: 01000101000011010110110011111010(450D6CFA)
PERMUTATION: 10011010000101101101010011011001(9A16D4D9)
LEFT XOR WITH RIGHT SIDE OPERATRION:10110000101011000111110000101100(B0AC7C2C)

LEFT4 and RIGHT4 32 bits: 11001000101110100111011001000100, 10110000101011000111110000101100


LEFT4 and RIGHT4 32 bits: C8BA7644, B0AC7C2C

FIESTEL ROUND NO 5
******************

EXPANSION TO 48 BITS: 010110100001010101011000001111111000000101011001(5A15583F8159)


RIGHT4 XOR with ROUNDKEY5 : 001101001011100101000010001111111000000101011001(34B9423F8159)
SBOX SUBSTITUTION TO 32 bits: 11010010110111010001000110110000(D2DD11B0)
PERMUTATION: 11100110100000011011010101000011(E681B543)
LEFT XOR WITH RIGHT SIDE OPERATRION:00101110001110111100001100000111(2E3BC307)

LEFT5 and RIGHT5 32 bits: 10110000101011000111110000101100, 00101110001110111100001100000111


LEFT5 and RIGHT5 32 bits: B0AC7C2C, 2E3BC307

FIESTEL ROUND NO 6
******************

EXPANSION TO 48 BITS: 100101011100000111110111111000000110100000001110(95C1F7E0680E)


RIGHT5 XOR with ROUNDKEY6 : 111110110110110111101101111000000110100000001110(FB6DEDE0680E)

SBOX SUBSTITUTION TO 32 bits: 00000110001111010110111100010001(063D6F11)


PERMUTATION: 11010110001001000011100011011100(D62438DC)
LEFT XOR WITH RIGHT SIDE OPERATRION:01100110100010000100010011110000(668844F0)

LEFT6 and RIGHT6 32 bits: 00101110001110111100001100000111, 01100110100010000100010011110000


LEFT6 and RIGHT6 32 bits: 2E3BC307, 668844F0

FIESTEL ROUND NO 7
******************

EXPANSION TO 48 BITS: 001100001101010001010000001000001001011110100000(30D4502097A0)


RIGHT6 XOR with ROUNDKEY7 : 010111100111100001001010001000001001011110100000(5E784A2097A0)
SBOX SUBSTITUTION TO 32 bits: 10110001000101100111011100010111(B1167717)
PERMUTATION: 00100110111001100111101010101010(26E67AAA)
LEFT XOR WITH RIGHT SIDE OPERATRION:00001000110111011011100110101101(08DDB9AD)

LEFT7 and RIGHT7 32 bits: 01100110100010000100010011110000, 00001000110111011011100110101101


LEFT7 and RIGHT7 32 bits: 668844F0, 08DDB9AD

FIESTEL ROUND NO 8

******************

EXPANSION TO 48 BITS: 100001010001011011111011110111110011110101011010(8516FBDF3D5A)


RIGHT7 XOR with ROUNDKEY8 : 111010111011101011100001110111110011110101011010(EBBAE1DF3D5A)
SBOX SUBSTITUTION TO 32 bits: 10100101100100111001111000000000(A5939E00)
PERMUTATION: 10110101111000000100001100011000(B5E04318)
LEFT XOR WITH RIGHT SIDE OPERATRION:11010011011010000000011111101000(D36807E8)

LEFT8 and RIGHT8 32 bits: 00001000110111011011100110101101, 11010011011010000000011111101000


LEFT8 and RIGHT8 32 bits: 08DDB9AD, D36807E8

FIESTEL ROUND NO 9
******************

EXPANSION TO 48 BITS: 011010100110101101010000000000001111111101010001(6A6B5000FF51)


RIGHT8 XOR with ROUNDKEY9 : 111110110011100010110101000000001111111101010001(FB38B500FF51)
SBOX SUBSTITUTION TO 32 bits: 00000110011001010010010100111100(0665253C)
PERMUTATION: 11001010000000010011010010111100(CA0134BC)
LEFT XOR WITH RIGHT SIDE OPERATRION:11000010110111001000110100010001(C2DC8D11)

LEFT9 and RIGHT9 32 bits: 11010011011010000000011111101000, 11000010110111001000110100010001


LEFT9 and RIGHT9 32 bits: D36807E8, C2DC8D11

FIESTEL ROUND NO 10
******************

EXPANSION TO 48 BITS: 111000000101011011111001010001011010100010100011(E056F945A8A3)


RIGHT9 XOR with ROUNDKEY10 : 011100010000010100011100010001011010100010100011(71051C45A8A3)
SBOX SUBSTITUTION TO 32 bits: 00001001110001000101011101000001(09C45741)
PERMUTATION: 00100000001111010111100100001000(203D7908)
LEFT XOR WITH RIGHT SIDE OPERATRION:11110011010101010111111011100000(F3557EE0)

LEFT10 and RIGHT10 32 bits: 11000010110111001000110100010001, 11110011010101010111111011100000


LEFT10 and RIGHT10 32 bits: C2DC8D11, F3557EE0

FIESTEL ROUND NO 11
******************

EXPANSION TO 48 BITS: 011110100110101010101010101111111101011100000001(7A6AAABFD701)


RIGHT10 XOR with ROUNDKEY11 : 111010110011100101001111101111111101011100000001(EB394FBFD701)

SBOX SUBSTITUTION TO 32 bits: 10100110110100111101100001100001(A6D3D861)


PERMUTATION: 11110101110101010000111100010000(F5D50F10)
LEFT XOR WITH RIGHT SIDE OPERATRION:00110111000010011000001000000001(37098201)

LEFT11 and RIGHT11 32 bits: 11110011010101010111111011100000, 00110111000010011000001000000001


LEFT11 and RIGHT11 32 bits: F3557EE0, 37098201

FIESTEL ROUND NO 12
******************

EXPANSION TO 48 BITS: 100110101110100001010011110000000100000000000010(9AE853C04002)


RIGHT11 XOR with ROUNDKEY12 : 000010111011101110110110110000000100000000000010(0BBBB6C04002)
SBOX SUBSTITUTION TO 32 bits: 01000101000011101111101001000010(450EFA42)
PERMUTATION: 00110001011101101101000011010000(3176D0D0)
LEFT XOR WITH RIGHT SIDE OPERATRION:11000010001000111010111000110000(C223AE30)

LEFT12 and RIGHT12 32 bits: 00110111000010011000001000000001, 11000010001000111010111000110000


LEFT12 and RIGHT12 32 bits: 37098201, C223AE30

FIESTEL ROUND NO 13

******************

EXPANSION TO 48 BITS: 011000000100000100000111110101011100000110100001(604107D5C1A1)


RIGHT12 XOR with ROUNDKEY13 : 111100010001001011100010110101011100000110100001(F112E2D5C1A1)
SBOX SUBSTITUTION TO 32 bits: 01011100010001100000010111100010(5C4605E2)
PERMUTATION: 00000000010110111011010000011011(005BB41B)
LEFT XOR WITH RIGHT SIDE OPERATRION:00110111010100100011011000011010(3752361A)

LEFT13 and RIGHT13 32 bits: 11000010001000111010111000110000, 00110111010100100011011000011010


LEFT13 and RIGHT13 32 bits: C223AE30, 3752361A

FIESTEL ROUND NO 14
******************

EXPANSION TO 48 BITS: 000110101110101010100100000110101100000011110100(1AEAA41AC0F4)


RIGHT13 XOR with ROUNDKEY14 : 100010111011100101000001000110101100000011110100(8BB9411AC0F4)
SBOX SUBSTITUTION TO 32 bits: 00010101110111010001110000001010(15DD1C0A)
PERMUTATION: 10111100000000110101000101011010(BC03515A)
LEFT XOR WITH RIGHT SIDE OPERATRION:01111110001000001111111101101010(7E20FF6A)

LEFT14 and RIGHT14 32 bits: 00110111010100100011011000011010, 01111110001000001111111101101010


LEFT14 and RIGHT14 32 bits: 3752361A, 7E20FF6A

FIESTEL ROUND NO 15
******************

EXPANSION TO 48 BITS: 001111111100000100000001011111111110101101010100(3FC1017FEB54)


RIGHT14 XOR with ROUNDKEY15 : 101011101001001011100100011111111110101101010100(AE92E47FEB54)
SBOX SUBSTITUTION TO 32 bits: 10010011010010010110011010100011(934966A3)
PERMUTATION: 11000000101001110100110011001011(C0A74CCB)
LEFT XOR WITH RIGHT SIDE OPERATRION:11110111111101010111101011010001(F7F57AD1)

LEFT15 and RIGHT15 32 bits: 01111110001000001111111101101010, 11110111111101010111101011010001


LEFT15 and RIGHT15 32 bits: 7E20FF6A, F7F57AD1

FIESTEL ROUND NO 16
******************

EXPANSION TO 48 BITS: 111110101111111110101010101111110101011010100011(FAFFAABF56A3)


RIGHT15 XOR with ROUNDKEY16 : 100101000101001110110000101111110101011010100011(9453B0BF56A3)

SBOX SUBSTITUTION TO 32 bits: 10000100010111111101000110100001(845FD1A1)


PERMUTATION: 10100101110001010011110001010001(A5C53C51)
LEFT XOR WITH RIGHT SIDE OPERATRION:11011011111001011100001100111011(DBE5C33B)

LEFT16 and RIGHT16 32 bits: 11011011111001011100001100111011, 11110111111101010111101011010001


LEFT16 and RIGHT16 32 bits: DBE5C33B, F7F57AD1

FINAL VALUE BEFORE INVERSE PERMUATION: 1101101111100101110000110011101111110111111101010111101011010001


(DBE5C33BF7F57AD1)
FINAL ENCYPTED TEXT :1111011111001101101100000100100111101011101110011111111011110110(F7CDB049EBB9FEF6)
********************************************************************************************

SECOND DES KEY ENCRYPTION


************************

Key USED in BINARY IS: 1110000000000001111000000000000111110001000000011111000100000001


Key USED in HEXADECIMAL IS: E001E001F101F101

Plain Text in BINARY IS: 1111011111001101101100000100100111101011101110011111111011110110


Plain Text in HEXADECIMAL IS: F7CDB049EBB9FEF6

KEY GENERATION
**************

KEY REDUCED FROM 64 bits to 56 bits: 01010101010101010101010101010000000000000000000000000000(55555550000000)

ROUND 1 KEY

Shift Left Key: 1010101010101010101010101010(AAAAAAA)


Shift right Key: 1010101010101010101010101010(0000000)
48 bits Key for round 1: 011011101010110000011010000000000000000000000000(6EAC1A000000)

ROUND 2 KEY

Shift Left Key: 0101010101010101010101010101(5555555)

Shift right Key: 0101010101010101010101010101(0000000)


48 bits Key for round 2: 100100010101001111100101000000000000000000000000(9153E5000000)

ROUND 3 KEY

Shift Left Key: 0101010101010101010101010101(5555555)


Shift right Key: 0101010101010101010101010101(0000000)
48 bits Key for round 2: 100100010101001111100101000000000000000000000000(9153E5000000)

ROUND 4 KEY

Shift Left Key: 0101010101010101010101010101(5555555)


Shift right Key: 0101010101010101010101010101(0000000)
48 bits Key for round 4: 100100010101001111100101000000000000000000000000(9153E5000000)

ROUND 5 KEY

Shift Left Key: 0101010101010101010101010101(5555555)


Shift right Key: 0101010101010101010101010101(0000000)
48 bits Key for round 5: 100100010101001111100101000000000000000000000000(9153E5000000)

ROUND 6 KEY

Shift Left Key: 0101010101010101010101010101(5555555)


Shift right Key: 0101010101010101010101010101(0000000)
48 bits Key for round 6: 100100010101001111100101000000000000000000000000(9153E5000000)

ROUND 7 KEY

Shift Left Key: 0101010101010101010101010101(5555555)


Shift right Key: 0101010101010101010101010101(0000000)
48 bits Key for round 7: 100100010101001111100101000000000000000000000000(9153E5000000)

ROUND 8 KEY

Shift Left Key: 0101010101010101010101010101(5555555)


Shift right Key: 0101010101010101010101010101(0000000)
48 bits Key for round 8: 100100010101001111100101000000000000000000000000(9153E5000000)

ROUND 9 KEY

Shift Left Key: 1010101010101010101010101010(AAAAAAA)


Shift right Key: 1010101010101010101010101010(0000000)
48 bits Key for round 9: 011011101010110000011010000000000000000000000000(6EAC1A000000)

ROUND 10 KEY

Shift Left Key: 1010101010101010101010101010(AAAAAAA)


Shift right Key: 1010101010101010101010101010(0000000)
48 bits Key for round 10: 011011101010110000011010000000000000000000000000(6EAC1A000000)

ROUND 11 KEY

Shift Left Key: 1010101010101010101010101010(AAAAAAA)


Shift right Key: 1010101010101010101010101010(0000000)
48 bits Key for round 11: 011011101010110000011010000000000000000000000000(6EAC1A000000)

ROUND 12 KEY

Shift Left Key: 1010101010101010101010101010(AAAAAAA)

Shift right Key: 1010101010101010101010101010(0000000)


48 bits Key for round 12: 011011101010110000011010000000000000000000000000(6EAC1A000000)

ROUND 13 KEY

Shift Left Key: 1010101010101010101010101010(AAAAAAA)


Shift right Key: 1010101010101010101010101010(0000000)
48 bits Key for round 13: 011011101010110000011010000000000000000000000000(6EAC1A000000)

ROUND 14 KEY

Shift Left Key: 1010101010101010101010101010(AAAAAAA)


Shift right Key: 1010101010101010101010101010(0000000)
48 bits Key for round 14: 011011101010110000011010000000000000000000000000(6EAC1A000000)

ROUND 15 KEY

Shift Left Key: 1010101010101010101010101010(AAAAAAA)


Shift right Key: 1010101010101010101010101010(0000000)
48 bits Key for round 15: 011011101010110000011010000000000000000000000000(6EAC1A000000)

ROUND 16 KEY

Shift Left Key: 0101010101010101010101010101(5555555)


Shift right Key: 0101010101010101010101010101(0000000)
48 bits Key for round 16: 100100010101001111100101000000000000000000000000(9153E5000000)

DES ENCRYPTION STARTS HERE


**************************

Intial Permuation String: 1101101111100101110000110011101111110111111101010111101011010001(DBE5C33BF7F57AD1)

LEFT0 and RIGHT0 32 bits: 11011011111001011100001100111011, 11110111111101010111101011010001


LEFT0 and RIGHT0 32 bits: DBE5C33B, F7F57AD1

FIESTEL ROUND NO 1
******************

EXPANSION TO 48 BITS: 111110101111111110101010101111110101011010100011(FAFFAABF56A3)


RIGHT0 XOR with ROUNDKEY1 : 100101000101001110110000101111110101011010100011(9453B0BF56A3)
SBOX SUBSTITUTION TO 32 bits: 10000100010111111101000110100001(845FD1A1)
PERMUTATION: 10100101110001010011110001010001(A5C53C51)
LEFT XOR WITH RIGHT SIDE OPERATRION:01111110001000001111111101101010(7E20FF6A)

LEFT1 and RIGHT1 32 bits: 11110111111101010111101011010001, 01111110001000001111111101101010


LEFT1 and RIGHT1 32 bits: F7F57AD1, 7E20FF6A

FIESTEL ROUND NO 2
******************

EXPANSION TO 48 BITS: 001111111100000100000001011111111110101101010100(3FC1017FEB54)


RIGHT1 XOR with ROUNDKEY2 : 101011101001001011100100011111111110101101010100(AE92E47FEB54)
SBOX SUBSTITUTION TO 32 bits: 10010011010010010110011010100011(934966A3)
PERMUTATION: 11000000101001110100110011001011(C0A74CCB)
LEFT XOR WITH RIGHT SIDE OPERATRION:00110111010100100011011000011010(3752361A)

LEFT2 and RIGHT2 32 bits: 01111110001000001111111101101010, 00110111010100100011011000011010


LEFT2 and RIGHT2 32 bits: 7E20FF6A, 3752361A

FIESTEL ROUND NO 3
******************

EXPANSION TO 48 BITS: 000110101110101010100100000110101100000011110100(1AEAA41AC0F4)


RIGHT2 XOR with ROUNDKEY3 : 100010111011100101000001000110101100000011110100(8BB9411AC0F4)
SBOX SUBSTITUTION TO 32 bits: 00010101110111010001110000001010(15DD1C0A)
PERMUTATION: 10111100000000110101000101011010(BC03515A)
LEFT XOR WITH RIGHT SIDE OPERATRION:11000010001000111010111000110000(C223AE30)

LEFT3 and RIGHT3 32 bits: 00110111010100100011011000011010, 11000010001000111010111000110000


LEFT3 and RIGHT3 32 bits: 3752361A, C223AE30

FIESTEL ROUND NO 4
******************

EXPANSION TO 48 BITS: 011000000100000100000111110101011100000110100001(604107D5C1A1)


RIGHT3 XOR with ROUNDKEY4 : 111100010001001011100010110101011100000110100001(F112E2D5C1A1)
SBOX SUBSTITUTION TO 32 bits: 01011100010001100000010111100010(5C4605E2)
PERMUTATION: 00000000010110111011010000011011(005BB41B)

LEFT XOR WITH RIGHT SIDE OPERATRION:00110111000010011000001000000001(37098201)

LEFT4 and RIGHT4 32 bits: 11000010001000111010111000110000, 00110111000010011000001000000001


LEFT4 and RIGHT4 32 bits: C223AE30, 37098201

FIESTEL ROUND NO 5
******************

EXPANSION TO 48 BITS: 100110101110100001010011110000000100000000000010(9AE853C04002)


RIGHT4 XOR with ROUNDKEY5 : 000010111011101110110110110000000100000000000010(0BBBB6C04002)
SBOX SUBSTITUTION TO 32 bits: 01000101000011101111101001000010(450EFA42)
PERMUTATION: 00110001011101101101000011010000(3176D0D0)
LEFT XOR WITH RIGHT SIDE OPERATRION:11110011010101010111111011100000(F3557EE0)

LEFT5 and RIGHT5 32 bits: 00110111000010011000001000000001, 11110011010101010111111011100000


LEFT5 and RIGHT5 32 bits: 37098201, F3557EE0

FIESTEL ROUND NO 6
******************

EXPANSION TO 48 BITS: 011110100110101010101010101111111101011100000001(7A6AAABFD701)


RIGHT5 XOR with ROUNDKEY6 : 111010110011100101001111101111111101011100000001(EB394FBFD701)
SBOX SUBSTITUTION TO 32 bits: 10100110110100111101100001100001(A6D3D861)
PERMUTATION: 11110101110101010000111100010000(F5D50F10)
LEFT XOR WITH RIGHT SIDE OPERATRION:11000010110111001000110100010001(C2DC8D11)

LEFT6 and RIGHT6 32 bits: 11110011010101010111111011100000, 11000010110111001000110100010001


LEFT6 and RIGHT6 32 bits: F3557EE0, C2DC8D11

FIESTEL ROUND NO 7
******************

EXPANSION TO 48 BITS: 111000000101011011111001010001011010100010100011(E056F945A8A3)


RIGHT6 XOR with ROUNDKEY7 : 011100010000010100011100010001011010100010100011(71051C45A8A3)
SBOX SUBSTITUTION TO 32 bits: 00001001110001000101011101000001(09C45741)
PERMUTATION: 00100000001111010111100100001000(203D7908)
LEFT XOR WITH RIGHT SIDE OPERATRION:11010011011010000000011111101000(D36807E8)

LEFT7 and RIGHT7 32 bits: 11000010110111001000110100010001, 11010011011010000000011111101000


LEFT7 and RIGHT7 32 bits: C2DC8D11, D36807E8

FIESTEL ROUND NO 8
******************

EXPANSION TO 48 BITS: 011010100110101101010000000000001111111101010001(6A6B5000FF51)


RIGHT7 XOR with ROUNDKEY8 : 111110110011100010110101000000001111111101010001(FB38B500FF51)
SBOX SUBSTITUTION TO 32 bits: 00000110011001010010010100111100(0665253C)
PERMUTATION: 11001010000000010011010010111100(CA0134BC)
LEFT XOR WITH RIGHT SIDE OPERATRION:00001000110111011011100110101101(08DDB9AD)

LEFT8 and RIGHT8 32 bits: 11010011011010000000011111101000, 00001000110111011011100110101101


LEFT8 and RIGHT8 32 bits: D36807E8, 08DDB9AD

FIESTEL ROUND NO 9
******************

EXPANSION TO 48 BITS: 100001010001011011111011110111110011110101011010(8516FBDF3D5A)


RIGHT8 XOR with ROUNDKEY9 : 111010111011101011100001110111110011110101011010(EBBAE1DF3D5A)
SBOX SUBSTITUTION TO 32 bits: 10100101100100111001111000000000(A5939E00)
PERMUTATION: 10110101111000000100001100011000(B5E04318)

LEFT XOR WITH RIGHT SIDE OPERATRION:01100110100010000100010011110000(668844F0)

LEFT9 and RIGHT9 32 bits: 00001000110111011011100110101101, 01100110100010000100010011110000


LEFT9 and RIGHT9 32 bits: 08DDB9AD, 668844F0

FIESTEL ROUND NO 10
******************

EXPANSION TO 48 BITS: 001100001101010001010000001000001001011110100000(30D4502097A0)


RIGHT9 XOR with ROUNDKEY10 : 010111100111100001001010001000001001011110100000(5E784A2097A0)
SBOX SUBSTITUTION TO 32 bits: 10110001000101100111011100010111(B1167717)
PERMUTATION: 00100110111001100111101010101010(26E67AAA)
LEFT XOR WITH RIGHT SIDE OPERATRION:00101110001110111100001100000111(2E3BC307)

LEFT10 and RIGHT10 32 bits: 01100110100010000100010011110000, 00101110001110111100001100000111


LEFT10 and RIGHT10 32 bits: 668844F0, 2E3BC307

FIESTEL ROUND NO 11
******************

EXPANSION TO 48 BITS: 100101011100000111110111111000000110100000001110(95C1F7E0680E)


RIGHT10 XOR with ROUNDKEY11 : 111110110110110111101101111000000110100000001110(FB6DEDE0680E)
SBOX SUBSTITUTION TO 32 bits: 00000110001111010110111100010001(063D6F11)
PERMUTATION: 11010110001001000011100011011100(D62438DC)
LEFT XOR WITH RIGHT SIDE OPERATRION:10110000101011000111110000101100(B0AC7C2C)

LEFT11 and RIGHT11 32 bits: 00101110001110111100001100000111, 10110000101011000111110000101100


LEFT11 and RIGHT11 32 bits: 2E3BC307, B0AC7C2C

FIESTEL ROUND NO 12
******************

EXPANSION TO 48 BITS: 010110100001010101011000001111111000000101011001(5A15583F8159)


RIGHT11 XOR with ROUNDKEY12 : 001101001011100101000010001111111000000101011001(34B9423F8159)
SBOX SUBSTITUTION TO 32 bits: 11010010110111010001000110110000(D2DD11B0)
PERMUTATION: 11100110100000011011010101000011(E681B543)
LEFT XOR WITH RIGHT SIDE OPERATRION:11001000101110100111011001000100(C8BA7644)

LEFT12 and RIGHT12 32 bits: 10110000101011000111110000101100, 11001000101110100111011001000100


LEFT12 and RIGHT12 32 bits: B0AC7C2C, C8BA7644

FIESTEL ROUND NO 13
******************

EXPANSION TO 48 BITS: 011001010001010111110100001110101100001000001001(6515F43AC209)


RIGHT12 XOR with ROUNDKEY13 : 000010111011100111101110001110101100001000001001(0BB9EE3AC209)
SBOX SUBSTITUTION TO 32 bits: 01000101000011010110110011111010(450D6CFA)
PERMUTATION: 10011010000101101101010011011001(9A16D4D9)
LEFT XOR WITH RIGHT SIDE OPERATRION:00101010101110101010100011110101(2ABAA8F5)

LEFT13 and RIGHT13 32 bits: 11001000101110100111011001000100, 00101010101110101010100011110101


LEFT13 and RIGHT13 32 bits: C8BA7644, 2ABAA8F5

FIESTEL ROUND NO 14
******************

EXPANSION TO 48 BITS: 100101010101010111110101010101010001011110101010(9555F55517AA)


RIGHT13 XOR with ROUNDKEY14 : 111110111111100111101111010101010001011110101010(FBF9EF5517AA)
SBOX SUBSTITUTION TO 32 bits: 00001001000010001111011000011100(0908F61C)
PERMUTATION: 00101011001011000100000011101000(2B2C40E8)

LEFT XOR WITH RIGHT SIDE OPERATRION:11100011100101100011011010101100(E39636AC)

LEFT14 and RIGHT14 32 bits: 00101010101110101010100011110101, 11100011100101100011011010101100


LEFT14 and RIGHT14 32 bits: 2ABAA8F5, E39636AC

FIESTEL ROUND NO 15
******************

EXPANSION TO 48 BITS: 011100000111110010101100000110101101010101011001(707CAC1AD559)


RIGHT14 XOR with ROUNDKEY15 : 000111101101000010110110000110101101010101011001(1ED0B61AD559)
SBOX SUBSTITUTION TO 32 bits: 01000100000011100001111101010000(440E1F50)
PERMUTATION: 00110010011100001011000001011000(3270B058)
LEFT XOR WITH RIGHT SIDE OPERATRION:00011000110010100001100010101101(18CA18AD)

LEFT15 and RIGHT15 32 bits: 11100011100101100011011010101100, 00011000110010100001100010101101


LEFT15 and RIGHT15 32 bits: E39636AC, 18CA18AD

FIESTEL ROUND NO 16
******************

EXPANSION TO 48 BITS: 100011110001011001010100000011110001010101011010(8F16540F155A)


RIGHT15 XOR with ROUNDKEY16 : 000111100100010110110001000011110001010101011010(1E45B10F155A)
SBOX SUBSTITUTION TO 32 bits: 01000111011110011011101101010000(4779BB50)
PERMUTATION: 11110111001100011110000011010100(F731E0D4)
LEFT XOR WITH RIGHT SIDE OPERATRION:00010100101001111101011001111000(14A7D678)

LEFT16 and RIGHT16 32 bits: 00010100101001111101011001111000, 00011000110010100001100010101101


LEFT16 and RIGHT16 32 bits: 14A7D678, 18CA18AD

FINAL VALUE BEFORE INVERSE PERMUATION: 0001010010100111110101100111100000011000110010100001100010101101


(14A7D67818CA18AD)
FINAL ENCYPTED TEXT :0001001000110100010101101010101111001101000100110010010100110110(123456ABCD132536)

The text highlighted at the preceding line is equivalent to the text input at the start.
Hence proved that EK2(EK1(x) )= x using weak key pairs

You might also like