Is KDF based on HMAC-SHA-256(Hashed Message Authentication Code, Secure Hash Algorithm) algorithm a suitable option to generate symmetric key from the secret key?

What is the basic funda, behind using KDF after getting the secret key. Can the secret key itself be used as the symmetric key.

  • $\begingroup$ By KDF do you specifically mean HKDF, which you chose as a tag? $\endgroup$
    – otus
    Jul 19, 2014 at 11:11
  • $\begingroup$ I mean Single-step Key-Derivation Function (section 5.8.1 -NIST.SP.800-56Ar2 document) $\endgroup$
    – Kiran
    Jul 19, 2014 at 11:45
  • $\begingroup$ Is HKDF and Single-step Key-Derivation Function using SHA-256 same? $\endgroup$
    – Kiran
    Jul 19, 2014 at 11:57
  • $\begingroup$ See RFC 2898 for KDFs based on cryptographically secure hash algorithms and MACs. $\endgroup$
    – marstato
    Jul 19, 2014 at 12:03

1 Answer 1


Yes, according to NIST SP 800-56A revision 2, a KDF based on HMAC-SHA-256 is a suitable option.

The basic idea behind using a Key Based Key Derivation Function KBKDF is that the output of the the primitive within the key agreement protocol (DH, ECDH) returns enough entropy for a key to be created. However that entropy may still be distinguishable from random. For instance, the first bit of the secret after a Diffie-Hellman key agreement will certainly be biased. Hence it is required that a KDF extracts the entropy into a key that is indistinguishable from random.

Besides the extraction of the entropy, the KDF may also be used to expand the amount of key material. This key material can be generated by supplying different otherInfo or counter to the KDF (preferred) or by requesting a larger output from the KDF. Note that the entropy within the keys is still bounded by the entropy in the output of the extraction phase or the internal state of the KDF.

The question if the secret can be used as symmetric key directly depends on the key agreement used. I've asked a specific question for Diffie-Hellman here. Note that the KDF calculation should take a small amount of processor time and memory, especially compared to for instance DH or ECDH.

  • 1
    $\begingroup$ I've removed the language specific part of the answer (edited out from the question by otus). As you ask if a KDF based on HMAC-SHA-256 is identical on multiple platforms, the side question is impossible to answer. Usually crypto algorithms are identical if they 1) are based and tested against standards and 2) they apply the same encoding (if any) to the input and output. $\endgroup$
    – Maarten Bodewes
    Jul 20, 2014 at 13:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.