Score:2

How can we link AES with Elliptic Curve Diffie-Hellman Key Exchange Method

jp flag

Actually, I am working on a project to combine symmetric and asymmetric cryptographic algorithms.

The shared secret key for AES will be generated through the Elliptic Curve Diffie Hellman Key Exchange (ECDH) Method. I have one question that ECDH will generate a shared secret key of 256 bit or more length key. For AES-128 I need a secret key of 128 bit but ECDH is not generating the 128-bit key.

So how can I convert the variable-length key into 128 bit?

kelalaka avatar
in flag
In SO, if the answer is useful, one usually upvotes, and if you are the asker, if the answer satisfies you, you can accept the answer. Have fun.
Score:3
in flag

There is already good scheme for this, Elliptic Curve Integrated Encryption Scheme (ECIES);

Once you exchanged the keys with ECDH, then you can use a KDF to derive any key length, HKDF is fine.

ECIES also authenticates the ciphertext as Encrypted-then-MAC. In order to use MAC, you need another key. You can use HKDF to derive many keys by providing different info parameters for each required key. Since your key is random you don't need the extract part of the HKDF, if available, just use expand part.

As an advice, use AES-256, it is only %40 times slower than AES-128, however, it is secure against Quantum and Multi-target attacks.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.