I have heard that to combine two keys HKDF is better than using XOR function. But if you look at the HKDF RFC I could not figure out how to use it for concatenating two keys. What I can see is HKDF can be used to derive a key from another key. So I want to know how to use HKDF to concatenate two keys.
Forgive me for sounding condescending – that’s not the intent – but to “concatenate 2 keys” you use “concatenation” operation. Not XOR, HKDF, HASH/SHA-2, etc. The only proper way of concatenating an n-bit Key1 and m-bit Key2 - without entropy loss - is to concatenate them.