|
|||||||||||
|
linux-ipsec: "parity is for farmers"
From: Henry Spencer <henry%spenford(at)zoo.toronto.edu>
Date: Thu Mar 19 1998 - 18:48:00 EST
Background: a DES key is really 56 bits, but just to be difficult, the
DES spec says that it's written as 64 bits with a parity bit in each byte
The mechanics of random-key generation are not badly affected. Just pretending that the DES key is really 64 random bits incurs no great cost, and in fact that is what Pluto currently does. The problem is whether anybody along the way through IKE, ESP, and DES should actually fix up the parity bits, and if so, who? This also ties in slightly to the issue of checking for weak keys (in the generic sense, including semi-weak keys etc.), since the usual weak-key tables have the parity bits fixed. (Pluto now simply does not do weak-key checking). The DES FIPS itself does not address the issue of whether correct parity is mandatory. Nor does the ESP draft. The ciph-cbc-02 draft, which seems to be the current relevant one for 3DES, mumbles about how implementations "must consider" the parity bits but does not explain what that is supposed to mean. The des-expiv-01 draft says that the parity bits must be fixed, but does not say by who, and what should happen if they're not -- I *think* this is meant mostly as a preliminary to weak-key checking. I find reasonably clear indications in assorted drafts that the two sides of IKE negotiate fully-random 64-bit keys, so at least we don't seem to have an IKE-level interoperability problem here -- any parity fixing happens after the IKE exchange and is purely a local matter. I note that made-up DES keys for hand keying typically do not have parity set properly, and that requiring that they be fixed before entry would be annoying... although a utility could be provided to help.
There are two good ways of tackling this, I think. One is to say that the
originator of the key is responsible for supplying good keys -- with
parity set, weak keys excluded, etc. -- although that the user of the key
One argument in favor of supplier responsibility is that it avoids the need for back-and-forth interaction between supplier and user, because the key is known to be good before the supplier hands it to the user. One argument in favor of user responsibility is that it centralizes the knowledge of what needs to be done (what keys are weak, how parity is defined, etc.) and leaves everybody else simply dealing with random bits. A related argument is that there can be more than one user involved. In particular, both the kernel and Pluto have to know how to do DES, because the encryption used for IKE is currently done within Pluto. This line of argument is weakened considerably by the observation that both can just use the same library (as indeed they do, although at the moment they've got independent copies of it -- I'll try to fix that for the next release). It seems to me that the best approach is to declare this parity nonsense to be a stupid mistake whose impact we will confine to the smallest possible area. That means that key suppliers (Pluto and the hand-keying interface) will ignore the issue and supply 64 random bits, and any key users (the kernel, and Pluto's internal encryption) who need the parity bits fixed for their own internal reasons must fix them. Similarly, the primary onus for weak-key rejection should be on the key users, to minimize the possibility of unintentional disagreements due to uncoordinated updates. Key suppliers who need to be sure they've got a good key should consult the intended key user rather than duplicating the information about how to determine the goodness of keys.
(Note "the intended key user", not "a key user". This means that if Pluto
Henry Spencer
henry@spsystems.net
(henry@zoo.toronto.edu)
Received on Thu Mar 19 19:58:45 1998This archive was generated by hypermail 2.1.8 : Wed Aug 23 2006 - 12:59:28 EDT |
||||||||||
|
|||||||||||