Subject: DES key derivation

From: "Ron Hoffman" <[email-masked]>
Date: Tue, 26 Mar 2002 16:42:29 -0500

RFC 2025 specifies how to derive the 56 bits of key material for the
DES-CBC and DES-MAC algorithms.  But it doesn't indicate how the 8-byte
DES key is to be constructed (DES keys contain 56 key bits and 8 parity
bits).

My first thought was the 56 bits of key material should be treated as a
bit string and broken into 8 blocks of 7 bits each.  The parity bit
would then be added to each 7-bit block to form an 8-bit block.  This
results in some
bit manipulation to get the proper alignments within each key byte.

However, Kerberos takes a different approach and treats the 56-bits of
key material as 7 blocks of 8 bits each.  The high-order 7 bits of each
key material byte remain unchanged and are used for the first 7 bytes of
the DES key.  The final key byte is formed from the low-order bits of
each key material byte.  The parity bits are then set, overwriting the
low-order bit in each byte.

Any thoughts on which approach should be used to construct the DES key?
Either approach yields a valid DES key but we obviously won't
interoperate unless the keys are formed the same way on all platforms.

Ron Hoffman ([email-masked])