1. Not finding help here? Sign up for a free 30min tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

DES Substitution Example

  1. Jul 16, 2014 #1
    1. The problem statement, all variables and given/known data

    S(18 09 12 3d 11 17 38 39) = 5fd25e03

    2. Relevant equations

    3. The attempt at a solution
    So I know about DES that you split a 64 bit block into left and right halves 32 bits each. Where even bits are on the left and odd are on the right. Perform the round function of the 32 bit right side and 48 bit key. The round function works by expanding the bits the flowing them through a xor gate with the 48 bit key, which then flows into the substitution stage where the 48 bit expanded input is dropped to 32 bit. This then goes into permutation and goes into the XOR gate along with LI-1. Such that Li = RI-1 and Ri = LI-1 xor F(RI-1,Ki). So knowing that and only focusing on the substitution the 8 S boxes map the 6 bit to 4 bit, in which each each s box is 4 little 4 bit boxes where the outer bits select rows and the inner bits select the columns. Ok so I know all this and I have the table that it suggests using but I don't know what any of this means I have tried to find a pattern to no avail. More specifically what are the outer bits in this and what are the inner? Then once I figure this out how do I use the table provided?

    Attached Files:

  2. jcsd
  3. Jul 16, 2014 #2
    I don't think I am using the correct tables because I looked up a table on Wikipedia that had the stuff in binary. But I am still unsure of what the outer and inner bits are?
  4. Jul 16, 2014 #3
    Each of the eight S-Boxes is addressed with 6-bits, separated into the 4 middle bits (inner) and the two end bits (outer).
    For example, if I am using S5, my outer bits are 1yyyy0, and my inner bits are x1010x, the full address to S5 will be 110100. Under these conditions, the S5 output will be 1100 (12).

    Having said that...

    If you are going to try to encode or decode a DES block, you're going to need some sort of tool - for example, Microsoft Excel.

    What is your plan?
  5. Jul 17, 2014 #4
    Is there no way to do this by hand? If not I would have to guess Excel?
  6. Jul 17, 2014 #5
    Ok so I found a question in my book that may be a better example to start with. I UPLOADED WORK. It states:

    This problem provides a numerical example of encryption using a one-round version of DES. We start with the same bit pattern for the key K and the plaintext, namely:

    Hexadecimal notation: 0 1 2 3 4 5 6 7 8 9 A B C D E F
    Binary notation: 0000 0001 0010 0011 0100 0101 0110 0111
    1000 1001 1010 1011 1100 1101 1110 1111

    a. Derive K1, the first-round subkey
    b. Derive L0, R0
    c. Expand R0 to get E[R0], where E[.] is the expansion function of Table S.1
    d. Calculate A = E[R0] xor K1
    e. Group the 48-bit result of (d) into sets of 6 bits and evaluate the corresponding S-box substitutions.
    f. Concatenate the results of (e) to get a 32-bit result, B
    g. Apply the permutation to get P(B)
    h. Calculate R1 = P(B) xor L0
    I. Write down the cipher text

    I then solved (b) and (c) but I was unsure of how to solve (a).

    (b) L0 = 1100 1100 0000 0000 1100 1100 1111 1111
    (HEX) L0 = C C 0 0 C C F F
    R0 = 1111 0000 1010 1010 1111 0000 1010 1010
    (HEX) R0 = F 0 A A F 0 A A

    (c) E[R0] = 011110 100001 010101 010101 011110 100001 010101 010101
    (HEX) E[R0] = 7 A 1 5 5 5 7 A 1 5 5 5

    My question is how do I do the key part? I read in the book that I need to perform a left circular shift on the left and right 28 bit side. I then need to somehow lose 8 bits, how will I do this? Part (e) looks similar to what I need but I need to do (a) so I can (d), and therefore finish (e).MY WORK IS UPLOADED.

    Attached Files:

  7. Jul 18, 2014 #6
    Sorry was my question out of line? If so we can go back to the original, I just figured this was a better starting point.
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted

Similar Discussions: DES Substitution Example
  1. CRC Example (Replies: 0)