DES Substitution Example and Homework Solution

AI Thread Summary
The discussion focuses on the process of DES encryption, particularly the substitution step involving S-boxes. Participants clarify how to interpret the outer and inner bits when addressing the S-boxes, emphasizing the importance of understanding the bit structure for proper substitution. The conversation also highlights the need for tools like Microsoft Excel to assist in encoding or decoding DES blocks, especially when manual calculations become complex. Additionally, there is a specific inquiry about deriving the first-round subkey and performing necessary bit manipulations, including left circular shifts. The thread underscores the challenges faced in understanding the substitution process and the overall DES algorithm.
DODGEVIPER13
Messages
668
Reaction score
0

Homework Statement


example:

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


Homework Equations





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?
 

Attachments

  • EPSON002Revised.jpg
    EPSON002Revised.jpg
    32.6 KB · Views: 1,125
  • EPSON003.jpg
    EPSON003.jpg
    25.7 KB · Views: 965
Physics news on Phys.org
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?
 
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?
 
Is there no way to do this by hand? If not I would have to guess Excel?
 
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.
 

Attachments

  • EPSON004.jpg
    EPSON004.jpg
    17.3 KB · Views: 1,560
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.
 
Thread 'Have I solved this structural engineering equation correctly?'
Hi all, I have a structural engineering book from 1979. I am trying to follow it as best as I can. I have come to a formula that calculates the rotations in radians at the rigid joint that requires an iterative procedure. This equation comes in the form of: $$ x_i = \frac {Q_ih_i + Q_{i+1}h_{i+1}}{4K} + \frac {C}{K}x_{i-1} + \frac {C}{K}x_{i+1} $$ Where: ## Q ## is the horizontal storey shear ## h ## is the storey height ## K = (6G_i + C_i + C_{i+1}) ## ## G = \frac {I_g}{h} ## ## C...

Similar threads

Replies
2
Views
1K
Replies
1
Views
3K
Replies
11
Views
2K
Replies
1
Views
2K
Replies
6
Views
4K
Replies
4
Views
2K
Replies
1
Views
3K
Back
Top