I am using Diffie-Helman key exchange to generate the shared secret. But how will can a message be encrypted using this shared key?
-
$\begingroup$ Why did you tag this with PQ-crypto? Diffie-Hellman is not PQ secure, neither on finite fields, not on elliptic curves. $\endgroup$– CodesInChaosApr 3, 2015 at 10:05
1 Answer
You can't encrypt a message with ECDH alone, because all it gives you is a shared secret that you can't really control. Rather, you use that secret in a symmetric scheme like AES (generally after passing it through a KBKDF to convert from an ECDH result to a proper-length and less-structured symmetric key, which you then use as the key for symmetric crypto).
-
$\begingroup$ my shared secret is a point(x,y) which is not 256 or 32 bits long. how can i use AES in such a scenario? $\endgroup$– rahulApr 1, 2015 at 20:52
-
-
1$\begingroup$ Note that you need to provide for integrity/authenticity if you want to send the ciphertext over an insecure channel. You could for instance use the resulting AES key in GCM mode of operation. $\endgroup$– Maarten Bodewes ♦Apr 1, 2015 at 22:03