<div dir="ltr">Hi Jeff,<div><br></div><div>Thanks a lot for the detailed explanation. Since I have a requirement to use the certificate public/private keys for encryption/decryption I believe I should be able to use <span style="font-size:14.4444446563721px"> </span><span style="font-size:14.4444446563721px"><span class="" id=":1ie.1" tabindex="-1">ECDHE</span> based approach</span>. </div><div><br></div><div>Regards</div><div><span class="" id=":1ie.2" tabindex="-1">Jayalakshmi</span></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Apr 26, 2015 at 11:41 PM, Jeffrey Walton <span dir="ltr"><<a href="mailto:noloader@gmail.com" target="_blank">noloader@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Mon, Apr 27, 2015 at 12:54 AM, Jayalakshmi bhat<br>
<<a href="mailto:bhat.jayalakshmi@gmail.com">bhat.jayalakshmi@gmail.com</a>> wrote:<br>
> Hello All,<br>
><br>
> I am working on a project where there is need to encrypt and decrypt certain<br>
> data using certificate public/private key pair. So far we were using RSA<br>
> based certificates. OpenSSL provides good number of API's for RSA based<br>
> encryption/decryption operation.<br>
><br>
> Now we are planning to support ECDSA based certificates also. I am not able<br>
> to find any encryption/decryption API's in EC context.<br>
><br>
> I wanted to know are there any encryption/decryption API's using ECDSA based<br>
> public/private key pair. Or is there any sample code I can look into.<br>
</div></div>ECDSA is a signing algorithm used for authentication. If you want to<br>
encrypt/decrypt, then you need something else.<br>
<br>
In the case of SSL/TLS, the something else is ECDHE. A shared secret<br>
drops out of the ECDHE key exchange, and that's used to key a channel<br>
for bulk encryption. The ECDSA signature authenticates ECDHE<br>
parameters so you know they are authentic (i.e., from the party who<br>
you expect, and not an adversary).<br>
<br>
In addition to ECDHE, another choice is the MQV family of key<br>
exchanges. Its a family now because MQV leaked some information about<br>
the private exponent, so Krawczyk provided "Hashed MQV" (HMWV). HMQV<br>
was later improved by Sarr, Elbaz–Vincent, and Bajard with "Fully<br>
Hashed MQV" (FHMQV).<br>
<br>
As far as encryption systems outside of SSL/TLS, check out Elliptic<br>
Curve Integrated Encryption Scheme (ECIES). You can do bulk encryption<br>
and decryption with it also. But it does not use an ECDSA key per se;<br>
rather, its just a ecPublicKey ASN.1 type.<br>
<br>
ECIES a Diffie-Hellman based integrated scheme that combines a Key<br>
Encapsulation Mechanism (KEM) with a Data Encapsulation Mechanism<br>
(DEM). The output is a 3-tuple {K,C,T}, where K is a "encrypted shared<br>
secret" (lots of hand waiving), C is the cipher text and T is an<br>
authentication tag. In ECIES, K is really half of a ECDHE exchange<br>
with an ephemeral key. To recover the "encrypted shared secret", the<br>
person doing the decryption uses their long term static key to perform<br>
the other half of the key exchange, and that's the shared secret. The<br>
shared secret is then digested with a KDF and used to key a stream<br>
cipher and a HMAC.<br>
<br>
Jeff<br>
_______________________________________________<br>
openssl-users mailing list<br>
To unsubscribe: <a href="https://mta.openssl.org/mailman/listinfo/openssl-users" target="_blank">https://mta.openssl.org/mailman/listinfo/openssl-users</a><br>
</blockquote></div><br></div>