I'm working on an implementation of Krawczyk and Eronen HKDF from RFC 5869. From Krawczyk's original paper, he identifies four inputs to a KDF in Cryptographic Extraction and Key Derivation: The HKDF Scheme. The four inputs are:
- base keying material (secret or seed)
- context information (binds security parameters)
- public salt (optional, provides uniqueness)
- length of derived key
I'm trying to reconcile the differences between a KDF (used in, say, a Diffie-Hellman based scheme) and a PBKDF (used for, say, digesting a password into key material) to provide a common software interface. I think the difference are:
- KDFs generally enjoy higher entropy seeds, and don't use an iteration count
- PBKDFs generally lack higher entropy seeds, and use an iteration count to help with some attacks. Sometimes they use a purpose byte, sometimes they use a salt, etc. (The purpose byte seems to be a specialization of contextual information).
Adding PBKDF to the requirements, I think the list becomes:
- base keying material (secret or seed)
- context information (binds security parameters)
- public salt (optional, provides uniqueness)
- length of derived key (optional)
- iteration count
I want to ensure that the security parameters are well represented in a extensible way, which leads me to two questions:
- Is it fair to say a PBKDF is a specialization of KDF?
- Will a software interface that support the five parameters above be sufficient?
(Sorry about wandering into software design. I need the help and expertise of folks who understand the cryptography, and not the [purely] software architects).