Arrays: digitally signing them

Richard Gaskin ambassador at
Tue Jan 12 13:25:53 EST 2016

David Bovill wrote:

> I was looking into standards for digitally signing JSON - and I wandered
> about signing Livecode arrays. This would need some way to normalise the
> array construction as (from the docs):
> Arrays in LiveCode are un-ordered. This means in particular that encoding
>> two arrays will not necessarily produce the same result, even if the arrays
>> had the same elements. To compare two arrays, simply use the = operator
>> directly on them rather than encoding them first.
> I take this to mean that depending on exactly how (the order of
> construction), a Livecode array is created, it's hash will be different, as
> will the result of arrayDecode.
> Is this right? Any thoughts on how to digitally sign an array? If this
> proves as complex as i think, it may be more useful to replicate the JSON-LD
> signature algorithm: <>

Would BSON lend itself to signing?

As a binary format it could offer the efficiency of LSON (my pet name 
for LiveCode encoded arrays, which I've found clients tend to respond 
favorably to), but also the benefit of being a standard open format like 

Some time ago I submitted a request for BSONencode and BSONdecode:

Peter's point there is well taken, that this could be implemented as a 
library; it wouldn't even need to be in Builder, since LiveCode is much 
faster to develop in, runs a bit faster, and already has the binary 
functions to support it.

The only downside to implementing that in either scripting language is 
the very desirability of BSON:  we choose the encumbrance of binary 
formats for the benefit of performance.  In C++ it would be wonderful; 
in any scripting language that benefit would be compromised.

An external perhaps?

  Richard Gaskin
  Fourth World Systems
  Software Design and Development for the Desktop, Mobile, and the Web
  Ambassador at      

More information about the Use-livecode mailing list