Subject: Re: Added OS X Native Crypto Support

Re: Added OS X Native Crypto Support

From: Marc Hörsken <>
Date: Mon, 5 Jan 2015 20:49:04 +0100

Hello Keith,

> Am 02.12.2014 um 16:34 schrieb Keith Duncan <>:
> Similar to the WinCNG crypto backend I’ve added support for using the OS X native crypto support as a libssh2 crypto backend.

thank you very much for creating this native crypto backend.

> <>
Would you mind rebasing your work to the current master branch and keep it in a separate branch inside your repository so reviewing and rebasing becomes easier for me and the other people around here?
Thanks in advance.

> It looks like Nick Zitzmann also started a similar project in 2012 but discovered that there’s no public BigNum API in OS X <>
> I ran in to the same issue but went ahead and used the private BigNum API he references. For this reason I’m not sure that this would be a good candidate for submitting upstream. Then again perhaps it could serve as a compelling reason for the API to be made public if it would enable OS X native SSH2 crypto.

Instead of using a private API you could also try to use the RSA encryption method to perform the necessary big number operation, which currently is only modular exponentiation.
I used this approach to implement the native crypto backend on Windows, since it does not have a big number library either.
Please see the following email for more information: [1]
The implementation using RSA encryption can be found here: [2]

> I hope this is of interest, let me know if there’s any interest in a patch.

I would really like to see this merged the same way as the WinCNG backend was, because it would allow someone to build libssh2 and then also curl with ssh support using just the native crypto libraries.

Best regards,


Received on 2015-01-05