# How convert Point on Curve into AES key?

I'm playing around with ECC, trying to encrypt traffic between my webapp and backend (its not a product, im trying to learn and understand more about ECC)

I managed to generate keys, successful run key exchange and got same point on both ends.

Now I wonder how I should convert my point which has 2 coordinates into AES key.

• Are you using ECDH for key exchange? Not a clear question. – kelalaka Jun 21 at 9:59
• SEC1 codifies ECDH, and uses a Key Derivation Function. – fgrieu Jun 21 at 10:05
• @kelalaka i did ECDH, i multiply alices public key(which i haf as point) by bobs private key (and vice versa) and i got shared point on curve. now my question is, how i should convert tuple (x,y) into 256bit key. – user902383 Jun 21 at 11:56
• KDF's as fgrieu pointed. – kelalaka Jun 21 at 12:22

The expressions “key agreement” and “key exchange” are often used to mean a mechanism like (elliptic curve) Diffie-Hellman, but (EC)DH itself does not produce a key, it only produces a shared secret. This secret is in some numerical range that depends on the curve: not all $$2^n$$-bit values are possible. Even within this range, it is not uniformly distributed (it can't be since there isn't the same number of private points and public coordinates).