DES Cipher Algorithm Illustration Program Output

This section provides the execution output of the tutorial Java program, DESCipherTest.java, to illustrate how DES cipher algorithm works.

If you run the DES encryption algorithm illustration program described in the previous section with JDK, you will get:

```herong> javac DESCipherTest.java

herong> java DESCipherTest
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

R: After S boxes:
00010001 00001100 01010111 01110111

R: After P permutation:
00100010 00110110 01111100 01101010

Right half at round #9:
00100100 01111100 11000110 01111010

R: After E expansion:
00010000 10000011 11111001 01100000 11000011 11110100

R: After XOR with the subkey:
10100001 01110000 10111110 11011010 10000101 10111011
```
```R: After S boxes:
11011010 00000100 01010010 01110101

R: After P permutation:
01100010 10111100 10011100 00100010

Right half at round #10:
10110111 11010101 11010111 10110010

R: After E expansion:
01011010 11111110 10101011 11101010 11111101 10100101

R: After XOR with the subkey:
01111011 10100001 01111000 00110100 00101110 00100011

R: After S boxes:
01110011 00000101 11010001 00000001

R: After P permutation:
11100001 00000100 11111010 00000010

Right half at round #11:
11000101 01111000 00111100 01111000

R: After E expansion:
01100000 10101011 11110000 00011111 10000011 11110001

R: After XOR with the subkey:
00010101 11011010 00000101 10001011 11100100 00011000

R: After S boxes:
01111011 10001011 00100110 00110101

R: After P permutation:
11000010 01101000 11001111 11101010

Right half at round #12:
01110101 10111101 00011000 01011000

R: After E expansion:
00111010 10111101 11111010 10001111 00000010 11110000

R: After XOR with the subkey:
10101101 01111000 00101011 01110101 10111000 10110001

R: After S boxes:
10011010 11010001 10001011 01001111

R: After P permutation:
11011101 10111011 00101001 00100010

Right half at round #13:
00011000 11000011 00010101 01011010

R: After E expansion:
00001111 00010110 00000110 10001010 10101010 11110100

R: After XOR with the subkey:
01010000 01010101 10110001 01111000 01001101 11001110

R: After S boxes:
01100100 01111001 10011010 11110001

R: After P permutation:
10110111 00110001 10001110 01010101

Right half at round #14:
11000010 10001100 10010110 00001101

R: After E expansion:
11100000 01010100 01011001 01001010 11000000 01011011

R: After XOR with the subkey:
01011111 11000101 11010100 01110111 11111111 01010001

R: After S boxes:
10110010 11101000 10001101 00111100

R: After P permutation:
01011011 10000001 00100111 01101110

Right half at round #15:
01000011 01000010 00110010 00110100

R: After E expansion:
00100000 01101010 00000100 00011010 01000001 10101000

R: After XOR with the subkey:
11101011 01010111 10001111 00010100 01010110 01011101

R: After S boxes:
10100111 10000011 00100100 00101001

R: After P permutation:
11001000 11000000 01001111 10011000

Right half at round #16:
00001010 01001100 11011001 10010101

After 16 rounds:
00001010 01001100 11011001 10010101 01000011 01000010 00110010 00110100

After final permutation:
10000101 11101000 00010011 01010100 00001111 00001010 10110100 00000101

DES cipher test result: true
```

Now we got all elements of the implementation working, and validated, let's put them together to make a generic DES encryption program. See the next chapter.