libsodium on LiveCode?

classic Classic list List threaded Threaded
15 messages Options
Reply | Threaded
Open this post in threaded view
|

libsodium on LiveCode?

J. Landman Gay via use-livecode
I found a thread from a year ago that mentions libsodium:
http://runtime-revolution.278305.n4.nabble.com/SHA1-cracked-What-are-the-chances-this-will-be-addressed-in-LC-td4712554i20.html

I was wondering if anyone had taken a look at what it would take to build
something usable within LiveCode?  My guess is that this is something that
could be addressed as a LCB library to hook into native compiled code for
each platform.  The project itself looks to have make files for all of the
platforms of interest in this community.

I've been looking due to the talk that Andre gave last month at LCG which
mentioned Scuttlebutt (https://www.scuttlebutt.nz/).  The dex library he
demonstrated (https://github.com/soapdog/livecode-dex-lib) implements a
protocol that is very similar, but uses a different encryption method
(RSA).  Upon my initial look, one of the things that would be needed to
interface with Scuttlebutt would be the encryption library (there is a JS
version of the library available, but performance would be much better with
native code and no overhead of the browser object).

Thanks,
Brian
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: libsodium on LiveCode?

J. Landman Gay via use-livecode
On 02/17/2018 10:53 AM, Brian Milby via use-livecode wrote:
> I found a thread from a year ago that mentions libsodium:
> http://runtime-revolution.278305.n4.nabble.com/SHA1-cracked-What-are-the-chances-this-will-be-addressed-in-LC-td4712554i20.html
>
> I was wondering if anyone had taken a look at what it would take to build
> something usable within LiveCode?  My guess is that this is something that
> could be addressed as a LCB library to hook into native compiled code for
> each platform.  The project itself looks to have make files for all of the
> platforms of interest in this community.

Interesting - I thought we were already linked into libsodium, but I see
it's not in the thirdparty directory in the source code. At least not in
the foss version.

--
  Mark Wieder
  [hidden email]


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: libsodium on LiveCode?

J. Landman Gay via use-livecode
Looks like most of the functions use OpenSSL.


Started looking at the headers and there are over 650 function calls in
libsodium. Got bogged down pretty fast though.

Trying to look at some type mappings and am a little confused on how to do
the following:

unsigned char *pk
const unsigned char *seed
unsigned char pk[32]
const unsigned char seed[32]

I know that the const means that it will be in only and the others are
either inout or out. I’m really hoping that we don’t need to use
“MCAggregateTypeInfo” followed by 32 “c” characters. (They don’t use
numbers in the headers but rather #define values).
On Sun, Feb 18, 2018 at 11:02 AM Mark Wieder via use-livecode <
[hidden email]> wrote:

> On 02/17/2018 10:53 AM, Brian Milby via use-livecode wrote:
> > I found a thread from a year ago that mentions libsodium:
> >
> http://runtime-revolution.278305.n4.nabble.com/SHA1-cracked-What-are-the-chances-this-will-be-addressed-in-LC-td4712554i20.html
> >
> > I was wondering if anyone had taken a look at what it would take to build
> > something usable within LiveCode?  My guess is that this is something
> that
> > could be addressed as a LCB library to hook into native compiled code for
> > each platform.  The project itself looks to have make files for all of
> the
> > platforms of interest in this community.
>
> Interesting - I thought we were already linked into libsodium, but I see
> it's not in the thirdparty directory in the source code. At least not in
> the foss version.
>
> --
>   Mark Wieder
>   [hidden email]
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: libsodium on LiveCode?

J. Landman Gay via use-livecode
Made my first attempt to just initialize the library and something is not
working:

Message execution error:
Error description: LCB Error in file
C:/Users/milby/Dropbox/LiveCode/Downloads/lcSodium/sodium.lcb at line 34:
unable to load foreign library
Hint: runtime

Here's all that the LCB does:

private __safe foreign handler _sodium_init() returns CInt binds to
"c:libsodium-23>sodium_init!stdcall"
public handler sodiumInit() returns Integer
return _sodium_init() --this is line 34
end handler

DLLs are in code\x86-win32 and code\x86-win64
(tried with and without the !stdcall)

I probably need to start with something a little simpler ;)
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: libsodium on LiveCode?

J. Landman Gay via use-livecode
In reply to this post by J. Landman Gay via use-livecode
It probably depends on how these are used as to what you want here, however, if all of these are data coming from LCS then I’d suggest you want your LCB handlers to take in Data and then use something like:

__safe foreign handler MCDataGetBytePtr(in pData as Data) returns Pointer binds to "<builtin>”
__safe foreign handler MCDataGetLength(in pData as Data) returns LCUIndex binds to "<builtin>"

public handler DoSomething(in pPK as Data)
    if MCDataGetLength(pPK) is not 32 then
       throw “PK not 32 bytes"
    end if

    variable tPK as Pointer
    put MCDataGetBytePtr(pPK) into tPK
    libsodiumfunction(tPK)

Cheers

Monte

> On 19 Feb 2018, at 5:11 pm, Brian Milby via use-livecode <[hidden email]> wrote:
>
> Looks like most of the functions use OpenSSL.
>
>
> Started looking at the headers and there are over 650 function calls in
> libsodium. Got bogged down pretty fast though.
>
> Trying to look at some type mappings and am a little confused on how to do
> the following:
>
> unsigned char *pk
> const unsigned char *seed
> unsigned char pk[32]
> const unsigned char seed[32]
>
> I know that the const means that it will be in only and the others are
> either inout or out. I’m really hoping that we don’t need to use
> “MCAggregateTypeInfo” followed by 32 “c” characters. (They don’t use
> numbers in the headers but rather #define values).
> On Sun, Feb 18, 2018 at 11:02 AM Mark Wieder via use-livecode <
> [hidden email]> wrote:
>
>> On 02/17/2018 10:53 AM, Brian Milby via use-livecode wrote:
>>> I found a thread from a year ago that mentions libsodium:
>>>
>> http://runtime-revolution.278305.n4.nabble.com/SHA1-cracked-What-are-the-chances-this-will-be-addressed-in-LC-td4712554i20.html
>>>
>>> I was wondering if anyone had taken a look at what it would take to build
>>> something usable within LiveCode?  My guess is that this is something
>> that
>>> could be addressed as a LCB library to hook into native compiled code for
>>> each platform.  The project itself looks to have make files for all of
>> the
>>> platforms of interest in this community.
>>
>> Interesting - I thought we were already linked into libsodium, but I see
>> it's not in the thirdparty directory in the source code. At least not in
>> the foss version.
>>
>> --
>>  Mark Wieder
>>  [hidden email]
>>
>>
>> _______________________________________________
>> use-livecode mailing list
>> [hidden email]
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: libsodium on LiveCode?

J. Landman Gay via use-livecode
In reply to this post by J. Landman Gay via use-livecode


> On 20 Feb 2018, at 8:56 am, Brian Milby via use-livecode <[hidden email]> wrote:
>
> Made my first attempt to just initialize the library and something is not
> working:
>
> Message execution error:
> Error description: LCB Error in file
> C:/Users/milby/Dropbox/LiveCode/Downloads/lcSodium/sodium.lcb at line 34:
> unable to load foreign library
> Hint: runtime
>
> Here's all that the LCB does:
>
> private __safe foreign handler _sodium_init() returns CInt binds to
> "c:libsodium-23>sodium_init!stdcall"
> public handler sodiumInit() returns Integer
> return _sodium_init() --this is line 34
> end handler
>
> DLLs are in code\x86-win32 and code\x86-win64


> (tried with and without the !stdcall)
>
> I probably need to start with something a little simpler ;)

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: libsodium on LiveCode?

J. Landman Gay via use-livecode
In reply to this post by J. Landman Gay via use-livecode
Hi Brian

Looks like there’s an issues in the code folder stuff. At the moment it will look for `code\x86-win` when deploying a standalone it seems. I will patch it in a bit to `code\x86-win32`. By the looks of the IDE extension loading code it will be actually work for win or win32 (it does a filter with `*-win*` on the folders) at the moment so this is unlikely to be your problem.

For 64 bit it would be `code\x86_64-win32` however that’s only for the FileMaker plugin at the moment so also unlikely to be your problem.

So… just to confirm. Your dll is called libsodium-23.dll and is built for x86? You might want to dump exports to check the dll https://stackoverflow.com/questions/1548637/is-there-any-native-dll-export-functions-viewer <https://stackoverflow.com/questions/1548637/is-there-any-native-dll-export-functions-viewer>

Note you should not use `__safe` here and instead call the function from within an unsafe block.

Cheers

Monte

> On 20 Feb 2018, at 8:56 am, Brian Milby via use-livecode <[hidden email]> wrote:
>
> Made my first attempt to just initialize the library and something is not
> working:
>
> Message execution error:
> Error description: LCB Error in file
> C:/Users/milby/Dropbox/LiveCode/Downloads/lcSodium/sodium.lcb at line 34:
> unable to load foreign library
> Hint: runtime
>
> Here's all that the LCB does:
>
> private __safe foreign handler _sodium_init() returns CInt binds to
> "c:libsodium-23>sodium_init!stdcall"
> public handler sodiumInit() returns Integer
> return _sodium_init() --this is line 34
> end handler
>
> DLLs are in code\x86-win32 and code\x86-win64
> (tried with and without the !stdcall)
>
> I probably need to start with something a little simpler ;)
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: libsodium on LiveCode?

J. Landman Gay via use-livecode
 I was finally able to get the init to return a 0 or 1 (success or already
initialized).   I switched to `code\x86-win` - not sure if that had any
effect based on the other major change I made...

Turns out I was using the wrong version of the dll.  If anyone else wants
to try, here's the path that actually worked:
\libsodium-1.0.16-msvc.zip\Win32\Release\v100\dynamic\libsodium.dll (2
other files there that I included as well)
I was initially trying a different archive, but then switched to the msvc
version.  I started with v141 which didn't work.  I went ahead and tried
v100 which did.  There are also v110, v120, and v140.  I don't know what
the differences are, but at this point am just happy that I can get the
library initialized.  I'll eventually try others and try to figure out what
the numbers mean.

@Monte, I was using __safe based on a thread that Mark W commented in on
the forum.  Essentially if the library is returning just an integer then it
would probably be safe.
http://forums.livecode.com/viewtopic.php?f=93&t=30429

Thanks on the hints on sending data to the library.  I'm also going to need
to receive keys back from the library.  I'm guessing that where it is
listed as pK[32] that it will overwrite the data in the passed in string.
There are other calls that use a pointer and a length as separate arguments
to the function, so the calls provided will be useful there (those are for
encrypting/decrypting content).  I'll probably need to dive into the source
to understand that a bit more (unless their api docs cover it).

Now that I can actually talk to the code, I should be able to experiment.


Here's something that I got working to return the version:

private __safe foreign handler _sodium_library_version_major() returns CInt
binds to "c:libsodium>sodium_library_version_major"
private __safe foreign handler _sodium_library_version_minor() returns CInt
binds to "c:libsodium>sodium_library_version_minor"
public handler sodiumVersion() returns String
variable tResult as String
put "Version " into tResult
put _sodium_library_version_major() formatted as string after tResult
put "." after tResult
put _sodium_library_version_minor() formatted as string after tResult
return tResult --"Version 10.1"
end handler
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: libsodium on LiveCode?

J. Landman Gay via use-livecode


> On 20 Feb 2018, at 4:44 pm, Brian Milby via use-livecode <[hidden email]> wrote:
>
> I was finally able to get the init to return a 0 or 1 (success or already
> initialized).   I switched to `code\x86-win` - not sure if that had any
> effect based on the other major change I made…

I think it will find both win and win32 in the IDE at the moment. I have just submitted patches. It’s bug 20991.

> Turns out I was using the wrong version of the dll.  If anyone else wants
> to try, here's the path that actually worked:
> \libsodium-1.0.16-msvc.zip\Win32\Release\v100\dynamic\libsodium.dll (2
> other files there that I included as well)
> I was initially trying a different archive, but then switched to the msvc
> version.  I started with v141 which didn't work.  I went ahead and tried
> v100 which did.  There are also v110, v120, and v140.  I don't know what
> the differences are, but at this point am just happy that I can get the
> library initialized.  I'll eventually try others and try to figure out what
> the numbers mean.

These are VS toolchain versions. v140 is 2015 and v141 is 2017. I’m not sure if dynamic in that path refers to it being a dll v lib or the CRT linking. If there’s a folder with static/libsodium.dll then use that. It may be that resolves your issue with v141...
>
> @Monte, I was using __safe based on a thread that Mark W commented in on
> the forum.  Essentially if the library is returning just an integer then it
> would probably be safe.
> http://forums.livecode.com/viewtopic.php?f=93&t=30429 <http://forums.livecode.com/viewtopic.php?f=93&t=30429>

Ah, well, I’m not as smart as Mark so I just let everything that’s not in the engine default to unsafe ;-)
>
> Thanks on the hints on sending data to the library.  I'm also going to need
> to receive keys back from the library.  I'm guessing that where it is
> listed as pK[32] that it will overwrite the data in the passed in string.
> There are other calls that use a pointer and a length as separate arguments
> to the function, so the calls provided will be useful there (those are for
> encrypting/decrypting content).  I'll probably need to dive into the source
> to understand that a bit more (unless their api docs cover it).

So you need a buffer as inout for the library to write to? Something like this.

__safe foreign handler MCDataCreateWithBytesAndRelease(in pBytes as Pointer, in pCount as LCUIndex, out rData as Data) returns CBool binds to "<builtin>"
__safe foreign handler MCMemoryAllocate(in pSize as LCUIndex, out rBlock as Pointer) returns CBool binds to "<builtin>”
__safe foreign handler MCMemoryDeallocate(in pBlock as Pointer) returns nothing binds to "<builtin>”

variable tBuffer as Pointer
if not MCMemoryAllocate(32, tBuffer) then
   throw “uh oh”
end if

CallThingThatSetsBuffer(tBuffer)

variable tData as Data
if not MCDataCreateWithBytesAndRelease(tBuffer, 23, tData) then
   MCMemoryDeallocate(tBuffer)
   throw “uh oh"
end if

return tData

>
> Now that I can actually talk to the code, I should be able to experiment.
>
>
> Here's something that I got working to return the version:
>
> private __safe foreign handler _sodium_library_version_major() returns CInt
> binds to "c:libsodium>sodium_library_version_major"
> private __safe foreign handler _sodium_library_version_minor() returns CInt
> binds to "c:libsodium>sodium_library_version_minor"
> public handler sodiumVersion() returns String
> variable tResult as String
> put "Version " into tResult
> put _sodium_library_version_major() formatted as string after tResult
> put "." after tResult
> put _sodium_library_version_minor() formatted as string after tResult
> return tResult --"Version 10.1"
> end handler
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: libsodium on LiveCode?

J. Landman Gay via use-livecode
Monte, you are awesome!

With your help I was able to generate a key pair using libSodium. That
means that we are one huge step closer to asymmetric key generation and use
within LC.

For each tool chain they provided a static and dynamic directory. The
static just contained a .lib file. The dynamic contains 3 or 4 files.
Starting at 140 a .pdb file is added. The latest one that works is v120.

Thanks for the help!
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: libsodium on LiveCode?

J. Landman Gay via use-livecode


> On 21 Feb 2018, at 2:57 pm, Brian Milby <[hidden email]> wrote:
>
> Monte, you are awesome!

Cheers! Not feeling so awesome today… been banging my head on something all day and getting nowhere :-(
>
> With your help I was able to generate a key pair using libSodium. That means that we are one huge step closer to asymmetric key generation and use within LC.

Hmm… have you seen tsNetGenerateKey ?
>
> For each tool chain they provided a static and dynamic directory. The static just contained a .lib file. The dynamic contains 3 or 4 files.  Starting at 140 a .pdb file is added. The latest one that works is v120.
>
> Thanks for the help!

OK, I’m not sure why they aren’t working. The main thing I’d look for is if they are built to dynamic link to the CRT and you don’t have the corresponding version of MSVS or the redistributable packages installed. You could try installing this and then test 140 https://www.microsoft.com/en-au/download/details.aspx?id=48145 <https://www.microsoft.com/en-au/download/details.aspx?id=48145>

Cheers

Monte

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: libsodium on LiveCode?

J. Landman Gay via use-livecode
Had not seen the tsNet handler, but that is an RSA key. Scuttlebutt uses a
different key type. There are other useful things in the library. There is
some overlap, but enough different to make it worthy of an effort.

I’ll need to take a look at the MS links.

Hopefully the rest of today and tomorrow will go better!
On Tue, Feb 20, 2018 at 10:13 PM Monte Goulding via use-livecode <
[hidden email]> wrote:

>
>
> > On 21 Feb 2018, at 2:57 pm, Brian Milby <[hidden email]> wrote:
> >
> > Monte, you are awesome!
>
> Cheers! Not feeling so awesome today… been banging my head on something
> all day and getting nowhere :-(
> >
> > With your help I was able to generate a key pair using libSodium. That
> means that we are one huge step closer to asymmetric key generation and use
> within LC.
>
> Hmm… have you seen tsNetGenerateKey ?
> >
> > For each tool chain they provided a static and dynamic directory. The
> static just contained a .lib file. The dynamic contains 3 or 4 files.
> Starting at 140 a .pdb file is added. The latest one that works is v120.
> >
> > Thanks for the help!
>
> OK, I’m not sure why they aren’t working. The main thing I’d look for is
> if they are built to dynamic link to the CRT and you don’t have the
> corresponding version of MSVS or the redistributable packages installed.
> You could try installing this and then test 140
> https://www.microsoft.com/en-au/download/details.aspx?id=48145 <
> https://www.microsoft.com/en-au/download/details.aspx?id=48145>
>
> Cheers
>
> Monte
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: libsodium on LiveCode?

J. Landman Gay via use-livecode
In reply to this post by J. Landman Gay via use-livecode
Sounds like my day yesterday. Hope you have a breakthrough today!

Bob S


> On Feb 20, 2018, at 20:12 , Monte Goulding via use-livecode <[hidden email]> wrote:
>
>> Monte, you are awesome!
>
> Cheers! Not feeling so awesome today… been banging my head on something all day and getting nowhere :-(
>

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: libsodium on LiveCode?

J. Landman Gay via use-livecode
In reply to this post by J. Landman Gay via use-livecode
What type of key do you need to generate?

> On 21 Feb 2018, at 2:50 pm, Brian Milby via use-livecode <[hidden email]> wrote:
>
> Had not seen the tsNet handler, but that is an RSA key. Scuttlebutt uses a
> different key type. There are other useful things in the library. There is
> some overlap, but enough different to make it worthy of an effort.
>
> I’ll need to take a look at the MS links.
>
> Hopefully the rest of today and tomorrow will go better!
> On Tue, Feb 20, 2018 at 10:13 PM Monte Goulding via use-livecode <
> [hidden email]> wrote:
>
>>
>>
>>> On 21 Feb 2018, at 2:57 pm, Brian Milby <[hidden email]> wrote:
>>>
>>> Monte, you are awesome!
>>
>> Cheers! Not feeling so awesome today… been banging my head on something
>> all day and getting nowhere :-(
>>>
>>> With your help I was able to generate a key pair using libSodium. That
>> means that we are one huge step closer to asymmetric key generation and use
>> within LC.
>>
>> Hmm… have you seen tsNetGenerateKey ?
>>>
>>> For each tool chain they provided a static and dynamic directory. The
>> static just contained a .lib file. The dynamic contains 3 or 4 files.
>> Starting at 140 a .pdb file is added. The latest one that works is v120.
>>>
>>> Thanks for the help!
>>
>> OK, I’m not sure why they aren’t working. The main thing I’d look for is
>> if they are built to dynamic link to the CRT and you don’t have the
>> corresponding version of MSVS or the redistributable packages installed.
>> You could try installing this and then test 140
>> https://www.microsoft.com/en-au/download/details.aspx?id=48145 <
>> https://www.microsoft.com/en-au/download/details.aspx?id=48145>
>>
>> Cheers
>>
>> Monte
>>
>> _______________________________________________
>> use-livecode mailing list
>> [hidden email]
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: libsodium on LiveCode?

J. Landman Gay via use-livecode
Here is a paragraph from scuttlebutt.nz which documents what I’m looking to
interface with:

In nacl both types of keys are used, signing keys are ed25519 keys, and
exchange keys are curve25519 keys. sign uses ed25519 keys, and scalarmult
takes curve25519. box takes two exchange keys, and then uses scalarmult
internally. There is also another function secretbox that just takes a
symmetric key, say the output of scalarmult.

So it is a bit more than just getting a key pair.

Thanks,
Brian
On Wed, Feb 21, 2018 at 4:58 PM Charles Warwick <
[hidden email]> wrote:

> What type of key do you need to generate?
>
> > On 21 Feb 2018, at 2:50 pm, Brian Milby via use-livecode <
> [hidden email]> wrote:
> >
> > Had not seen the tsNet handler, but that is an RSA key. Scuttlebutt uses
> a
> > different key type. There are other useful things in the library. There
> is
> > some overlap, but enough different to make it worthy of an effort.
> >
> > I’ll need to take a look at the MS links.
> >
> > Hopefully the rest of today and tomorrow will go better!
> > On Tue, Feb 20, 2018 at 10:13 PM Monte Goulding via use-livecode <
> > [hidden email]> wrote:
> >
> >>
> >>
> >>> On 21 Feb 2018, at 2:57 pm, Brian Milby <[hidden email]> wrote:
> >>>
> >>> Monte, you are awesome!
> >>
> >> Cheers! Not feeling so awesome today… been banging my head on something
> >> all day and getting nowhere :-(
> >>>
> >>> With your help I was able to generate a key pair using libSodium. That
> >> means that we are one huge step closer to asymmetric key generation and
> use
> >> within LC.
> >>
> >> Hmm… have you seen tsNetGenerateKey ?
> >>>
> >>> For each tool chain they provided a static and dynamic directory. The
> >> static just contained a .lib file. The dynamic contains 3 or 4 files.
> >> Starting at 140 a .pdb file is added. The latest one that works is v120.
> >>>
> >>> Thanks for the help!
> >>
> >> OK, I’m not sure why they aren’t working. The main thing I’d look for is
> >> if they are built to dynamic link to the CRT and you don’t have the
> >> corresponding version of MSVS or the redistributable packages installed.
> >> You could try installing this and then test 140
> >> https://www.microsoft.com/en-au/download/details.aspx?id=48145 <
> >> https://www.microsoft.com/en-au/download/details.aspx?id=48145>
> >>
> >> Cheers
> >>
> >> Monte
> >>
> >> _______________________________________________
> >> use-livecode mailing list
> >> [hidden email]
> >> Please visit this url to subscribe, unsubscribe and manage your
> >> subscription preferences:
> >> http://lists.runrev.com/mailman/listinfo/use-livecode
> > _______________________________________________
> > use-livecode mailing list
> > [hidden email]
> > Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-livecode
>
>
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode