You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 18, 2021. It is now read-only.
In the v3 spec, the shared secret of ECDH is being SHA256 and then folded to derive an AES key.
This seems like a potential issue. My impression is that hash functions, by themselves, aren't suitable as Key Derivation Functions (KDFs). The HMAC-based Extract-and-Expand Key Derivation Function (HKDF) paper seems to suggest so as well. HKDF is also a RFC.
Essentially, the output of ECDH would be used as the MAC (called Initial Keying Material in HKDF).
The TL;DR from the paper is this:
In many applications, the input keying material is not necessarily
distributed uniformly, and the attacker may have some partial
knowledge about it (for example, a Diffie-Hellman value computed by a
key exchange protocol) or even partial control of it (as in some
entropy-gathering applications). Thus, the goal of the "extract"
stage is to "concentrate" the possibly dispersed entropy of the input
keying material into a short, but cryptographically strong,
pseudorandom key. In some applications, the input may already be a
good pseudorandom key; in these cases, the "extract" stage is not
necessary, and the "expand" part can be used alone.
The second stage "expands" the pseudorandom key to the desired
length; the number and lengths of the output keys depend on the
specific cryptographic algorithms for which the keys are needed.
I recommend at least a discussion concerning the existing v3 KDF vs the use of a more standard KDF like HKDF.