In symmetric cryptography, including DES, the standard assumption is that the key is randomly and secretly selected among the set of valid keys.
In DES, there are three variations of the set of valid keys, depending on presentation of DES:
- The set of 56-bit bitstrings; in this presentation, all bits potentially have an effect on the output.
- The set of 64-bit bitstrings; in this presentation, only 56 bit can have an effect on the output.
- The subset of 64-bit bitstrings such that when split into 8 segments of 8 bytes, the XOR of the 8 bits in each segment is 1. This is the official method in FIPS PUB 46:
The key is generated in such a way that each of the 56 bits used directly by the algorithm are random and the 8 error detecting bits are set to make the parity of each 8-bit byte of the key odd, i.e., there is an odd number of "l"s in each 8-bit byte.
The main historical reason for this mess is reducing the keyspace of DES to 56 bits so that US authorities would not have excessive trouble breaking it; see this.
Section 6 of FIPS PUB 74 details:
(…) Certain fundamental guidelines should be followed in generating keys. Every bit of the active key should be generated or selected at random. Every possible combination of bits in the active key should have equal probability of being selected, and each key should be generated independently of every other key. The security provided by each of the possible 256 keys is the same although, in certain situations, the dual keys noted earlier may be undesirable because of the characteristic of the algorithm which makes the encrypt and decrypt functions identical for these keys. Repeating a short key to make a 56-bit key severely decreases security. (…)