Data Encryption Standard (Lab Instructions)
In this activity, you will perform a single round of DES encryption "by hand"
in order to see how substitution and transposition ciphers can be used in software
in order to encipher binary data.
Typically, an RSA public key will be used to encipher and transmit a secret
symmetric cipher key, such as a DES cipher key, and the two computers
will then use that shared secret key to carry on a conversation.
Websites and Instructions
In this example, you will encipher the eight-letter plaintext StarWars using the
hexadecimal value 0123456789abcdef as the DES cipher key. Think of DES as a normal
substitution/transposition cipher that takes a plaintext number (64 binary digits long)
and a numerical key (also 64 binary digits long) and mixes them up to generate a
ciphertext number as output (also 64 binary digits long).
-
First, take your eight-letter plaintext phrase and use the
ASCII Converter
to encode it as a binary/hexadecimal number. Use the "Remove 0x"
checkbox to remove the "0x" characters from the hex output.
-
Copy the numerical plaintext (16 hex digits) into the Input Data field of the
DES Calculator.
-
Copy or type the cipher key 0123456789abcdef (also 16 hex digits)
into the DES Key field of the
DES Calculator.
-
Click on Encrypt to calculate the 61-bit (16 hex digit) ciphertext for your message. Leave
the Trace Level set to 2 (+rounds) so that the intermediate values and outputs of each round
function are displayed in the trace. Your ciphertext should be the hex value 130a3303417d7cb4.
-
On the color handout for this lab, you will perform the operations for Round 2 of the
cipher. First, find your R1 value (the input to Round 2 of the cipher), your eight-part round
key SK2 for Round 2 of the cipher, and the output of the round function (shown on the far right).
-
Copy R1 as a binary number onto your lab handout. You can copy and paste the hex value of R1 into the
Hexadecimal/Decimal/Binary Converter
in order to get the binary digits to fill in at the top of your sheet, or use the hexadecimal-to-binary
conversion chart in the back of your coursepack.
-
Perform the encryption steps outlined in your coursepack and on the lab handout. When you come
to the green row of boxes, you will need to copy the eight-part round key SK2 into the eight
sets of boxes by converting each hexadecimal number into a six-digit binary number. Use XOR
(addition mod 2) to add each pair of bits from the blue and green rows and enter the results
in the pink row.
-
Once you have filled in the pink row, use the DES S-boxes (in order from 1 to 8) to substitute a
4-bit orange value for each 6-bit pink value in the row above. (Remember, "bit" means binary digit.)
-
Rearrange (transpose) the bits from the first orange row in the order shown to fill in
the second orange row, and compare your output to the output of the round function in your DES
trace using the
Hexadecimal/Decimal/Binary Converter.
If your output is correct, go on to the next step. If not, make sure you are looking at the
correct line of your DES trace and have correctly identified the output of the round function,
as well as the round input R1 and the round key SK2. Then, look back and compare your working with
a partner to determine where you made your mistake.
-
To finish Round 2 of the cipher, you will need to locate the L1 value (which is just R0) in your
cipher trace. Copy it into the light blue boxes as a binary value, then add it to the round
function output using XOR. The result should equal R2 from your DES trace. (Check it with the
online converter.)
-
Finally, copy down L2 into the last row of boxes on your lab handout. Recall that L2 (the left
half of the cipher state after Round 2) is just equal to the right half of the cipher state
after the previous round (R1). Together, L2 and R2 represent the full 64-bits of ciphertext
after just 2 out of 16 rounds making up the DES cipher!