[Cryptography-dev] Private Set Intersection

Alex Gaynor alex.gaynor at gmail.com
Wed Dec 12 17:01:31 EST 2018


1) By get the bytes I assume you mean for the private value? In that case,
key.private_numbers().private_value will give you it as an integer, then
you can encode it as you like.
2) No, EC private keys do not mathetmatically support encryption. If you
want to encrypt with an elliptic curve private key, you need to do
implement an ECIES scheme where you perform an ECDH exchange with another
key and then encrypt under a key derived from the shared secret.

Alex

On Wed, Dec 12, 2018 at 4:55 PM Prashanth Ravindran <
prashanthravindran at gmail.com> wrote:

> Hi,
>
> I am trying to implement private set intersection using the cryptography
> library, and I would like to take the bytes of a private key and do a
> hash(key_material, message).
>
> 1) How do I get the bytes for an instance of
> cryptography.hazmat.backends.openssl.ec._EllipticCurvePrivateKey
> 2) Is there any way of encrypting a message using the above private key.
>
> Thanks,
> Prashanth
>
> _______________________________________________
> Cryptography-dev mailing list
> Cryptography-dev at python.org
> https://mail.python.org/mailman/listinfo/cryptography-dev
>


-- 
All that is necessary for evil to succeed is for good people to do nothing.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/cryptography-dev/attachments/20181212/a5b1d8a4/attachment.html>


More information about the Cryptography-dev mailing list