# HKDF: Difference between salt and info

I want to do generate individual AES keys for a number of smart cards, based on a random master key (key diversification) and the serial number of the card.

According to the answers to this question HKDF is the/one way to go.

HKDF has three inputs, ikm, salt and info. Feeding in the serial number as part of ikm seems to be incorrect usage (and maybe dangerous because it makes the IKM less random?). That leaves salt and info, which one should I use?

• I don't want to copy and paste for an answer, see section at 3.2 rfc5869 – kelalaka Mar 6 at 20:05
• Possible duplicate of HKDF: ikm, salt and info values – Ilmari Karonen Mar 6 at 20:19
• Unfortunately I don't even understand if these links argue in favor of "salt" or in favor of "info". – AndreKR Mar 6 at 20:30
• From RFC5869: We stress, however, that the use of salt adds significantly to the strength of HKDF. In particular, info may prevent the derivation of the same keying material for different contexts. – kelalaka Mar 6 at 20:39
• @kelalaka I should use salt because different info might not lead to different output keys, is that what you mean? – AndreKR Mar 6 at 20:43

If all you're using HKDF for is deriving subkeys from a uniformly random master key, you don't really need the Extract part of HKDF. So you can simply use your master key directly as the IKM input to HKDF-Expand, and the serial number (plus possibly other identifying information, if you e.g. may need to derive multiple keys per card) as the info input.