jedisct1 / libhydrogen

A lightweight, secure, easy-to-use crypto library suitable for constrained environments.
https://libhydrogen.org
Other
608 stars 92 forks source link

Bindings #22

Closed someburner closed 6 years ago

someburner commented 6 years ago

Hi,

I'm hoping to use libhydrogen for an ESP8266-based project. I have successfully integrated most methods on the ESP, and wrote a C++ utility to sign/encrypt payloads for testing. But now we're working on integration and the lack of php or python bindings is unfortunate. I can probably write a python module, but neither I nor my colleague have experience writing a php extension from scratch. I thought phosphine would be at least a start, but it appears to be just a skeleton with nothing actually implemented.

Looking at your other repo libsodium-php it looks like there might be a good amount of overlap in a libhydrogen port. So, is there any effort or plans for a port for libhydrogen?

someburner commented 6 years ago

We got something going here.

jedisct1 commented 6 years ago

Oh, wow, this is neat!

Having bindings for all major languages is definitely needed. I started with Rust, but JS and PHP were obviously planned to be next.

PHP is by far the worst language to write bindings for, so I kept postponing it. But indeed, these should be pretty close to the libsodium ones, so quite a lot of code can just be reused.

Thanks for kicking this off!

someburner commented 6 years ago

Np! thanks for libsodium + libhydrogen :+1:

(edit: I take 0 credit, I'm just the instigator)

someburner commented 6 years ago

@jedisct1 - Made some progress on python, it's up here: https://github.com/someburner/pyhy

Only thing I had an issue with so far is cffi not liking _hydro_attr_warn_unused_result_ and other method attributes. Not a big deal but it would be nice to source the file verbatim, so I'll try to see if there's any way around that that's clean.

someburner commented 6 years ago

Added a demo with mqtt: https://github.com/someburner/pyhy/tree/master/demo

far enough to be added to the bindings wiki page?

someburner commented 6 years ago

thanks!

jedisct1 commented 6 years ago

Great work, thank you!

trampi commented 6 years ago

I will take a look at creating bindings for Node.js or porting it to plain JS today and tomorrow. I have never done this before, wish me luck ;-)

jedisct1 commented 6 years ago

Awesome! Good luck, Fabian!

someburner commented 6 years ago

Me again- I ended up re-writing a bunch of my services in go, so I made go bindings here. I'm still sorta new to go, so feedback welcome.

nxrighthere commented 5 years ago

@jedisct1 C# wrapper is here https://github.com/nxrighthere/Hydrogen-CSharp ❤️