Take the 2-minute tour ×
Cryptography Stack Exchange is a question and answer site for software developers, mathematicians and others interested in cryptography. It's 100% free, no registration required.

I would like someone to explain me how to generate DES subkeys, because in the documentation that I saw, sometimes they say:

"We rotate the initial key according to the number of iterations given by this sequence: 1, 2, 4, 6, 8, 10, 12, 14, 15, 17, 19, 21, 23, 25, 27, 28."

and sometimes they say:

"The two halves are each rotated to the left by an amount depending on the iteration stage, in the following order: 1, 1, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 1."

Do you have any idea why these descriptions are different?

share|improve this question
1  
Why are you using DES? We're not in the 70s anymore. –  Ilmari Karonen Dec 28 '12 at 18:50
    
only, in the school, the teacher –  simonTifo Dec 28 '12 at 19:22
add comment

migrated from stackoverflow.com Jan 2 '13 at 16:11

This question came from our site for professional and enthusiast programmers.

1 Answer

up vote 6 down vote accepted

I'm not going to look up the DES key schedule such, but the connection between your two sequences

$$( a_i ) = ( 1, 2, 4, 6, 8, 10, 12, 14, 15, 17, 19, 21, 23, 25, 27, 28 )$$

and

$$( b_i ) = ( 1, 1, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 1 )$$

is obvious: $b_i = a_i - a_{i - 1}$ (with $a_0$ taken to be 0).

That is, the second sequence gives the difference between successive elements of the first sequence.


Edit: OK, I did look it up, see link above. Basically, the first sequence gives the number of bits by which the halves of the original key need to be rotated to obtain the $i$-th subkey, whereas the second sequence gives the number of bits by which the halves of the previous subkey need to be rotated to obtain the next one. That's all there is to it.

share|improve this answer
    
thank you :), you are right –  simonTifo Dec 28 '12 at 20:31
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.