This is the secret code that can be transmitted or stored. Decrypting the ciphertext restores the original message "Your lips are smoother than vaseline". Think how much better off Bill Clinton would be today, if Monica Lewinsky had used encryption on her Pentagon computer! How DES Works in Detail DES is a block cipher --meaning it operates on plaintext blocks of a given size bits and returns ciphertext blocks of the same size.
Each block of 64 bits is divided into two blocks of 32 bits each, a left half block L and a right half R. This division is only used in certain operations.
The last bit is "1". We read from left to right. DES operates on the bit blocks using key sizes of bits. The keys are actually stored as being 64 bits long, but every 8th bit in the key is not used i. However, we will nevertheless number the bits from 1 to 64, going left to right, in the following calculations.
But, as you will see, the eight bits just mentioned get eliminated when we create subkeys. The bit key is permuted according to the following table, PC The 49th bit of the original key becomes the second bit of the permuted key. The 4th bit of the original key is the last bit of the permuted key.
Note only 56 bits of the original key appear in the permuted key. To do a left shift, move each bit one place to the left, except for the first bit, which is cycled to the end of the block. Iteration Number of Number Left Shifts 1 1 2 1 3 2 4 2 5 2 6 2 7 2 8 2 9 1 10 2 11 2 12 2 13 2 14 2 15 2 16 1 This means, for example, C 3 and D 3 are obtained from C 2 and D 2 , respectively, by two left shifts, and C 16 and D 16 are obtained from C 15 and D 15 , respectively, by one left shift.
In all cases, by a single left shift is meant a rotation of the bits one place to the left, so that after one left shift the bits in the 28 positions are the bits that were previously in positions 2, 3, Each pair has 56 bits, but PC-2 only uses 48 of these. Now we look at the message itself. Step 2: Encode each bit block of data. There is an initial permutation IP of the 64 bits of the message data M.
This rearranges the bits according to the following table, where the entries in the table show the new arrangement of the bits from their initial order. The 58th bit of M becomes the first bit of IP. The 50th bit of M becomes the second bit of IP. The 7th bit of M is the last bit of IP. The 50th bit of M is "1", which becomes the second bit of IP. The 7th bit of M is "0", which becomes the last bit of IP. Next divide the permuted block IP into a left half L 0 of 32 bits, and a right half R 0 of 32 bits.
That is, in each iteration, we take the right 32 bits of the previous result and make them the left 32 bits of the current step. For the right 32 bits in the current step, we XOR the left 32 bits of the previous step with the calculation f. To calculate f , we first expand each block R n-1 from 32 bits to 48 bits. This is done by using a selection table that repeats some of the bits in R n We'll call the use of this selection table the function E.
Thus E R n-1 has a 32 bit input block, and a 48 bit output block. Let E be such that the 48 bits of its output, written as 8 blocks of 6 bits each, are obtained by selecting the bits in its inputs in order according to the following table: E BIT-SELECTION TABLE 32 1 2 3 4 5 4 5 6 7 8 9 8 9 10 11 12 13 12 13 14 15 16 17 16 17 18 19 20 21 20 21 22 23 24 25 24 25 26 27 28 29 28 29 30 31 32 1 Thus the first three bits of E R n-1 are the bits in positions 32, 1 and 2 of R n-1 while the last 2 bits of E R n-1 are the bits in positions 32 and 1.
We have not yet finished calculating the function f. To this point we have expanded R n-1 from 32 bits to 48 bits, using the selection table, and XORed the result with the key K n. We now have 48 bits, or eight groups of six bits. We now do something strange with each group of six bits: we use them as addresses in tables called " S boxes ". We will now form the final 16 keys by applying another permutation PC-2 table to each of the the 16 C n D n keys we obtained from the previous step.
The first thing we need to do is to apply an initial permutation IP to each block of 64 bits, according to the table:. For example, the first bit block from our message Would become:. We will now iterate through 16 cycles, each using one of the 16 bit keys we computed previously.
We will use a function f which operates over a data block of 32 bits and a key K n of 48 bits to produce a 32 bits block. For n from 1 to 16 we compute:. This is, in each iteration, we take the right 32 bits of the previous result and make them the left 32 bits of the current step. The right 32 bits in the current step are computed XORing the left 32 bits of the previous step with the result of the f function.
This will result in a final block L 16 R To calculate f , we first expand each block R n-1 from 32 bits to 48 bits. This is done by using a selection table that repeats some of the bits in R n This selection table E has a 32 bit input block R n-1 and a 48 bit output block. Let E be such that the 48 bits of its output, written as 8 blocks of 6 bits each, are obtained by selecting the bits in its inputs in order according to the following table:.
In our example we can get E R 0 from R 0 as follows:. We have not yet finished calculating the function f. To this point we have expanded R n-1 from 32 bits to 48 bits, using the selection table, and XORed the result with the key K n.
We now have 48 bits, that will be used as addresses for the " S boxes ". An S box takes as input 6 bits and gives 4 bits output that will replace the 6 bits input.
We have 8 groups of 6 bits B i , which will then be transformed in 8 groups of 4 bits, for a total of 32 bits. The first and last bits of B represent in base 2 a number in the decimal range 0 to 3 binary 00 to This is nothing but jugglery of bit positions of the original plain text block.
As we have noted after IP is done, the resulting bit permuted text block is divided into two half blocks. Each half-block consists of 32 bits, and each of the 16 rounds, in turn, consists of the broad level steps outlined in the figure.
Step Key transformation — We have noted initial bit key is transformed into a bit key by discarding every 8th bit of the initial key. Thus, for each a bit key is available. From this bit key, a different bit Sub Key is generated during each round using a process called key transformation. For this, the bit key is divided into two halves, each of 28 bits. These halves are circularly shifted left by one or two positions, depending on the round.
For example, if the round numbers 1, 2, 9, or 16 the shift is done by only position for other rounds, the circular shift is done by two positions. The number of key bits shifted per round is shown in the figure. After an appropriate shift, 48 of the 56 bits are selected. For instance, after the shift, bit number 14 moves on the first position, bit number 17 moves on the second position, and so on.
If we observe the table carefully, we will realize that it contains only bit positions. Bit number 18 is discarded we will not find it in the table , like 7 others, to reduce a bit key to a bit key. Since the key transformation process involves permutation as well as a selection of a bit subset of the original bit key it is called Compression Permutation.
Because of this compression permutation technique, a different subset of key bits is used in each round. That makes DES not easy to crack. During the expansion permutation, the RPT is expanded from 32 bits to 48 bits. Bits are permuted as well hence called expansion permutation. This happens as the bit RPT is divided into 8 blocks, with each block consisting of 4 bits. Then, each 4-bit block of the previous step is then expanded to a corresponding 6-bit block, i.
This process results in expansion as well as a permutation of the input bit while creating output. The key transformation process compresses the bit key to 48 bits. Then the expansion permutation process expands the bit RPT to bits. Skip to content. Change Language. Related Articles. Computer Network Fundamentals. Physical layer.
Data Link layer. Network layer.
0コメント