DES Cipher

Suggested experiment

  • Enter english text in the INPUT TEXT box.
  • Enter the key (a number from 1 to 511) in the KEY box.
  • Click ENCRYPT to encrypt the text (including the spaces) and see the ciphertext. Note that the plaintext is first converted to ASCII codes in binary, then the bits are grouped into 12-bit blocks and encrypted with a Feistel cipher that is similar to a simplified DES.
  • Click on the FEISTEL tab to see a diagram of the cipher.
  • Click on NEXT and PREV to step forward and backward through the encryption process.
  • Click on RESET to start over on the encryption process.

Overview

This applet demonstrates a simple Feistel cipher. A Feistel structure is a method for constructing a block cipher (one that encrypts a fixed number of bits at a time) using an arbitrary function. The function must incorporate the key, but is not necessarily invertible. The Data Encryption Standard (DES) is the most famous cipher based on a Feistel structure, so this applet can be thought of as a simplified form of DES.

In a Feistel cipher, the block is split into two halves. In each round, one half is simply copied to the next round. The other half is XORed with the result of applying some function to the first half. Since the first half is copied unchanged, it will be possible to apply the function again during decryption, and so there is no need for the function to be invertible.

In this applet, enter english text in the INPUT TEXT box, enter a key number from 1 to 511 in the KEY box, and click ENCRYPT to encrypt that message. Unlike most of the applets, this one can encrypt spaces and other characters, because the characters are converted to ASCII codes rather than just using A=1, B=2, etc.

Feistel

The FEISTEL tab shows one round of the cipher. Click on NEXT and PREV to go forward and backward through the rounds. Click RESET to start over again at the first round.