Cryptography Tutorials - Herong's Tutorial Notes
Dr. Herong Yang, Version 4.00

DES Algorithm - Illustrated with Java Programs

Part:   1  2  3  4  5  6 

(Continued from previous part...)

In this program, the input clear text block and the subkeys are hard coded with the values used by J. Orlin Grabbe in "The DES Algorithm Illustrated". The cipher text block generated by the algorithm is validated with the result mentioned by J. Orlin Grabbe.

If you run this program with JDK 1.4.1, you will get:

Input message:
00000001 00100011 01000101 01100111 10001001 10101011 11001101 111...

After initial permutation:
11001100 00000000 11001100 11111111 11110000 10101010 11110000 101...

R: After E expansion:
01111010 00010101 01010101 01111010 00010101 01010101

R: After XOR with the subkey:
01100001 00010111 10111010 10000110 01100101 00100111

R: After S boxes:
01011100 10000010 10110101 10010111

R: After P permutation:
00100011 01001010 10101001 10111011

Right half at round #1:
11101111 01001010 01100101 01000100

R: After E expansion:
01110101 11101010 01010100 00110000 10101010 00001001

R: After XOR with the subkey:
00001100 01000100 10001101 11101011 01100011 11101100

R: After S boxes:
11111000 11010000 00111010 10101110

R: After P permutation:
00111100 10101011 10000111 10100011

Right half at round #2:
11001100 00000001 01110111 00001001

R: After E expansion:
11100101 10000000 00000010 10111010 11101000 01010011

R: After XOR with the subkey:
10110000 01111100 10001000 11111000 00100111 11001010

R: After S boxes:
00100111 00010000 11100001 01101111

R: After P permutation:
01001101 00010110 01101110 10110000

Right half at round #3:
10100010 01011100 00001011 11110100

R: After E expansion:
01010000 01000010 11111000 00000101 01111111 10101001

R: After XOR with the subkey:
00100010 11101111 00101110 11011110 01001010 10110100

R: After S boxes:
00100001 11101101 10011111 00111010

R: After P permutation:
10111011 00100011 01110111 01001100

Right half at round #4:
01110111 00100010 00000000 01000101

R: After E expansion:
10111010 11101001 00000100 00000000 00000010 00001010

R: After XOR with the subkey:
11000110 00000101 00000011 11101011 01010001 10100010

R: After S boxes:
01010000 11001000 00110001 11101011

R: After P permutation:
00101000 00010011 10101101 11000011

Right half at round #5:
10001010 01001111 10100110 00110111

R: After E expansion:
11000101 01000010 01011111 11010000 11000001 10101111

R: After XOR with the subkey:
10100110 11100111 01100001 10000000 10111010 10000000

R: After S boxes:
01000001 11110011 01001100 00111101

R: After P permutation:
10011110 01000101 11001101 00101100

Right half at round #6:
11101001 01100111 11001101 01101001

R: After E expansion:
11110101 00101011 00001111 11100101 10101011 01010011

R: After XOR with the subkey:
00011001 10101111 10111000 00010011 10110011 11101111

R: After S boxes:
00010000 01110101 01000000 10101101

R: After P permutation:
10001100 00000101 00011100 00100111

Right half at round #7:
00000110 01001010 10111010 00010000

R: After E expansion:
00000000 11000010 01010101 01011111 01000000 10100000

R: After XOR with the subkey:
11110111 01001000 01101111 10011110 01111011 01011011

R: After S boxes:
01101100 00011000 01111100 10101110

R: After P permutation:
00111100 00001110 10000110 11111001

Right half at round #8:
11010101 01101001 01001011 10010000

R: After E expansion:
01101010 10101011 01010010 10100101 01111100 10100001

R: After XOR with the subkey:
10001010 01110000 10111001 01001000 10011011 00100000

(Continued on next part...)

Part:   1  2  3  4  5  6 

Dr. Herong Yang, updated in 2007
Cryptography Tutorials - Herong's Tutorial Notes - DES Algorithm - Illustrated with Java Programs