Help us on curve25519

Hello team,

I was going through data encryption requirements documentation and learned that we are supposed to use curve25519. As per java sample code, the serialized public key is returned in the format of 0x04(X,Y - encoded in 64 bytes).

I could not find any library that lets me do the same from python. All the exposed interfaces are either expecting 32 bytes key(Y coordinate of the ECPoint) or returning 32 bytes key on serialization.

Please help me here if you have already solved this problem of portability across java and python.

1 Like

Hi,
We were working on data transfer between C# and java system. Gist for C# and Java is available.

We highly encourage you to create a gist/reference implementation for python and share with us, we will add it further to the support documents.

1 Like

Can we get some more reference related to this? We are also facing some issues for PHP

1 Like

@sukreet @_aman_verma any update on the python curve25519 encoding.
I am also having a problem on this exact stage

this has become a road blocker for me…Java bytes scheme is different from python (Java is Big Endian). This is causing issues in creating keys

1 Like

I am assuming this one is already looked at https://pypi.org/project/curve25519-donna/

Hey @Ashish,
Did you implement and tested this ? is it working as expected ?

Not yet. I am in same situation as you are. I am still exploring options.
Did you try that & not working for you?

havent tried it yet…will try this lib out as well

@_aman_verma
Do you have a ready to try script/gist in python which people can use for a quick try?

@_aman_verma @shaun Were you guys able to crack this?

I’d like to know from the team: Why was this encryption part even necessary? Posting to an HTTPS endpoint already does all the encryption for you. Why would you ask thousands of developers to roll out their own crypto despite standard best practices?

And since it might be too late now, regarding the solution: The example provided using Bouncy castle in both C# and Java is very low level, and a better interface to show an example would be to use libsodium. It’s got bindings in almost all languages - NaCl in python, Sodium in PHP, and LazySodium in Java etc.

2 Likes

@_aman_verma @shaun @Ashish @tornadoalert were you guys able to implement this in Python? cc - @sukreet

@abhishek1.kamla @Ashish @_aman_verma @tornadoalert
Checking if anyone was able to implement this using pure python?